Skip to content

Commit cc9177c

Browse files
committed
Fix cs
1 parent d8f10e9 commit cc9177c

32 files changed

+187
-179
lines changed

.php_cs.cache

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"php":"8.0.7","version":"2.19.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true,"align_multiline_comment":true,"array_indentation":true,"declare_strict_types":true,"final_class":true,"global_namespace_import":{"import_classes":true,"import_constants":true,"import_functions":true},"list_syntax":{"syntax":"short"},"lowercase_constants":true,"multiline_comment_opening_closing":true,"native_function_casing":true,"no_empty_phpdoc":true,"no_leading_import_slash":true,"no_superfluous_phpdoc_tags":{"allow_mixed":true},"no_unused_imports":true,"no_useless_else":true,"no_useless_return":true,"ordered_imports":{"imports_order":["class","function","const"]},"ordered_interfaces":true,"php_unit_test_annotation":true,"php_unit_test_case_static_method_calls":{"call_type":"static"},"php_unit_method_casing":{"case":"snake_case"},"single_trait_insert_per_statement":true,"static_lambda":true,"strict_comparison":true,"strict_param":true},"hashes":{"src\/Engine.php":3551558931,"src\/Encoder.php":3739827989,"src\/SimpleEngine.php":4290238216,"src\/HttpBinding\/SoapResponse.php":61122178,"src\/HttpBinding\/SoapRequest.php":1864463774,"src\/Decoder.php":2387333807,"src\/LazyEngine.php":3266250299,"src\/Driver.php":2063335675,"src\/Transport.php":4030453571,"src\/Exception\/RuntimeException.php":1324169754,"src\/Exception\/MetadataException.php":1209161575,"src\/Metadata\/Collection\/XsdTypeCollection.php":4292607689,"src\/Metadata\/Collection\/PropertyCollection.php":4194651118,"src\/Metadata\/Collection\/TypeCollection.php":2172162984,"src\/Metadata\/Collection\/ParameterCollection.php":1402962356,"src\/Metadata\/Collection\/MethodCollection.php":3303625563,"src\/Metadata\/LazyInMemoryMetadata.php":3644769467,"src\/Metadata\/Metadata.php":2999606874,"src\/Metadata\/Model\/Type.php":4034737462,"src\/Metadata\/Model\/XsdType.php":184744432,"src\/Metadata\/Model\/Method.php":2848582160,"src\/Metadata\/Model\/Property.php":3557835267,"src\/Metadata\/Model\/Parameter.php":1678467590,"src\/Metadata\/MetadataProvider.php":1541487960,"tests\/Unit\/HttpBinding\/SoapResponseTest.php":481419200,"tests\/Unit\/HttpBinding\/SoapRequestTest.php":785126059,"tests\/Unit\/SimpleEngineTest.php":367020725,"tests\/Unit\/LazyEngineTest.php":3809437634,"tests\/Unit\/Metadata\/Collection\/PropertyCollectionTest.php":881532723,"tests\/Unit\/Metadata\/Collection\/ParameterCollectionTest.php":3791764129,"tests\/Unit\/Metadata\/Collection\/MethodCollectionTest.php":1077807463,"tests\/Unit\/Metadata\/Collection\/TypeCollectionTest.php":2615673185,"tests\/Unit\/Metadata\/Collection\/XsdTypeCollectionTest.php":2917714206,"tests\/Unit\/Metadata\/LazyInMemoryMetadataTest.php":2020186336,"tests\/Unit\/Metadata\/Model\/MethodTest.php":1711170727,"tests\/Unit\/Metadata\/Model\/ParameterTest.php":2603296264,"tests\/Unit\/Metadata\/Model\/PropertyTest.php":1378006238,"tests\/Unit\/Metadata\/Model\/TypeTest.php":3185340972,"tests\/Unit\/Metadata\/Model\/XsdTypeTest.php":4263506530,"tests\/Fixtures\/DummyTransport.php":2371990076,"tests\/Fixtures\/PassThroughDriver.php":2891185017,"tests\/Fixtures\/InmemoryMetadata.php":2701470598}}
1+
{"php":"8.0.7","version":"2.19.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true,"align_multiline_comment":true,"array_indentation":true,"declare_strict_types":true,"final_class":true,"global_namespace_import":{"import_classes":true,"import_constants":true,"import_functions":true},"list_syntax":{"syntax":"short"},"lowercase_constants":true,"multiline_comment_opening_closing":true,"native_function_casing":true,"no_empty_phpdoc":true,"no_leading_import_slash":true,"no_superfluous_phpdoc_tags":{"allow_mixed":true},"no_unused_imports":true,"no_useless_else":true,"no_useless_return":true,"ordered_imports":{"imports_order":["class","function","const"]},"ordered_interfaces":true,"php_unit_test_annotation":true,"php_unit_test_case_static_method_calls":{"call_type":"static"},"php_unit_method_casing":{"case":"snake_case"},"single_trait_insert_per_statement":true,"static_lambda":true,"strict_comparison":true,"strict_param":true},"hashes":{"src\/Engine.php":3551558931,"src\/Encoder.php":3739827989,"src\/SimpleEngine.php":4290238216,"src\/HttpBinding\/SoapResponse.php":61122178,"src\/HttpBinding\/SoapRequest.php":1864463774,"src\/Decoder.php":2387333807,"src\/LazyEngine.php":3266250299,"src\/Driver.php":2063335675,"src\/Transport.php":4030453571,"src\/Exception\/RuntimeException.php":1324169754,"src\/Exception\/MetadataException.php":1209161575,"src\/Metadata\/Collection\/XsdTypeCollection.php":1310232606,"src\/Metadata\/Collection\/PropertyCollection.php":2735700407,"src\/Metadata\/Collection\/TypeCollection.php":3153869548,"src\/Metadata\/Collection\/ParameterCollection.php":3283787126,"src\/Metadata\/Collection\/MethodCollection.php":2932134934,"src\/Metadata\/LazyInMemoryMetadata.php":3644769467,"src\/Metadata\/Metadata.php":2999606874,"src\/Metadata\/Model\/Type.php":4034737462,"src\/Metadata\/Model\/XsdType.php":184744432,"src\/Metadata\/Model\/Method.php":2848582160,"src\/Metadata\/Model\/Property.php":3557835267,"src\/Metadata\/Model\/Parameter.php":1678467590,"src\/Metadata\/MetadataProvider.php":1541487960,"tests\/Unit\/HttpBinding\/SoapResponseTest.php":481419200,"tests\/Unit\/HttpBinding\/SoapRequestTest.php":785126059,"tests\/Unit\/SimpleEngineTest.php":367020725,"tests\/Unit\/LazyEngineTest.php":3809437634,"tests\/Unit\/Metadata\/Collection\/PropertyCollectionTest.php":881532723,"tests\/Unit\/Metadata\/Collection\/ParameterCollectionTest.php":3791764129,"tests\/Unit\/Metadata\/Collection\/MethodCollectionTest.php":1077807463,"tests\/Unit\/Metadata\/Collection\/TypeCollectionTest.php":2615673185,"tests\/Unit\/Metadata\/Collection\/XsdTypeCollectionTest.php":2917714206,"tests\/Unit\/Metadata\/LazyInMemoryMetadataTest.php":2020186336,"tests\/Unit\/Metadata\/Model\/MethodTest.php":1711170727,"tests\/Unit\/Metadata\/Model\/ParameterTest.php":2603296264,"tests\/Unit\/Metadata\/Model\/PropertyTest.php":1378006238,"tests\/Unit\/Metadata\/Model\/TypeTest.php":3185340972,"tests\/Unit\/Metadata\/Model\/XsdTypeTest.php":4263506530,"tests\/Fixtures\/DummyTransport.php":2371990076,"tests\/Fixtures\/PassThroughDriver.php":2891185017,"tests\/Fixtures\/InmemoryMetadata.php":2701470598}}

src/Decoder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33
namespace Soap\Engine;
44

src/Driver.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
declare( strict_types=1 );
3+
declare(strict_types=1);
44

55
namespace Soap\Engine;
66

77
use Soap\Engine\Metadata\MetadataProvider;
88

9-
interface Driver extends Encoder, Decoder, MetadataProvider
9+
interface Driver extends Decoder, Encoder, MetadataProvider
1010
{
1111
}

src/Encoder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33
namespace Soap\Engine;
44

src/Exception/MetadataException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Soap\Engine\Exception;
66

7-
class MetadataException extends RuntimeException
7+
final class MetadataException extends RuntimeException
88
{
99
public static function typeNotFound(string $name): self
1010
{

src/HttpBinding/SoapRequest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33
namespace Soap\Engine\HttpBinding;
44

5-
class SoapRequest
5+
final class SoapRequest
66
{
77
public const SOAP_1_1 = 1;
88
public const SOAP_1_2 = 2;

src/HttpBinding/SoapResponse.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33
namespace Soap\Engine\HttpBinding;
44

5-
class SoapResponse
5+
final class SoapResponse
66
{
77
private string $payload;
88

src/Metadata/Collection/MethodCollection.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@
1313
/**
1414
* @implements IteratorAggregate<Method>
1515
*/
16-
final class MethodCollection implements IteratorAggregate, Countable
16+
final class MethodCollection implements Countable, IteratorAggregate
1717
{
1818
/**
19-
* @var Method[]
19+
* @var list<Method>
2020
*/
2121
private array $methods;
2222

23+
/**
24+
* @no-named-arguments
25+
*/
2326
public function __construct(Method ...$methods)
2427
{
2528
$this->methods = $methods;

src/Metadata/Collection/ParameterCollection.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212
/**
1313
* @implements IteratorAggregate<Parameter>
1414
*/
15-
final class ParameterCollection implements IteratorAggregate, Countable
15+
final class ParameterCollection implements Countable, IteratorAggregate
1616
{
1717
/**
18-
* @var Parameter[]
18+
* @var list<Parameter>
1919
*/
2020
private array $parameters;
2121

22+
/**
23+
* @no-named-arguments
24+
*/
2225
public function __construct(Parameter ...$parameters)
2326
{
2427
$this->parameters = $parameters;

src/Metadata/Collection/PropertyCollection.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212
/**
1313
* @implements IteratorAggregate<Property>
1414
*/
15-
final class PropertyCollection implements IteratorAggregate, Countable
15+
final class PropertyCollection implements Countable, IteratorAggregate
1616
{
1717
/**
18-
* @var Property[]
18+
* @var list<Property>
1919
*/
2020
private array $properties;
2121

22+
/**
23+
* @no-named-arguments
24+
*/
2225
public function __construct(Property ...$properties)
2326
{
2427
$this->properties = $properties;

src/Metadata/Collection/TypeCollection.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@
1313
/**
1414
* @implements IteratorAggregate<Type>
1515
*/
16-
final class TypeCollection implements IteratorAggregate, Countable
16+
final class TypeCollection implements Countable, IteratorAggregate
1717
{
1818
/**
1919
* @var list<Type>
2020
*/
2121
private array $types;
2222

23+
/**
24+
* @no-named-arguments
25+
*/
2326
public function __construct(Type ...$types)
2427
{
2528
$this->types = $types;

src/Metadata/Collection/XsdTypeCollection.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212
/**
1313
* @implements IteratorAggregate<XsdType>
1414
*/
15-
final class XsdTypeCollection implements IteratorAggregate, Countable
15+
final class XsdTypeCollection implements Countable, IteratorAggregate
1616
{
1717
/**
18-
* @var XsdType[]
18+
* @var list<XsdType>
1919
*/
2020
private array $types;
2121

22+
/**
23+
* @no-named-arguments
24+
*/
2225
public function __construct(XsdType ...$types)
2326
{
2427
$this->types = $types;

src/Metadata/MetadataProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare( strict_types=1 );
3+
declare(strict_types=1);
44

55
namespace Soap\Engine\Metadata;
66

src/Transport.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33

44
namespace Soap\Engine;
55

6-
76
use Soap\Engine\HttpBinding\SoapRequest;
87
use Soap\Engine\HttpBinding\SoapResponse;
98

tests/Fixtures/DummyTransport.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Soap\Engine\HttpBinding\SoapResponse;
99
use Soap\Engine\Transport;
1010

11-
class DummyTransport implements Transport
11+
final class DummyTransport implements Transport
1212
{
1313
private string $response;
1414

tests/Fixtures/InmemoryMetadata.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Soap\Engine\Metadata\Collection\TypeCollection;
99
use Soap\Engine\Metadata\Metadata;
1010

11-
class InmemoryMetadata implements Metadata
11+
final class InmemoryMetadata implements Metadata
1212
{
1313
private TypeCollection $types;
1414
private MethodCollection $methods;

tests/Fixtures/PassThroughDriver.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33
namespace SoapTest\Engine\Fixtures;
44

@@ -7,7 +7,7 @@
77
use Soap\Engine\HttpBinding\SoapResponse;
88
use Soap\Engine\Metadata\Metadata;
99

10-
class PassThroughDriver implements Driver
10+
final class PassThroughDriver implements Driver
1111
{
1212
private string $request;
1313
private array $response;

tests/Unit/HttpBinding/SoapRequestTest.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
use PHPUnit\Framework\TestCase;
88
use Soap\Engine\HttpBinding\SoapRequest;
99

10-
class SoapRequestTest extends TestCase
10+
final class SoapRequestTest extends TestCase
1111
{
12-
public function testRequest()
12+
public function test_request()
1313
{
1414
$request = new SoapRequest('requestbody', 'location', 'action', SoapRequest::SOAP_1_1, 0);
1515

16-
self::assertSame('requestbody', $request->getRequest());
17-
self::assertSame('location', $request->getLocation());
18-
self::assertSame('action', $request->getAction());
19-
self::assertSame(SoapRequest::SOAP_1_1, $request->getVersion());
20-
self::assertSame(0, $request->getOneWay());
16+
static::assertSame('requestbody', $request->getRequest());
17+
static::assertSame('location', $request->getLocation());
18+
static::assertSame('action', $request->getAction());
19+
static::assertSame(SoapRequest::SOAP_1_1, $request->getVersion());
20+
static::assertSame(0, $request->getOneWay());
2121
}
2222
}

tests/Unit/HttpBinding/SoapResponseTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
use PHPUnit\Framework\TestCase;
88
use Soap\Engine\HttpBinding\SoapResponse;
99

10-
class SoapResponseTest extends TestCase
10+
final class SoapResponseTest extends TestCase
1111
{
12-
public function testResponse()
12+
public function test_response()
1313
{
1414
$request = new SoapResponse('response');
1515

16-
self::assertSame('response', $request->getPayload());
16+
static::assertSame('response', $request->getPayload());
1717
}
1818
}

tests/Unit/LazyEngineTest.php

+9-8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace SoapTest\Engine;
66

77
use PHPUnit\Framework\TestCase;
8+
use RuntimeException;
89
use Soap\Engine\LazyEngine;
910
use Soap\Engine\Metadata\Metadata;
1011
use Soap\Engine\SimpleEngine;
@@ -13,7 +14,7 @@
1314
use SoapTest\Engine\Fixtures\InmemoryMetadata;
1415
use SoapTest\Engine\Fixtures\PassThroughDriver;
1516

16-
class LazyEngineTest extends TestCase
17+
final class LazyEngineTest extends TestCase
1718
{
1819
private LazyEngine $engine;
1920
private Metadata $metadata;
@@ -36,23 +37,23 @@ protected function setUp(): void
3637
);
3738
}
3839

39-
public function testItCanRequestSoap()
40+
public function test_it_can_request_soap()
4041
{
4142
$response = $this->engine->request('hello', ['world']);
42-
self::assertSame(['object'], $response);
43+
static::assertSame(['object'], $response);
4344
}
4445

45-
public function testItCanLoadMetadata()
46+
public function test_it_can_load_metadata()
4647
{
47-
self::assertSame($this->metadata, $this->engine->getMetadata());
48+
static::assertSame($this->metadata, $this->engine->getMetadata());
4849
}
4950

50-
public function testIt_does_not_load_until_needed(): void
51+
public function test_it_does_not_load_until_needed(): void
5152
{
5253
$this->expectNotToPerformAssertions();
5354

54-
new LazyEngine(function () {
55-
throw new \RuntimeException('You shall not pass!');
55+
new LazyEngine(static function () {
56+
throw new RuntimeException('You shall not pass!');
5657
});
5758
}
5859
}

tests/Unit/Metadata/Collection/MethodCollectionTest.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Soap\Engine\Metadata\Model\Method;
1212
use Soap\Engine\Metadata\Model\XsdType;
1313

14-
class MethodCollectionTest extends TestCase
14+
final class MethodCollectionTest extends TestCase
1515
{
1616
private MethodCollection $collection;
1717

@@ -22,22 +22,22 @@ protected function setUp(): void
2222
);
2323
}
2424

25-
/** @test */
26-
public function it_can_iterate_over_methods(): void
25+
26+
public function test_it_can_iterate_over_methods(): void
2727
{
28-
self::assertCount(1, $this->collection);
29-
self::assertSame([...$this->collection], $this->collection->map(static fn ($item) => $item));
28+
static::assertCount(1, $this->collection);
29+
static::assertSame([...$this->collection], $this->collection->map(static fn ($item) => $item));
3030
}
3131

32-
/** @test */
33-
public function it_can_fetch_by_name(): void
32+
33+
public function test_it_can_fetch_by_name(): void
3434
{
3535
$method = $this->collection->fetchByName('hello');
36-
self::assertSame('hello', $method->getName());
36+
static::assertSame('hello', $method->getName());
3737
}
3838

39-
/** @test */
40-
public function it_can_fail_fetching_by_name(): void
39+
40+
public function test_it_can_fail_fetching_by_name(): void
4141
{
4242
$this->expectException(MetadataException::class);
4343
$this->collection->fetchByName('nope');

tests/Unit/Metadata/Collection/ParameterCollectionTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Soap\Engine\Metadata\Model\Parameter;
1010
use Soap\Engine\Metadata\Model\XsdType;
1111

12-
class ParameterCollectionTest extends TestCase
12+
final class ParameterCollectionTest extends TestCase
1313
{
1414
private ParameterCollection $collection;
1515

@@ -20,10 +20,10 @@ protected function setUp(): void
2020
);
2121
}
2222

23-
/** @test */
24-
public function it_can_iterate_over_parameters(): void
23+
24+
public function test_it_can_iterate_over_parameters(): void
2525
{
26-
self::assertCount(1, $this->collection);
27-
self::assertSame([...$this->collection], $this->collection->map(static fn ($item) => $item));
26+
static::assertCount(1, $this->collection);
27+
static::assertSame([...$this->collection], $this->collection->map(static fn ($item) => $item));
2828
}
2929
}

tests/Unit/Metadata/Collection/PropertyCollectionTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Soap\Engine\Metadata\Model\Property;
1010
use Soap\Engine\Metadata\Model\XsdType;
1111

12-
class PropertyCollectionTest extends TestCase
12+
final class PropertyCollectionTest extends TestCase
1313
{
1414
private PropertyCollection $collection;
1515

@@ -20,10 +20,10 @@ protected function setUp(): void
2020
);
2121
}
2222

23-
/** @test */
24-
public function it_can_iterate_over_properties(): void
23+
24+
public function test_it_can_iterate_over_properties(): void
2525
{
26-
self::assertCount(1, $this->collection);
27-
self::assertSame([...$this->collection], $this->collection->map(static fn ($item) => $item));
26+
static::assertCount(1, $this->collection);
27+
static::assertSame([...$this->collection], $this->collection->map(static fn ($item) => $item));
2828
}
2929
}

0 commit comments

Comments
 (0)