Skip to content

Commit

Permalink
Merge pull request #556 from veewee/enhance-client-factory-type
Browse files Browse the repository at this point in the history
Enhance client factory param
  • Loading branch information
veewee authored Oct 25, 2024
2 parents a6a828e + 583efda commit 98f6257
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
8 changes: 7 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<phpunit bootstrap="./test/bootstrap.php" colors="true">
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
displayDetailsOnPhpunitDeprecations="true"
bootstrap="./test/bootstrap.php"
colors="true"
>
<testsuites>
<testsuite name="Unit">
<directory>./test/PhproTest/SoapClient/Unit</directory>
Expand Down
6 changes: 6 additions & 0 deletions src/Phpro/SoapClient/CodeGenerator/ClientFactoryGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
])
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(['']),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 98f6257

Please sign in to comment.