From 583efdadef5677f828b7738bcfc69ebbef292fe9 Mon Sep 17 00:00:00 2001 From: Toon Verwerft Date: Fri, 25 Oct 2024 12:50:56 +0200 Subject: [PATCH] Enhance client factory param --- composer.json | 2 +- phpunit.xml | 8 +++++++- .../SoapClient/CodeGenerator/ClientFactoryGenerator.php | 6 ++++++ .../Unit/CodeGenerator/ClientFactoryGeneratorTest.php | 2 ++ .../TypeEnhancer/Calculator/ArrayBoundsCalculatorTest.php | 2 +- .../TypeEnhancer/Calculator/EnumValuesCalculatorTest.php | 2 +- .../TypeEnhancer/Calculator/TypeNameCalculatorTest.php | 2 +- .../TypeEnhancer/Calculator/UnionTypesCalculatorTest.php | 2 +- .../CodeGenerator/TypeEnhancer/MetaTypeEnhancerTest.php | 2 +- 9 files changed, 21 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 7f9ee082..13e86f9e 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "phpspec/phpspec": "~7.2", "phpspec/prophecy-phpunit": "^2.0.1", "phpstan/phpstan": "^1.12.7", - "phpunit/phpunit": "~10.5", + "phpunit/phpunit": "~10.5.37", "squizlabs/php_codesniffer": "^3.7.1", "symfony/cache": "^6.4 || ^7.0" }, diff --git a/phpunit.xml b/phpunit.xml index 9f65639e..bef433b5 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,4 +1,10 @@ - + ./test/PhproTest/SoapClient/Unit diff --git a/src/Phpro/SoapClient/CodeGenerator/ClientFactoryGenerator.php b/src/Phpro/SoapClient/CodeGenerator/ClientFactoryGenerator.php index f12e5345..49cd5d54 100644 --- a/src/Phpro/SoapClient/CodeGenerator/ClientFactoryGenerator.php +++ b/src/Phpro/SoapClient/CodeGenerator/ClientFactoryGenerator.php @@ -77,6 +77,12 @@ public function generate(FileGenerator $file, $context): string 'This factory can be used as a starting point '. 'to create your own specialized factory. Feel free to modify.' ) + ->setTags([ + [ + 'name' => 'param', + 'description' => 'non-empty-string $wsdl', + ], + ]) ) ); diff --git a/test/PhproTest/SoapClient/Unit/CodeGenerator/ClientFactoryGeneratorTest.php b/test/PhproTest/SoapClient/Unit/CodeGenerator/ClientFactoryGeneratorTest.php index 407ea087..5f58b274 100644 --- a/test/PhproTest/SoapClient/Unit/CodeGenerator/ClientFactoryGeneratorTest.php +++ b/test/PhproTest/SoapClient/Unit/CodeGenerator/ClientFactoryGeneratorTest.php @@ -33,6 +33,8 @@ class MyclientFactory /** * This factory can be used as a starting point to create your own specialized * factory. Feel free to modify. + * + * @param non-empty-string \$wsdl */ public static function factory(string \$wsdl) : \App\Client\Myclient { diff --git a/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/Calculator/ArrayBoundsCalculatorTest.php b/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/Calculator/ArrayBoundsCalculatorTest.php index 3d177801..42289583 100644 --- a/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/Calculator/ArrayBoundsCalculatorTest.php +++ b/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/Calculator/ArrayBoundsCalculatorTest.php @@ -23,7 +23,7 @@ public function it_can_enhance_types( self::assertSame($expected, $calculator($meta)); } - public function provideExpectations() + public static function provideExpectations() { yield 'simpleType' => [ new TypeMeta(), diff --git a/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/Calculator/EnumValuesCalculatorTest.php b/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/Calculator/EnumValuesCalculatorTest.php index 12a6a7c0..18ac7385 100644 --- a/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/Calculator/EnumValuesCalculatorTest.php +++ b/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/Calculator/EnumValuesCalculatorTest.php @@ -31,7 +31,7 @@ public function it_fails_on_empty_enumerations(): void (new EnumValuesCalculator())(new TypeMeta()); } - public function provideExpectations() + public static function provideExpectations() { yield 'empty' => [ (new TypeMeta())->withEnums(['']), diff --git a/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/Calculator/TypeNameCalculatorTest.php b/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/Calculator/TypeNameCalculatorTest.php index ae1c02e0..985a8a52 100644 --- a/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/Calculator/TypeNameCalculatorTest.php +++ b/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/Calculator/TypeNameCalculatorTest.php @@ -21,7 +21,7 @@ public function it_can_calculate_type_name(XsdType $xsdType, string $expected): } - public function provideTypeNameCalculations() + public static function provideTypeNameCalculations() { yield 'complexType' => [ XsdType::create('ComplexType')->withMeta( diff --git a/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/Calculator/UnionTypesCalculatorTest.php b/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/Calculator/UnionTypesCalculatorTest.php index 22851da8..103b0c0b 100644 --- a/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/Calculator/UnionTypesCalculatorTest.php +++ b/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/Calculator/UnionTypesCalculatorTest.php @@ -31,7 +31,7 @@ public function it_fails_on_empty_enumerations(): void (new UnionTypesCalculator())(new TypeMeta()); } - public function provideExpectations() + public static function provideExpectations() { yield 'single' => [ (new TypeMeta())->withUnions([ diff --git a/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/MetaTypeEnhancerTest.php b/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/MetaTypeEnhancerTest.php index f9ce213f..bbd13456 100644 --- a/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/MetaTypeEnhancerTest.php +++ b/test/PhproTest/SoapClient/Unit/CodeGenerator/TypeEnhancer/MetaTypeEnhancerTest.php @@ -25,7 +25,7 @@ public function it_can_enhance_types( self::assertSame($expectedPhp, $enhancer->asPhpType($type)); } - public function provideExpectations() + public static function provideExpectations() { yield 'simpleType' => [ new TypeMeta(),