From 401663e7694ceec6b0a845899e071ed7857f9f86 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 --- 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 +- 8 files changed, 20 insertions(+), 6 deletions(-) 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(),