diff --git a/src/Gatherer/Hydrator.php b/src/Gatherer/Hydrator.php index 6f5aa7c..a40aa4a 100644 --- a/src/Gatherer/Hydrator.php +++ b/src/Gatherer/Hydrator.php @@ -20,7 +20,7 @@ public static function gather( Schema ...$schemaClasses, ): \ApiClients\Tools\OpenApiClientGenerator\Representation\Hydrator { return new \ApiClients\Tools\OpenApiClientGenerator\Representation\Hydrator( - ClassString::factory($baseNamespace, 'Hydrator\\' . $className), + ClassString::factory($baseNamespace, 'Internal\\Hydrator\\' . $className), str_replace(['\\', '/'], ['/', $nameSpaceSeperator], lcfirst($className)), $schemaClasses, ); diff --git a/src/Gatherer/Operation.php b/src/Gatherer/Operation.php index 1e18b36..c987f2a 100644 --- a/src/Gatherer/Operation.php +++ b/src/Gatherer/Operation.php @@ -153,9 +153,9 @@ public static function gather( $group = strlen(trim(trim(Utils::dirname($className), '\\'), '.')) > 0 ? trim(str_replace('\\', '', Utils::dirname($className)), '\\') : null; return new \ApiClients\Tools\OpenApiClientGenerator\Representation\Operation( - ClassString::factory($baseNamespace, 'Operation\\' . Utils::fixKeyword($className)), + ClassString::factory($baseNamespace, 'Internal\\Operation\\' . Utils::fixKeyword($className)), ClassString::factory($baseNamespace, $classNameSanitized), - ClassString::factory($baseNamespace, 'Operator\\' . Utils::fixKeyword($className)), + ClassString::factory($baseNamespace, 'Internal\\Operator\\' . Utils::fixKeyword($className)), lcfirst( str_replace( ['\\'], diff --git a/src/Gatherer/WebHookHydrator.php b/src/Gatherer/WebHookHydrator.php index 413a651..4ec76b5 100644 --- a/src/Gatherer/WebHookHydrator.php +++ b/src/Gatherer/WebHookHydrator.php @@ -26,7 +26,7 @@ public static function gather( return Hydrator::gather( $baseNamespace, - 'WebHook\\' . Utils::className($event), + 'Internal\\WebHook\\' . Utils::className($event), '🪝', ...$schemaClasses, ); diff --git a/src/Generator.php b/src/Generator.php index 8edac8b..957867a 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -210,12 +210,9 @@ public function generate(string $namespace, string $namespaceTest, string $confi } })([ ltrim($namespace, '\\') . 'Error' => 'ErrorSchemas', - ltrim($namespace, '\\') . 'Hydrator' => null, + ltrim($namespace, '\\') . 'Internal' => null, ltrim($namespace, '\\') . 'Operation' => null, - ltrim($namespace, '\\') . 'Operator' => null, ltrim($namespace, '\\') . 'Schema' => null, - ltrim($namespace, '\\') . 'WebHook' => null, - ltrim($namespace, '\\') . 'Router' => null, 'League\OpenAPIValidation' => null, 'React\Http' => null, 'ApiClients\Contracts' => null, diff --git a/src/Generator/Client.php b/src/Generator/Client.php index fc3e669..9f70412 100644 --- a/src/Generator/Client.php +++ b/src/Generator/Client.php @@ -80,7 +80,7 @@ public static function generate(Configuration $configuration, string $pathPrefix } $class->addStmt( - $factory->property('routers')->setType('Routers')->makeReadonly()->makePrivate(), + $factory->property('routers')->setType('Internal\\Routers')->makeReadonly()->makePrivate(), )->addStmt( $factory->method('__construct')->makePublic()->addParam( (new Param('authentication'))->setType('\\' . AuthenticationInterface::class), @@ -143,7 +143,7 @@ public static function generate(Configuration $configuration, string $pathPrefix new Node\Expr\Assign( new Node\Expr\Variable('hydrators'), new Node\Expr\New_( - new Node\Name('Hydrators'), + new Node\Name('Internal\\Hydrators'), [], ), ), @@ -159,7 +159,7 @@ public static function generate(Configuration $configuration, string $pathPrefix [ new Arg( new Node\Expr\New_( - new Node\Name('Operators'), + new Node\Name('Internal\\Operators'), [ new Arg( new Node\Expr\Variable('browser'), @@ -239,7 +239,7 @@ public static function generate(Configuration $configuration, string $pathPrefix 'routers', ), new Node\Expr\New_( - new Node\Name('Routers'), + new Node\Name('Internal\\Routers'), [ new Arg( new Node\Expr\Variable('browser'), @@ -374,7 +374,7 @@ public static function generate(Configuration $configuration, string $pathPrefix ), ); $chunkCountClasses[] = $cc = new ChunkCount( - 'Router\\' . (new Convert($method))->toPascal() . '\\' . (new Convert(NumberToWords::transformNumber('en', $chunkCount)))->toPascal(), + 'Internal\\Router\\' . (new Convert($method))->toPascal() . '\\' . (new Convert(NumberToWords::transformNumber('en', $chunkCount)))->toPascal(), $returnTypes, $docBlockReturnTypes, self::traverseOperations( @@ -1029,7 +1029,7 @@ private static function createRouter(string $pathPrefix, string $namespace, Rout )->addParam( (new PrivatePromotedPropertyAsParam('responseSchemaValidator'))->setType('\League\OpenAPIValidation\Schema\SchemaValidator'), )->addParam( - (new PrivatePromotedPropertyAsParam('hydrators'))->setType('\\' . $namespace . 'Hydrators'), + (new PrivatePromotedPropertyAsParam('hydrators'))->setType('Internal\\Hydrators'), )->addParam( (new PrivatePromotedPropertyAsParam('browser'))->setType('\\' . Browser::class), )->addParam( @@ -1071,7 +1071,7 @@ private static function createRouterChunkSize(string $pathPrefix, string $namesp $class = $factory->class(Utils::basename($namespace . $chunkCount->className))->makeFinal()->addStmt( $factory->method('__construct')->makePublic()->addParam( - (new PrivatePromotedPropertyAsParam('routers'))->setType('\\' . $namespace . 'Routers'), + (new PrivatePromotedPropertyAsParam('routers'))->setType('\\' . $namespace . 'Internal\\Routers'), ), ); diff --git a/src/Generator/Client/Routers.php b/src/Generator/Client/Routers.php index e1a3ce1..9670860 100644 --- a/src/Generator/Client/Routers.php +++ b/src/Generator/Client/Routers.php @@ -61,7 +61,7 @@ public function createClassName( string|null $group, string $name, ): Router { - $className = rtrim('Router\\' . (new Convert($method))->toPascal() . ($group === null ? '' : '\\' . (new Convert($group))->toPascal()), '\\'); + $className = rtrim('Internal\\Router\\' . (new Convert($method))->toPascal() . ($group === null ? '' : '\\' . (new Convert($group))->toPascal()), '\\'); return new Router( $className, diff --git a/src/Generator/Hydrators.php b/src/Generator/Hydrators.php index d3e57dc..f3423e9 100644 --- a/src/Generator/Hydrators.php +++ b/src/Generator/Hydrators.php @@ -28,7 +28,7 @@ public static function generate(string $pathPrefix, string $namespace, Hydrator { $knownScehmas = []; $factory = new BuilderFactory(); - $stmt = $factory->namespace(trim($namespace, '\\')); + $stmt = $factory->namespace(trim($namespace, '\\') . '\\Internal'); $class = $factory->class('Hydrators')->makeFinal()->implement('\\' . ObjectMapper::class); @@ -296,6 +296,6 @@ public static function generate(string $pathPrefix, string $namespace, Hydrator ); } - yield new File($pathPrefix, 'Hydrators', $stmt->addStmt($class)->getNode()); + yield new File($pathPrefix, 'Internal\\Hydrators', $stmt->addStmt($class)->getNode()); } } diff --git a/src/Generator/Operations.php b/src/Generator/Operations.php index dd7cd2b..b2e1550 100644 --- a/src/Generator/Operations.php +++ b/src/Generator/Operations.php @@ -46,7 +46,7 @@ public static function generate(Configuration $configuration, string $pathPrefix $class->addStmt( $factory->method('__construct')->makePublic()->addParam( - (new PrivatePromotedPropertyAsParam('operators'))->setType('\\' . $configuration->namespace->source . '\Operators'), + (new PrivatePromotedPropertyAsParam('operators'))->setType('Internal\\Operators'), ), ); @@ -110,7 +110,7 @@ private static function generateOperationsGroup(string $pathPrefix, Configuratio $class = $factory->class(Utils::basename($className))->makeFinal()->addStmt( $factory->method('__construct')->makePublic()->addParam( - (new PrivatePromotedPropertyAsParam('operators'))->setType('\\' . $namespace->source . '\Operators'), + (new PrivatePromotedPropertyAsParam('operators'))->setType('Internal\Operators'), ), ); diff --git a/src/Generator/Operators.php b/src/Generator/Operators.php index 164dcdc..dbf3361 100644 --- a/src/Generator/Operators.php +++ b/src/Generator/Operators.php @@ -29,7 +29,7 @@ final class Operators public static function generate(Configuration $configuration, string $pathPrefix, array $operations, array $operationHydratorMap): iterable { $factory = new BuilderFactory(); - $stmt = $factory->namespace(trim($configuration->namespace->source, '\\')); + $stmt = $factory->namespace(trim($configuration->namespace->source, '\\') . '\\Internal'); $class = $factory->class('Operators')->makeFinal()->addStmt( $factory->method('__construct')->makePublic()->addParam( @@ -41,7 +41,7 @@ public static function generate(Configuration $configuration, string $pathPrefix )->addParam( (new PrivatePromotedPropertyAsParam('responseSchemaValidator'))->setType('\League\OpenAPIValidation\Schema\SchemaValidator')->makeReadonly(), )->addParam( - (new PrivatePromotedPropertyAsParam('hydrators'))->setType('Hydrators')->makeReadonly(), + (new PrivatePromotedPropertyAsParam('hydrators'))->setType('Internal\\Hydrators')->makeReadonly(), ), ); @@ -111,6 +111,6 @@ public static function generate(Configuration $configuration, string $pathPrefix ]); } - yield new File($pathPrefix, 'Operators', $stmt->addStmt($class)->getNode()); + yield new File($pathPrefix, 'Internal\\Operators', $stmt->addStmt($class)->getNode()); } } diff --git a/src/Generator/Routers.php b/src/Generator/Routers.php index cf8758f..efcd055 100644 --- a/src/Generator/Routers.php +++ b/src/Generator/Routers.php @@ -22,7 +22,7 @@ final class Routers public static function generate(Configuration $configuration, string $pathPrefix, ClientRouters $routers): iterable { $factory = new BuilderFactory(); - $stmt = $factory->namespace(trim($configuration->namespace->source, '\\')); + $stmt = $factory->namespace(trim($configuration->namespace->source, '\\') . '\\Internal'); $class = $factory->class('Routers')->makeFinal()->addStmt( $factory->method('__construct')->makePublic()->addParam( @@ -34,7 +34,7 @@ public static function generate(Configuration $configuration, string $pathPrefix )->addParam( (new PrivatePromotedPropertyAsParam('responseSchemaValidator'))->setType('\League\OpenAPIValidation\Schema\SchemaValidator')->makeReadonly(), )->addParam( - (new PrivatePromotedPropertyAsParam('hydrators'))->setType('Hydrators')->makeReadonly(), + (new PrivatePromotedPropertyAsParam('hydrators'))->setType('Internal\\Hydrators')->makeReadonly(), ), ); @@ -132,6 +132,6 @@ public static function generate(Configuration $configuration, string $pathPrefix ]); } - yield new File($pathPrefix, 'Routers', $stmt->addStmt($class)->getNode()); + yield new File($pathPrefix, 'Internal\\Routers', $stmt->addStmt($class)->getNode()); } } diff --git a/src/Generator/Schema.php b/src/Generator/Schema.php index 6d61fd1..34ac25c 100644 --- a/src/Generator/Schema.php +++ b/src/Generator/Schema.php @@ -139,7 +139,7 @@ public static function generate(string $pathPrefix, Representation\Schema $schem $schemaClasses = [...self::getUnionTypeSchemas($property->type)]; if (count($schemaClasses) > 0) { - $castToUnionToType = ClassString::factory($schema->className->baseNamespaces, Utils::className('Attribute\\CastUnionToType\\' . $schema->className->relative . '\\' . $property->name)); + $castToUnionToType = ClassString::factory($schema->className->baseNamespaces, Utils::className('Internal\\Attribute\\CastUnionToType\\' . $schema->className->relative . '\\' . $property->name)); yield from CastUnionToType::generate($pathPrefix, $castToUnionToType, ...$schemaClasses); @@ -164,7 +164,7 @@ public static function generate(string $pathPrefix, Representation\Schema $schem $iterableType = self::buildUnionType($iterableType); if (count($schemaClasses) > 0) { - $castToUnionToType = ClassString::factory($schema->className->baseNamespaces, Utils::className('Attribute\\CastUnionToType\\' . $schema->className->relative . '\\' . $property->name)); + $castToUnionToType = ClassString::factory($schema->className->baseNamespaces, Utils::className('Internal\\Attribute\\CastUnionToType\\' . $schema->className->relative . '\\' . $property->name)); yield from CastUnionToType::generate($pathPrefix, $castToUnionToType, ...$schemaClasses); diff --git a/src/Generator/WebHook.php b/src/Generator/WebHook.php index 5633842..f36ef30 100644 --- a/src/Generator/WebHook.php +++ b/src/Generator/WebHook.php @@ -50,12 +50,12 @@ public static function generate( ' */', ]))); $class->addStmt($factory->property('requestSchemaValidator')->setType('\\' . SchemaValidator::class)->makeReadonly()->makePrivate()); - $class->addStmt($factory->property('hydrator')->setType('Hydrator\\WebHook' . $className)->makeReadonly()->makePrivate()); + $class->addStmt($factory->property('hydrator')->setType('Internal\\Hydrator\\WebHook' . $className)->makeReadonly()->makePrivate()); $constructor = $factory->method('__construct')->makePublic()->addParam( (new Param('requestSchemaValidator'))->setType('\\' . SchemaValidator::class), )->addParam( - (new Param('hydrator'))->setType('Hydrator\\WebHook' . $className), + (new Param('hydrator'))->setType('Internal\\Hydrator\\WebHook' . $className), )->addStmt( new Node\Expr\Assign( new Node\Expr\PropertyFetch( @@ -187,6 +187,6 @@ public static function generate( $method->addStmts($tmts); $class->addStmt($method); - yield new File($pathPrefix, 'WebHook\\' . $className, $stmt->addStmt($class)->getNode()); + yield new File($pathPrefix, 'Internal\\WebHook\\' . $className, $stmt->addStmt($class)->getNode()); } } diff --git a/src/Generator/WebHooks.php b/src/Generator/WebHooks.php index 33308a1..a080259 100644 --- a/src/Generator/WebHooks.php +++ b/src/Generator/WebHooks.php @@ -42,11 +42,11 @@ public static function generate(string $pathPrefix, string $namespace, array $we $class = $factory->class('WebHooks')->makeFinal()->implement('\\' . WebHooksInterface::class); $class->addStmt($factory->property('requestSchemaValidator')->setType('\\' . SchemaValidator::class)->makeReadonly()->makePrivate()); - $class->addStmt($factory->property('hydrator')->setType('Hydrators')->makeReadonly()->makePrivate()); + $class->addStmt($factory->property('hydrator')->setType('Internal\\Hydrators')->makeReadonly()->makePrivate()); $constructor = $factory->method('__construct')->makePublic()->addParams([ (new Param('requestSchemaValidator'))->setType('\\' . SchemaValidator::class), - (new Param('hydrator'))->setType('Hydrators'), + (new Param('hydrator'))->setType('Internal\\Hydrators'), ])->addStmts([ new Node\Expr\Assign( new Node\Expr\PropertyFetch( diff --git a/tests/app/etc/openapi-client-generator.state b/tests/app/etc/openapi-client-generator.state index 20e6ec5..33b2811 100644 --- a/tests/app/etc/openapi-client-generator.state +++ b/tests/app/etc/openapi-client-generator.state @@ -3,296 +3,296 @@ "generatedFiles": { "files": [ { - "name": ".\/tests\/app\/src\/\/Operation\/Pets\/List_.php", - "hash": "dcd666d265d4c1356cfde3c55d31bedf" + "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/List_.php", + "hash": "c520c2f0ff0936c2ba29a39e435b5f28" }, { - "name": ".\/tests\/app\/src\/\/Operator\/Pets\/List_.php", - "hash": "e1611a9cfaf37e7ac40cec7cadb35c5e" + "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/List_.php", + "hash": "db5a45157ecec422ce19330c0498fe13" }, { - "name": ".\/tests\/app\/tests\/\/Operation\/Pets\/List_Test.php", - "hash": "1de84e3dd5e9cbe8865c352a4b419c19" + "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/List_Test.php", + "hash": "118a4b865946b20525ec5e294d4142f0" }, { - "name": ".\/tests\/app\/src\/\/Operation\/Pets\/ListListing.php", - "hash": "ed407ab7773eaf5abe25e343f7c85195" + "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/ListListing.php", + "hash": "17f17aa7bf998e158be5bbdea09a1663" }, { - "name": ".\/tests\/app\/src\/\/Operator\/Pets\/ListListing.php", - "hash": "ae49477fd471e5536416ae75000869e1" + "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/ListListing.php", + "hash": "2c63dfcc725dd37b98b07d9652333ca0" }, { - "name": ".\/tests\/app\/tests\/\/Operation\/Pets\/ListListingTest.php", - "hash": "e84630af94b23ee2f976d817e0f2230b" + "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/ListListingTest.php", + "hash": "55aa65fc342c80607681971ff8d3b8a7" }, { - "name": ".\/tests\/app\/src\/\/Operation\/Pets\/Create.php", - "hash": "77643dfbef4e5228641fb24a802f36e3" + "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/Create.php", + "hash": "9c62dcb98ecfd7e7c1c24800e233af0a" }, { - "name": ".\/tests\/app\/src\/\/Operator\/Pets\/Create.php", - "hash": "3a6c48a8e9b709fd10fe1aefca00c10e" + "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/Create.php", + "hash": "bd65b8b37923a642d6924766b01e212e" }, { - "name": ".\/tests\/app\/tests\/\/Operation\/Pets\/CreateTest.php", - "hash": "0f886fdac1ee9dcc0c65b6d44141f89c" + "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/CreateTest.php", + "hash": "955f6464b777eca7d93966ff896a5914" }, { - "name": ".\/tests\/app\/src\/\/Operation\/Pets\/List_\/Gatos.php", - "hash": "4a8676068fec79375487c62dc39914fe" + "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/List_\/Gatos.php", + "hash": "8d589bf7297e74b697e9e62c056466b9" }, { - "name": ".\/tests\/app\/src\/\/Operator\/Pets\/List_\/Gatos.php", - "hash": "0f9a02ab3c3127b534f87bd3169ac20a" + "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/List_\/Gatos.php", + "hash": "8ff4102b1deed87c589211b7e9c3d2f4" }, { - "name": ".\/tests\/app\/tests\/\/Operation\/Pets\/List_\/GatosTest.php", - "hash": "55a2796c02d53a51fa395d79d2b82d47" + "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/List_\/GatosTest.php", + "hash": "55ca3ebb3ceb17a9ac82eec51b12122d" }, { - "name": ".\/tests\/app\/src\/\/Operation\/Pets\/List_\/GatosListing.php", - "hash": "b68daee5377f5f38ddfc1a583c872711" + "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/List_\/GatosListing.php", + "hash": "fdea8c007fe7072c4bc4ae8c79fe609e" }, { - "name": ".\/tests\/app\/src\/\/Operator\/Pets\/List_\/GatosListing.php", - "hash": "ceefc89a155ebc655acdae31d474b6bb" + "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/List_\/GatosListing.php", + "hash": "11a4db25d23f28b147cefa3436042ed8" }, { - "name": ".\/tests\/app\/tests\/\/Operation\/Pets\/List_\/GatosListingTest.php", - "hash": "364ef98360b60ab9076e41074f756894" + "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/List_\/GatosListingTest.php", + "hash": "49401e5bcd114a3e8f07ff378c9f86db" }, { - "name": ".\/tests\/app\/src\/\/Operation\/Pets\/Names.php", - "hash": "8de6b145ebcab2abf13a1cc5c2ffaff3" + "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/Names.php", + "hash": "bcdcc705445a5803e16b9bc6553701dd" }, { - "name": ".\/tests\/app\/src\/\/Operator\/Pets\/Names.php", - "hash": "37d7f2830aba51fbf7492c6625fe5aaa" + "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/Names.php", + "hash": "00fad21c38012a792a3e550b401c9891" }, { - "name": ".\/tests\/app\/tests\/\/Operation\/Pets\/NamesTest.php", - "hash": "6ece3ee6680ee062a39d319c32d2910a" + "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/NamesTest.php", + "hash": "0ff49128895f3379bb6a131ec383d25b" }, { - "name": ".\/tests\/app\/src\/\/Operation\/Pets\/NamesListing.php", - "hash": "273115f7ac162b7b4f7b56cb775b50e4" + "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/NamesListing.php", + "hash": "d6e405d66fa8b664f91b551974a0280c" }, { - "name": ".\/tests\/app\/src\/\/Operator\/Pets\/NamesListing.php", - "hash": "ed2353e931e4134dac1325bd4511ce89" + "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/NamesListing.php", + "hash": "b1f0b2b5896403341c1163eb5a3d09d5" }, { - "name": ".\/tests\/app\/tests\/\/Operation\/Pets\/NamesListingTest.php", - "hash": "ba4ec7277343ddf577a023b10d9cdc18" + "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/NamesListingTest.php", + "hash": "be68bd2eadf35c2f3434bddd89778ed9" }, { - "name": ".\/tests\/app\/src\/\/Operation\/ShowPetById.php", - "hash": "53b8909638c1af4dff6198ff9a9362d1" + "name": ".\/tests\/app\/src\/\/Internal\/Operation\/ShowPetById.php", + "hash": "efb0c281bf9e0b91e88afa00a0bb4628" }, { - "name": ".\/tests\/app\/src\/\/Operator\/ShowPetById.php", - "hash": "b31f99b516cc79be873c05ec8c33c74f" + "name": ".\/tests\/app\/src\/\/Internal\/Operator\/ShowPetById.php", + "hash": "e0f9587266693670ee7a500927287376" }, { - "name": ".\/tests\/app\/tests\/\/Operation\/ShowPetByIdTest.php", - "hash": "7c2ebed4bc0f0c5cb6518cb47e9c6c32" + "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/ShowPetByIdTest.php", + "hash": "5041b34e5e62b902025c1964333f2f2e" }, { - "name": ".\/tests\/app\/src\/\/Attribute\/CastUnionToType\/Schema\/Cat\/Eyes.php", - "hash": "f7f128f7b72a4c27fb860551785996d1" + "name": ".\/tests\/app\/src\/\/Internal\/Attribute\/CastUnionToType\/Schema\/Cat\/Eyes.php", + "hash": "f06fab9ea8735b70e17e215014038b5c" }, { "name": ".\/tests\/app\/src\/\/Schema\/Cat.php", - "hash": "5b9c79c0b25517098d66462aa45315dd" + "hash": "371cfd85bfe07286fb95ad7a7d29187c" }, { - "name": ".\/tests\/app\/src\/\/Attribute\/CastUnionToType\/Schema\/Dog\/Eyes.php", - "hash": "a89f3f7937e507564e2886d72848e264" + "name": ".\/tests\/app\/src\/\/Internal\/Attribute\/CastUnionToType\/Schema\/Dog\/Eyes.php", + "hash": "87e2777a1e85044306e01a7cc941320e" }, { "name": ".\/tests\/app\/src\/\/Schema\/Dog.php", - "hash": "66e3485adae911c966a0ceaf65edbc35" + "hash": "232a56bd647746d61a6e9e54f562dde3" }, { - "name": ".\/tests\/app\/src\/\/Attribute\/CastUnionToType\/Schema\/Bird\/Eyes.php", - "hash": "8bd73cc44affd30c97993108a09f1d86" + "name": ".\/tests\/app\/src\/\/Internal\/Attribute\/CastUnionToType\/Schema\/Bird\/Eyes.php", + "hash": "1fcc98776dcbc8580b7f4faec5353f05" }, { "name": ".\/tests\/app\/src\/\/Schema\/Bird.php", - "hash": "f6e9003818d5b1de150e4f1b53d4d983" + "hash": "e42c62ba366a1199b3d4ffeeb1f84763" }, { - "name": ".\/tests\/app\/src\/\/Attribute\/CastUnionToType\/Schema\/Fish\/Eyes.php", - "hash": "c5fb5b08f19f1e8c69469b9760bd830e" + "name": ".\/tests\/app\/src\/\/Internal\/Attribute\/CastUnionToType\/Schema\/Fish\/Eyes.php", + "hash": "a1ce37c0cf57e738f62aa66231a77a97" }, { "name": ".\/tests\/app\/src\/\/Schema\/Fish.php", - "hash": "02750dd0423b4f3dec25aad00c366949" + "hash": "70708fa5d240484343fc3d2d192d01e6" }, { "name": ".\/tests\/app\/src\/\/Schema\/Error.php", - "hash": "0a293e52c9ebef7df3eee361122b74bc" + "hash": "527bda2504b2d138fa10bd3549cd45a2" }, { "name": ".\/tests\/app\/src\/\/Error\/Error.php", - "hash": "f0d0ba9484e1e17337da019e786a537b" + "hash": "bf0d8ec4540bd74558b5c107f132fe9d" }, { "name": ".\/tests\/app\/src\/\/Schema\/Legs.php", - "hash": "8c730391394c697d6bd906b759cf5c5e" + "hash": "7283a6b13ff4266cf6a00362a400bd65" }, { "name": ".\/tests\/app\/src\/\/Schema\/Tails.php", - "hash": "d559a5b3078034d5f7ff65a839341aaf" + "hash": "f65ba3cbdf98c04d55db7c91c4d98b40" }, { "name": ".\/tests\/app\/src\/\/Schema\/Fins.php", - "hash": "7192fa98d753adb6ac08c254d0a43bd8" + "hash": "cdf5aef72f39100b0ac9415fe8674a9c" }, { "name": ".\/tests\/app\/src\/\/Schema\/Wings.php", - "hash": "4b210e4992fd7050189cb3c0c259c0d7" + "hash": "831c8c0cc46f017c449ad605c426787e" }, { "name": ".\/tests\/app\/src\/\/Schema\/RedEyes.php", - "hash": "7ecdb87431cde42056dadeb6be4f8f69" + "hash": "68aceac83f2c6b628241ab6331bb4fe6" }, { "name": ".\/tests\/app\/src\/\/Schema\/GreenEyes.php", - "hash": "66edf6255393bfe237352cb6ce05dcf0" + "hash": "07bb8870dedd7fa113608f4a66e8ca98" }, { "name": ".\/tests\/app\/src\/\/Schema\/YellowEyes.php", - "hash": "4a222efd9ac10732d715bff345b70116" + "hash": "137b7ae0b43f4a427d7387e56968febb" }, { "name": ".\/tests\/app\/src\/\/Schema\/BlackEyes.php", - "hash": "eb71b8b444a15113088c0ad5a340e852" + "hash": "dd3386a44db052e697f98b526599755a" }, { "name": ".\/tests\/app\/src\/\/Schema\/BlueEyes.php", - "hash": "0918d6b10495c53318120641eabcd950" + "hash": "9bcd4cd1f1c9920d1c6555adf2aec13d" }, { "name": ".\/tests\/app\/src\/\/Schema\/Cat\/Features.php", - "hash": "bd20f54244c6a36e9dd724e17d698038" + "hash": "59574049775dec2023502d515171268b" }, { "name": ".\/tests\/app\/src\/\/Schema\/Operations\/Pets\/List_\/Response\/ApplicationJson\/Ok.php", - "hash": "8a7e3102b29c2b951403587f4521b868" + "hash": "9670a027bb35bf227e29e3ab05f40b36" }, { "name": ".\/tests\/app\/src\/\/Schema\/AliasAbstract\/Tiet3079EDA6\/TietC8A57480\/TietAA436E3B\/Tiet0E7D3D03.php", - "hash": "4fcbf50d81370ba34927ce2a0ad07da7" + "hash": "e35aecc048cbf5c34a25ac110554ed76" }, { "name": ".\/tests\/app\/src\/\/Schema\/Operations\/ShowPetById\/Response\/ApplicationJson\/Ok.php", - "hash": "112874072ea0b6b0303c5215488a86c7" + "hash": "067b93703a593299d4bb98e1c8f0fce1" }, { "name": ".\/tests\/app\/src\/\/Schema\/Pets\/Create\/Request\/ApplicationJson.php", - "hash": "4d50766549242867d8da0d781e043fa4" + "hash": "3df1a4826468190561c97c29dfffd99d" }, { "name": ".\/tests\/app\/src\/\/Schema\/Operations\/Pets\/Names\/Response\/ApplicationJson\/Ok.php", - "hash": "2c210d112500df3ae0671076bcb318b1" + "hash": "16a9b50aa1d445c11a53a1e3b1b537a1" }, { "name": ".\/tests\/app\/src\/\/ClientInterface.php", - "hash": "f5f7ffaade2db728ec4154f595bea029" + "hash": "12883d3abf5ccbfdba4be51d0cd092ea" }, { "name": ".\/tests\/app\/src\/\/Client.php", - "hash": "7c3f6b9355d70255133db079142eac1a" + "hash": "dec525ce049b33285761d36347cbc0ee" }, { - "name": ".\/tests\/app\/src\/\/Router\/Get\/Pets.php", - "hash": "c505ca252ef7bf931eb0f7056e2d4f0e" + "name": ".\/tests\/app\/src\/\/Internal\/Router\/Get\/Pets.php", + "hash": "d9b54a60718206d153f01f8741aebec6" }, { - "name": ".\/tests\/app\/src\/\/Router\/Get\/PetsList.php", - "hash": "789dd8b770f3725e3d00073322705e19" + "name": ".\/tests\/app\/src\/\/Internal\/Router\/Get\/PetsList.php", + "hash": "2de1a4d9f16004193fbbd3395c919180" }, { - "name": ".\/tests\/app\/src\/\/Router\/Get.php", - "hash": "e193b567440e231d095ee3377278b13a" + "name": ".\/tests\/app\/src\/\/Internal\/Router\/Get.php", + "hash": "5da596f090eb4bf6dba76eae7cf53096" }, { - "name": ".\/tests\/app\/src\/\/Router\/List\/Pets.php", - "hash": "535394d3e3340bc834b864755084b68a" + "name": ".\/tests\/app\/src\/\/Internal\/Router\/List\/Pets.php", + "hash": "651f29a1308fc8e21c6219bbce675888" }, { - "name": ".\/tests\/app\/src\/\/Router\/List\/PetsList.php", - "hash": "ba00aad83ddbfccd10c10038ca0ecebd" + "name": ".\/tests\/app\/src\/\/Internal\/Router\/List\/PetsList.php", + "hash": "abcaf1114e4fa5b795ef3417adfbcc39" }, { - "name": ".\/tests\/app\/src\/\/Router\/Post\/Pets.php", - "hash": "a4820844a134a8d519c68d833e08af35" + "name": ".\/tests\/app\/src\/\/Internal\/Router\/Post\/Pets.php", + "hash": "5271ec8b587344911a6019a31b0d5fe6" }, { - "name": ".\/tests\/app\/src\/\/Router\/Get\/Two.php", - "hash": "cc97d308408aef5b7b2bfd083265b439" + "name": ".\/tests\/app\/src\/\/Internal\/Router\/Get\/Two.php", + "hash": "c1d27734336ca9da314357976f84b3c1" }, { - "name": ".\/tests\/app\/src\/\/Router\/Get\/Three.php", - "hash": "8ef12f1f7f74b65907477d8b480a606b" + "name": ".\/tests\/app\/src\/\/Internal\/Router\/Get\/Three.php", + "hash": "d1cf00580ddd63cb456f6daa199941ff" }, { - "name": ".\/tests\/app\/src\/\/Router\/List\/Two.php", - "hash": "bc74df181ba05c9ea5279a3b0e052812" + "name": ".\/tests\/app\/src\/\/Internal\/Router\/List\/Two.php", + "hash": "0ad946fda00f4e5b2fa03281ba5cf07b" }, { - "name": ".\/tests\/app\/src\/\/Router\/List\/Three.php", - "hash": "ed2f78d6ad9c8fde60c41578f5c3e85f" + "name": ".\/tests\/app\/src\/\/Internal\/Router\/List\/Three.php", + "hash": "bd635f15168763ab4de5e1eb161ed3cf" }, { - "name": ".\/tests\/app\/src\/\/Router\/Post\/Two.php", - "hash": "0ef219a58238401c84256fdd8c73f12e" + "name": ".\/tests\/app\/src\/\/Internal\/Router\/Post\/Two.php", + "hash": "278185160910ced7d1a477d51e558302" }, { - "name": ".\/tests\/app\/src\/\/Routers.php", - "hash": "981e3ed9c1d96ba38e608555aeb4681d" + "name": ".\/tests\/app\/src\/\/Internal\/Routers.php", + "hash": "27ae653029f6d54ef26c6b156366e3a3" }, { "name": ".\/tests\/app\/src\/\/OperationsInterface.php", - "hash": "6a32a2f215c719877560625cf7177ef3" + "hash": "2186a89312e99b2ad5884dc51675a9d8" }, { "name": ".\/tests\/app\/src\/\/Operation\/Pets.php", - "hash": "df69fd3b28297d813b125b97036bbacf" + "hash": "1d1bb80363ad7f54a6f312950dfde25c" }, { "name": ".\/tests\/app\/src\/\/Operation\/PetsList.php", - "hash": "ee50f6c419779e5fcf372c99778e41dd" + "hash": "b000993bf5e1c2f8a705f8ae07f2f508" }, { - "name": ".\/tests\/app\/src\/\/Operations.php", - "hash": "a59c678e09e6b680223737a94d015793" + "name": ".\/tests\/app\/src\/\/Internal\/Operators.php", + "hash": "067d783201e09465d9bc4185fa23953b" }, { - "name": ".\/tests\/app\/src\/\/Hydrator\/Operation\/Pets.php", - "hash": "9c2613fb27ab467b3a3c82e77b309a19" + "name": ".\/tests\/app\/src\/\/Operations.php", + "hash": "5c1d8df5d9b95ffe1400781c8a32e362" }, { - "name": ".\/tests\/app\/src\/\/Hydrator\/Operation\/Pets\/Gatos.php", - "hash": "10cb1f0c2fac7eda82dc00b877f36488" + "name": ".\/tests\/app\/src\/\/Internal\/Hydrator\/Operation\/Pets.php", + "hash": "a051e5e611a2266ed49372835768dfc2" }, { - "name": ".\/tests\/app\/src\/\/Hydrator\/Operation\/Pets\/Names.php", - "hash": "187d714783653b44d86b2d03444e3ab7" + "name": ".\/tests\/app\/src\/\/Internal\/Hydrator\/Operation\/Pets\/Gatos.php", + "hash": "fc5f76f6986c1c96eb7a4f9c98fb718e" }, { - "name": ".\/tests\/app\/src\/\/Hydrator\/Operation\/Pets\/PetId.php", - "hash": "301ab81fbf3f746b4f512cd6951da22a" + "name": ".\/tests\/app\/src\/\/Internal\/Hydrator\/Operation\/Pets\/Names.php", + "hash": "763360da3f82b554e30cd9c53a2c4c69" }, { - "name": ".\/tests\/app\/src\/\/Hydrators.php", - "hash": "6dbea9f466671e1b304df02d18b5d627" + "name": ".\/tests\/app\/src\/\/Internal\/Hydrator\/Operation\/Pets\/PetId.php", + "hash": "bc9eff40e9278db28d7b6f2d56990eba" }, { - "name": ".\/tests\/app\/src\/\/Operators.php", - "hash": "3c39f2158465dca6c75741e22ba40134" + "name": ".\/tests\/app\/src\/\/Internal\/Hydrators.php", + "hash": "1672b758f3f1c7b7a0710f08a843b4b5" } ] }, diff --git a/tests/app/src/Client.php b/tests/app/src/Client.php index 88358ac..a410444d 100644 --- a/tests/app/src/Client.php +++ b/tests/app/src/Client.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; @@ -17,15 +14,15 @@ final class Client implements ClientInterface { private array $router = array(); private readonly OperationsInterface $operations; - private readonly Routers $routers; + private readonly Internal\Routers $routers; public function __construct(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, \React\Http\Browser $browser) { $browser = $browser->withBase('http://petstore.swagger.io/v1')->withFollowRedirects(false); $requestSchemaValidator = new \League\OpenAPIValidation\Schema\SchemaValidator(\League\OpenAPIValidation\Schema\SchemaValidator::VALIDATE_AS_REQUEST); $responseSchemaValidator = new \League\OpenAPIValidation\Schema\SchemaValidator(\League\OpenAPIValidation\Schema\SchemaValidator::VALIDATE_AS_RESPONSE); - $hydrators = new Hydrators(); - $this->operations = new Operations(new Operators(browser: $browser, authentication: $authentication, requestSchemaValidator: $requestSchemaValidator, responseSchemaValidator: $responseSchemaValidator, hydrators: $hydrators)); - $this->routers = new Routers(browser: $browser, authentication: $authentication, requestSchemaValidator: $requestSchemaValidator, responseSchemaValidator: $responseSchemaValidator, hydrators: $hydrators); + $hydrators = new Internal\Hydrators(); + $this->operations = new Operations(new Internal\Operators(browser: $browser, authentication: $authentication, requestSchemaValidator: $requestSchemaValidator, responseSchemaValidator: $responseSchemaValidator, hydrators: $hydrators)); + $this->routers = new Internal\Routers(browser: $browser, authentication: $authentication, requestSchemaValidator: $requestSchemaValidator, responseSchemaValidator: $responseSchemaValidator, hydrators: $hydrators); } // phpcs:disable /** @@ -39,34 +36,34 @@ public function call(string $call, array $params = array()) : iterable|\ApiClien $pathChunksCount = count($pathChunks); if ($method === 'GET') { if ($pathChunksCount === 2) { - if (\array_key_exists(Router\Get\Two::class, $this->router) == false) { - $this->router[Router\Get\Two::class] = new Router\Get\Two(routers: $this->routers); + if (\array_key_exists(Internal\Router\Get\Two::class, $this->router) == false) { + $this->router[Internal\Router\Get\Two::class] = new Internal\Router\Get\Two(routers: $this->routers); } - return $this->router[Router\Get\Two::class]->call($call, $params, $pathChunks); + return $this->router[Internal\Router\Get\Two::class]->call($call, $params, $pathChunks); } elseif ($pathChunksCount === 3) { - if (\array_key_exists(Router\Get\Three::class, $this->router) == false) { - $this->router[Router\Get\Three::class] = new Router\Get\Three(routers: $this->routers); + if (\array_key_exists(Internal\Router\Get\Three::class, $this->router) == false) { + $this->router[Internal\Router\Get\Three::class] = new Internal\Router\Get\Three(routers: $this->routers); } - return $this->router[Router\Get\Three::class]->call($call, $params, $pathChunks); + return $this->router[Internal\Router\Get\Three::class]->call($call, $params, $pathChunks); } } elseif ($method === 'LIST') { if ($pathChunksCount === 2) { - if (\array_key_exists(Router\List\Two::class, $this->router) == false) { - $this->router[Router\List\Two::class] = new Router\List\Two(routers: $this->routers); + if (\array_key_exists(Internal\Router\List\Two::class, $this->router) == false) { + $this->router[Internal\Router\List\Two::class] = new Internal\Router\List\Two(routers: $this->routers); } - return $this->router[Router\List\Two::class]->call($call, $params, $pathChunks); + return $this->router[Internal\Router\List\Two::class]->call($call, $params, $pathChunks); } elseif ($pathChunksCount === 3) { - if (\array_key_exists(Router\List\Three::class, $this->router) == false) { - $this->router[Router\List\Three::class] = new Router\List\Three(routers: $this->routers); + if (\array_key_exists(Internal\Router\List\Three::class, $this->router) == false) { + $this->router[Internal\Router\List\Three::class] = new Internal\Router\List\Three(routers: $this->routers); } - return $this->router[Router\List\Three::class]->call($call, $params, $pathChunks); + return $this->router[Internal\Router\List\Three::class]->call($call, $params, $pathChunks); } } elseif ($method === 'POST') { if ($pathChunksCount === 2) { - if (\array_key_exists(Router\Post\Two::class, $this->router) == false) { - $this->router[Router\Post\Two::class] = new Router\Post\Two(routers: $this->routers); + if (\array_key_exists(Internal\Router\Post\Two::class, $this->router) == false) { + $this->router[Internal\Router\Post\Two::class] = new Internal\Router\Post\Two(routers: $this->routers); } - return $this->router[Router\Post\Two::class]->call($call, $params, $pathChunks); + return $this->router[Internal\Router\Post\Two::class]->call($call, $params, $pathChunks); } } throw new \InvalidArgumentException(); diff --git a/tests/app/src/ClientInterface.php b/tests/app/src/ClientInterface.php index 6748814..c1ab5cf 100644 --- a/tests/app/src/ClientInterface.php +++ b/tests/app/src/ClientInterface.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Error/Error.php b/tests/app/src/Error/Error.php index 3a1075d..dc28e40 100644 --- a/tests/app/src/Error/Error.php +++ b/tests/app/src/Error/Error.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Error; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Attribute/CastUnionToType/Schema/Cat/Eyes.php b/tests/app/src/Internal/Attribute/CastUnionToType/Schema/Bird/Eyes.php similarity index 90% rename from tests/app/src/Attribute/CastUnionToType/Schema/Cat/Eyes.php rename to tests/app/src/Internal/Attribute/CastUnionToType/Schema/Bird/Eyes.php index e742f27..3b8b3ed 100644 --- a/tests/app/src/Attribute/CastUnionToType/Schema/Cat/Eyes.php +++ b/tests/app/src/Internal/Attribute/CastUnionToType/Schema/Bird/Eyes.php @@ -1,15 +1,12 @@ $this->serializeObject($object)); } } - public function getObjectMapperOperation🌀Pets() : Hydrator\Operation\Pets + public function getObjectMapperOperation🌀Pets() : Internal\Hydrator\Operation\Pets { - if ($this->operation🌀Pets instanceof Hydrator\Operation\Pets === false) { - $this->operation🌀Pets = new Hydrator\Operation\Pets(); + if ($this->operation🌀Pets instanceof Internal\Hydrator\Operation\Pets === false) { + $this->operation🌀Pets = new Internal\Hydrator\Operation\Pets(); } return $this->operation🌀Pets; } - public function getObjectMapperOperation🌀Pets🌀Gatos() : Hydrator\Operation\Pets\Gatos + public function getObjectMapperOperation🌀Pets🌀Gatos() : Internal\Hydrator\Operation\Pets\Gatos { - if ($this->operation🌀Pets🌀Gatos instanceof Hydrator\Operation\Pets\Gatos === false) { - $this->operation🌀Pets🌀Gatos = new Hydrator\Operation\Pets\Gatos(); + if ($this->operation🌀Pets🌀Gatos instanceof Internal\Hydrator\Operation\Pets\Gatos === false) { + $this->operation🌀Pets🌀Gatos = new Internal\Hydrator\Operation\Pets\Gatos(); } return $this->operation🌀Pets🌀Gatos; } - public function getObjectMapperOperation🌀Pets🌀Names() : Hydrator\Operation\Pets\Names + public function getObjectMapperOperation🌀Pets🌀Names() : Internal\Hydrator\Operation\Pets\Names { - if ($this->operation🌀Pets🌀Names instanceof Hydrator\Operation\Pets\Names === false) { - $this->operation🌀Pets🌀Names = new Hydrator\Operation\Pets\Names(); + if ($this->operation🌀Pets🌀Names instanceof Internal\Hydrator\Operation\Pets\Names === false) { + $this->operation🌀Pets🌀Names = new Internal\Hydrator\Operation\Pets\Names(); } return $this->operation🌀Pets🌀Names; } - public function getObjectMapperOperation🌀Pets🌀PetId() : Hydrator\Operation\Pets\PetId + public function getObjectMapperOperation🌀Pets🌀PetId() : Internal\Hydrator\Operation\Pets\PetId { - if ($this->operation🌀Pets🌀PetId instanceof Hydrator\Operation\Pets\PetId === false) { - $this->operation🌀Pets🌀PetId = new Hydrator\Operation\Pets\PetId(); + if ($this->operation🌀Pets🌀PetId instanceof Internal\Hydrator\Operation\Pets\PetId === false) { + $this->operation🌀Pets🌀PetId = new Internal\Hydrator\Operation\Pets\PetId(); } return $this->operation🌀Pets🌀PetId; } diff --git a/tests/app/src/Operation/Pets/Create.php b/tests/app/src/Internal/Operation/Pets/Create.php similarity index 87% rename from tests/app/src/Operation/Pets/Create.php rename to tests/app/src/Internal/Operation/Pets/Create.php index 49ef9f9..652bd84 100644 --- a/tests/app/src/Operation/Pets/Create.php +++ b/tests/app/src/Internal/Operation/Pets/Create.php @@ -1,15 +1,12 @@ requestSchemaValidator = $requestSchemaValidator; $this->responseSchemaValidator = $responseSchemaValidator; diff --git a/tests/app/src/Operation/Pets/ListListing.php b/tests/app/src/Internal/Operation/Pets/ListListing.php similarity index 92% rename from tests/app/src/Operation/Pets/ListListing.php rename to tests/app/src/Internal/Operation/Pets/ListListing.php index 58701a2..35044e5 100644 --- a/tests/app/src/Operation/Pets/ListListing.php +++ b/tests/app/src/Internal/Operation/Pets/ListListing.php @@ -1,15 +1,12 @@ perPage = $perPage; $this->page = $page; diff --git a/tests/app/src/Operation/Pets/List_.php b/tests/app/src/Internal/Operation/Pets/List_.php similarity index 92% rename from tests/app/src/Operation/Pets/List_.php rename to tests/app/src/Internal/Operation/Pets/List_.php index d443289..f30d0c3 100644 --- a/tests/app/src/Operation/Pets/List_.php +++ b/tests/app/src/Internal/Operation/Pets/List_.php @@ -1,15 +1,12 @@ perPage = $perPage; $this->page = $page; diff --git a/tests/app/src/Operation/Pets/List_/Gatos.php b/tests/app/src/Internal/Operation/Pets/List_/Gatos.php similarity index 88% rename from tests/app/src/Operation/Pets/List_/Gatos.php rename to tests/app/src/Internal/Operation/Pets/List_/Gatos.php index 4fe543c..bc2d0a1 100644 --- a/tests/app/src/Operation/Pets/List_/Gatos.php +++ b/tests/app/src/Internal/Operation/Pets/List_/Gatos.php @@ -1,15 +1,12 @@ perPage = $perPage; $this->page = $page; diff --git a/tests/app/src/Operation/Pets/List_/GatosListing.php b/tests/app/src/Internal/Operation/Pets/List_/GatosListing.php similarity index 88% rename from tests/app/src/Operation/Pets/List_/GatosListing.php rename to tests/app/src/Internal/Operation/Pets/List_/GatosListing.php index 47cde94..6e8587f 100644 --- a/tests/app/src/Operation/Pets/List_/GatosListing.php +++ b/tests/app/src/Internal/Operation/Pets/List_/GatosListing.php @@ -1,15 +1,12 @@ perPage = $perPage; $this->page = $page; diff --git a/tests/app/src/Operation/Pets/Names.php b/tests/app/src/Internal/Operation/Pets/Names.php similarity index 87% rename from tests/app/src/Operation/Pets/Names.php rename to tests/app/src/Internal/Operation/Pets/Names.php index c9c5f4f..06f8f8b 100644 --- a/tests/app/src/Operation/Pets/Names.php +++ b/tests/app/src/Internal/Operation/Pets/Names.php @@ -1,15 +1,12 @@ perPage = $perPage; $this->page = $page; diff --git a/tests/app/src/Operation/Pets/NamesListing.php b/tests/app/src/Internal/Operation/Pets/NamesListing.php similarity index 87% rename from tests/app/src/Operation/Pets/NamesListing.php rename to tests/app/src/Internal/Operation/Pets/NamesListing.php index 053186e..a432289 100644 --- a/tests/app/src/Operation/Pets/NamesListing.php +++ b/tests/app/src/Internal/Operation/Pets/NamesListing.php @@ -1,15 +1,12 @@ perPage = $perPage; $this->page = $page; diff --git a/tests/app/src/Operation/ShowPetById.php b/tests/app/src/Internal/Operation/ShowPetById.php similarity index 92% rename from tests/app/src/Operation/ShowPetById.php rename to tests/app/src/Internal/Operation/ShowPetById.php index 4a096ea..26984ea 100644 --- a/tests/app/src/Operation/ShowPetById.php +++ b/tests/app/src/Internal/Operation/ShowPetById.php @@ -1,15 +1,12 @@ responseSchemaValidator = $responseSchemaValidator; $this->hydrator = $hydrator; diff --git a/tests/app/src/Operator/Pets/Create.php b/tests/app/src/Internal/Operator/Pets/Create.php similarity index 77% rename from tests/app/src/Operator/Pets/Create.php rename to tests/app/src/Internal/Operator/Pets/Create.php index a32adf5..b71d649 100644 --- a/tests/app/src/Operator/Pets/Create.php +++ b/tests/app/src/Internal/Operator/Pets/Create.php @@ -1,15 +1,12 @@ requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator); + $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\Create($this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator); $request = $operation->createRequest($params); $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : array { return $operation->createResponse($response); diff --git a/tests/app/src/Operator/Pets/ListListing.php b/tests/app/src/Internal/Operator/Pets/ListListing.php similarity index 75% rename from tests/app/src/Operator/Pets/ListListing.php rename to tests/app/src/Internal/Operator/Pets/ListListing.php index 34d9f83..dcb7171 100644 --- a/tests/app/src/Operator/Pets/ListListing.php +++ b/tests/app/src/Internal/Operator/Pets/ListListing.php @@ -1,15 +1,12 @@ responseSchemaValidator, $this->hydrator, $perPage, $page); + $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\ListListing($this->responseSchemaValidator, $this->hydrator, $perPage, $page); $request = $operation->createRequest(); $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \Rx\Observable|array { return $operation->createResponse($response); diff --git a/tests/app/src/Operator/Pets/List_.php b/tests/app/src/Internal/Operator/Pets/List_.php similarity index 75% rename from tests/app/src/Operator/Pets/List_.php rename to tests/app/src/Internal/Operator/Pets/List_.php index 79c220f..8eb07d4 100644 --- a/tests/app/src/Operator/Pets/List_.php +++ b/tests/app/src/Internal/Operator/Pets/List_.php @@ -1,15 +1,12 @@ responseSchemaValidator, $this->hydrator, $perPage, $page); + $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\List_($this->responseSchemaValidator, $this->hydrator, $perPage, $page); $request = $operation->createRequest(); $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \Rx\Observable|array { return $operation->createResponse($response); diff --git a/tests/app/src/Operator/Pets/List_/Gatos.php b/tests/app/src/Internal/Operator/Pets/List_/Gatos.php similarity index 74% rename from tests/app/src/Operator/Pets/List_/Gatos.php rename to tests/app/src/Internal/Operator/Pets/List_/Gatos.php index 40ba6d2..92b9f9f 100644 --- a/tests/app/src/Operator/Pets/List_/Gatos.php +++ b/tests/app/src/Internal/Operator/Pets/List_/Gatos.php @@ -1,15 +1,12 @@ responseSchemaValidator, $this->hydrator, $perPage, $page); + $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\List_\Gatos($this->responseSchemaValidator, $this->hydrator, $perPage, $page); $request = $operation->createRequest(); $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \Rx\Observable|array { return $operation->createResponse($response); diff --git a/tests/app/src/Operator/Pets/List_/GatosListing.php b/tests/app/src/Internal/Operator/Pets/List_/GatosListing.php similarity index 73% rename from tests/app/src/Operator/Pets/List_/GatosListing.php rename to tests/app/src/Internal/Operator/Pets/List_/GatosListing.php index 2b45ae7..2a612ec 100644 --- a/tests/app/src/Operator/Pets/List_/GatosListing.php +++ b/tests/app/src/Internal/Operator/Pets/List_/GatosListing.php @@ -1,15 +1,12 @@ responseSchemaValidator, $this->hydrator, $perPage, $page); + $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\List_\GatosListing($this->responseSchemaValidator, $this->hydrator, $perPage, $page); $request = $operation->createRequest(); $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \Rx\Observable|array { return $operation->createResponse($response); diff --git a/tests/app/src/Operator/Pets/Names.php b/tests/app/src/Internal/Operator/Pets/Names.php similarity index 74% rename from tests/app/src/Operator/Pets/Names.php rename to tests/app/src/Internal/Operator/Pets/Names.php index 93086eb..1b0f3d8 100644 --- a/tests/app/src/Operator/Pets/Names.php +++ b/tests/app/src/Internal/Operator/Pets/Names.php @@ -1,15 +1,12 @@ responseSchemaValidator, $this->hydrator, $perPage, $page); + $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\Names($this->responseSchemaValidator, $this->hydrator, $perPage, $page); $request = $operation->createRequest(); $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \Rx\Observable|array { return $operation->createResponse($response); diff --git a/tests/app/src/Operator/Pets/NamesListing.php b/tests/app/src/Internal/Operator/Pets/NamesListing.php similarity index 74% rename from tests/app/src/Operator/Pets/NamesListing.php rename to tests/app/src/Internal/Operator/Pets/NamesListing.php index 69c01d2..e73e5c9 100644 --- a/tests/app/src/Operator/Pets/NamesListing.php +++ b/tests/app/src/Internal/Operator/Pets/NamesListing.php @@ -1,15 +1,12 @@ responseSchemaValidator, $this->hydrator, $perPage, $page); + $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\NamesListing($this->responseSchemaValidator, $this->hydrator, $perPage, $page); $request = $operation->createRequest(); $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \Rx\Observable|array { return $operation->createResponse($response); diff --git a/tests/app/src/Operator/ShowPetById.php b/tests/app/src/Internal/Operator/ShowPetById.php similarity index 79% rename from tests/app/src/Operator/ShowPetById.php rename to tests/app/src/Internal/Operator/ShowPetById.php index e699522..30052f2 100644 --- a/tests/app/src/Operator/ShowPetById.php +++ b/tests/app/src/Internal/Operator/ShowPetById.php @@ -1,15 +1,12 @@ responseSchemaValidator, $this->hydrator); + $operation = new \ApiClients\Client\PetStore\Internal\Operation\ShowPetById($this->responseSchemaValidator, $this->hydrator); $request = $operation->createRequest(); $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|array { return $operation->createResponse($response); diff --git a/tests/app/src/Internal/Operators.php b/tests/app/src/Internal/Operators.php new file mode 100644 index 0000000..19d2e31 --- /dev/null +++ b/tests/app/src/Internal/Operators.php @@ -0,0 +1,82 @@ +pets👷List_ instanceof Internal\Operator\Pets\List_ === false) { + $this->pets👷List_ = new Internal\Operator\Pets\List_($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); + } + return $this->pets👷List_; + } + public function pets👷ListListing() : Internal\Operator\Pets\ListListing + { + if ($this->pets👷ListListing instanceof Internal\Operator\Pets\ListListing === false) { + $this->pets👷ListListing = new Internal\Operator\Pets\ListListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); + } + return $this->pets👷ListListing; + } + public function pets👷Create() : Internal\Operator\Pets\Create + { + if ($this->pets👷Create instanceof Internal\Operator\Pets\Create === false) { + $this->pets👷Create = new Internal\Operator\Pets\Create($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); + } + return $this->pets👷Create; + } + public function pets👷List_👷Gatos() : Internal\Operator\Pets\List_\Gatos + { + if ($this->pets👷List_👷Gatos instanceof Internal\Operator\Pets\List_\Gatos === false) { + $this->pets👷List_👷Gatos = new Internal\Operator\Pets\List_\Gatos($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Gatos()); + } + return $this->pets👷List_👷Gatos; + } + public function pets👷List_👷GatosListing() : Internal\Operator\Pets\List_\GatosListing + { + if ($this->pets👷List_👷GatosListing instanceof Internal\Operator\Pets\List_\GatosListing === false) { + $this->pets👷List_👷GatosListing = new Internal\Operator\Pets\List_\GatosListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Gatos()); + } + return $this->pets👷List_👷GatosListing; + } + public function pets👷Names() : Internal\Operator\Pets\Names + { + if ($this->pets👷Names instanceof Internal\Operator\Pets\Names === false) { + $this->pets👷Names = new Internal\Operator\Pets\Names($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Names()); + } + return $this->pets👷Names; + } + public function pets👷NamesListing() : Internal\Operator\Pets\NamesListing + { + if ($this->pets👷NamesListing instanceof Internal\Operator\Pets\NamesListing === false) { + $this->pets👷NamesListing = new Internal\Operator\Pets\NamesListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Names()); + } + return $this->pets👷NamesListing; + } + public function showPetById() : Internal\Operator\ShowPetById + { + if ($this->showPetById instanceof Internal\Operator\ShowPetById === false) { + $this->showPetById = new Internal\Operator\ShowPetById($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀PetId()); + } + return $this->showPetById; + } +} diff --git a/tests/app/src/Router/Get.php b/tests/app/src/Internal/Router/Get.php similarity index 58% rename from tests/app/src/Router/Get.php rename to tests/app/src/Internal/Router/Get.php index 32a77b6..b01da83 100644 --- a/tests/app/src/Router/Get.php +++ b/tests/app/src/Internal/Router/Get.php @@ -1,21 +1,18 @@ browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀PetId()); + $operator = new Internal\Operator\ShowPetById($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀PetId()); return $operator->call(); } } diff --git a/tests/app/src/Router/Get/Pets.php b/tests/app/src/Internal/Router/Get/Pets.php similarity index 71% rename from tests/app/src/Router/Get/Pets.php rename to tests/app/src/Internal/Router/Get/Pets.php index d5d5c06..8c2696c 100644 --- a/tests/app/src/Router/Get/Pets.php +++ b/tests/app/src/Internal/Router/Get/Pets.php @@ -1,21 +1,18 @@ browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); + $operator = new Internal\Operator\Pets\List_($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); return $operator->call($arguments['per_page'], $arguments['page']); } /** @@ -53,7 +50,7 @@ public function names(array $params) : iterable } $arguments['page'] = $params['page']; unset($params['page']); - $operator = new Operator\Pets\Names($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Names()); + $operator = new Internal\Operator\Pets\Names($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Names()); return $operator->call($arguments['per_page'], $arguments['page']); } } diff --git a/tests/app/src/Router/Get/PetsList.php b/tests/app/src/Internal/Router/Get/PetsList.php similarity index 66% rename from tests/app/src/Router/Get/PetsList.php rename to tests/app/src/Internal/Router/Get/PetsList.php index ef6ccda..dee15c5 100644 --- a/tests/app/src/Router/Get/PetsList.php +++ b/tests/app/src/Internal/Router/Get/PetsList.php @@ -1,21 +1,18 @@ browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Gatos()); + $operator = new Internal\Operator\Pets\List_\Gatos($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Gatos()); return $operator->call($arguments['per_page'], $arguments['page']); } } diff --git a/tests/app/src/Router/Get/Three.php b/tests/app/src/Internal/Router/Get/Three.php similarity index 71% rename from tests/app/src/Router/Get/Three.php rename to tests/app/src/Internal/Router/Get/Three.php index d7e935e..996dc5e 100644 --- a/tests/app/src/Router/Get/Three.php +++ b/tests/app/src/Internal/Router/Get/Three.php @@ -1,21 +1,18 @@ routers->router🔀Get🔀PetsList()->gatos($params); + return $this->routers->internal🔀Router🔀Get🔀PetsList()->gatos($params); } } elseif ($pathChunks[2] == 'names') { if ($call == 'GET /pets/names') { - return $this->routers->router🔀Get🔀Pets()->names($params); + return $this->routers->internal🔀Router🔀Get🔀Pets()->names($params); } } elseif ($pathChunks[2] == '{petId}') { if ($call == 'GET /pets/{petId}') { - return $this->routers->router🔀Get()->showPetById($params); + return $this->routers->internal🔀Router🔀Get()->showPetById($params); } } } diff --git a/tests/app/src/Router/Get/Two.php b/tests/app/src/Internal/Router/Get/Two.php similarity index 69% rename from tests/app/src/Router/Get/Two.php rename to tests/app/src/Internal/Router/Get/Two.php index 3f738a9..0c7b4df 100644 --- a/tests/app/src/Router/Get/Two.php +++ b/tests/app/src/Internal/Router/Get/Two.php @@ -1,21 +1,18 @@ routers->router🔀Get🔀Pets()->list($params); + return $this->routers->internal🔀Router🔀Get🔀Pets()->list($params); } } } diff --git a/tests/app/src/Router/List/Pets.php b/tests/app/src/Internal/Router/List/Pets.php similarity index 74% rename from tests/app/src/Router/List/Pets.php rename to tests/app/src/Internal/Router/List/Pets.php index 46b60ef..637d522 100644 --- a/tests/app/src/Router/List/Pets.php +++ b/tests/app/src/Internal/Router/List/Pets.php @@ -1,21 +1,18 @@ browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); + $operator = new Internal\Operator\Pets\ListListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); $items = [...$operator->call($arguments['per_page'], $arguments['page'])]; yield from $items; $arguments['page']++; @@ -60,7 +57,7 @@ public function namesListing(array $params) : iterable unset($params['page']); $arguments['page'] = 1; do { - $operator = new Operator\Pets\NamesListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Names()); + $operator = new Internal\Operator\Pets\NamesListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Names()); $items = [...$operator->call($arguments['per_page'], $arguments['page'])]; yield from $items; $arguments['page']++; diff --git a/tests/app/src/Router/List/PetsList.php b/tests/app/src/Internal/Router/List/PetsList.php similarity index 69% rename from tests/app/src/Router/List/PetsList.php rename to tests/app/src/Internal/Router/List/PetsList.php index 5dfc2ee..d4fffe0 100644 --- a/tests/app/src/Router/List/PetsList.php +++ b/tests/app/src/Internal/Router/List/PetsList.php @@ -1,21 +1,18 @@ browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Gatos()); + $operator = new Internal\Operator\Pets\List_\GatosListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Gatos()); $items = [...$operator->call($arguments['per_page'], $arguments['page'])]; yield from $items; $arguments['page']++; diff --git a/tests/app/src/Router/List/Three.php b/tests/app/src/Internal/Router/List/Three.php similarity index 68% rename from tests/app/src/Router/List/Three.php rename to tests/app/src/Internal/Router/List/Three.php index 6d81f3b..be30fac 100644 --- a/tests/app/src/Router/List/Three.php +++ b/tests/app/src/Internal/Router/List/Three.php @@ -1,21 +1,18 @@ routers->router🔀List🔀PetsList()->gatosListing($params); + return $this->routers->internal🔀Router🔀List🔀PetsList()->gatosListing($params); } } elseif ($pathChunks[2] == 'names') { if ($call == 'LIST /pets/names') { - return $this->routers->router🔀List🔀Pets()->namesListing($params); + return $this->routers->internal🔀Router🔀List🔀Pets()->namesListing($params); } } } diff --git a/tests/app/src/Router/List/Two.php b/tests/app/src/Internal/Router/List/Two.php similarity index 69% rename from tests/app/src/Router/List/Two.php rename to tests/app/src/Internal/Router/List/Two.php index dddda5f..4028c96 100644 --- a/tests/app/src/Router/List/Two.php +++ b/tests/app/src/Internal/Router/List/Two.php @@ -1,21 +1,18 @@ routers->router🔀List🔀Pets()->listListing($params); + return $this->routers->internal🔀Router🔀List🔀Pets()->listListing($params); } } } diff --git a/tests/app/src/Router/Post/Pets.php b/tests/app/src/Internal/Router/Post/Pets.php similarity index 50% rename from tests/app/src/Router/Post/Pets.php rename to tests/app/src/Internal/Router/Post/Pets.php index 18b6c1b..57e85b2 100644 --- a/tests/app/src/Router/Post/Pets.php +++ b/tests/app/src/Internal/Router/Post/Pets.php @@ -1,21 +1,18 @@ browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); + $operator = new Internal\Operator\Pets\Create($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); return $operator->call($params); } } diff --git a/tests/app/src/Router/Post/Two.php b/tests/app/src/Internal/Router/Post/Two.php similarity index 68% rename from tests/app/src/Router/Post/Two.php rename to tests/app/src/Internal/Router/Post/Two.php index 07e8468..82488f6 100644 --- a/tests/app/src/Router/Post/Two.php +++ b/tests/app/src/Internal/Router/Post/Two.php @@ -1,21 +1,18 @@ routers->router🔀Post🔀Pets()->create($params); + return $this->routers->internal🔀Router🔀Post🔀Pets()->create($params); } } } diff --git a/tests/app/src/Internal/Routers.php b/tests/app/src/Internal/Routers.php new file mode 100644 index 0000000..b8ee5a2 --- /dev/null +++ b/tests/app/src/Internal/Routers.php @@ -0,0 +1,66 @@ +internal🔀Router🔀Get🔀Pets instanceof Internal\Router\Get\Pets === false) { + $this->internal🔀Router🔀Get🔀Pets = new Internal\Router\Get\Pets(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + } + return $this->internal🔀Router🔀Get🔀Pets; + } + public function internal🔀Router🔀Get🔀PetsList() : Internal\Router\Get\PetsList + { + if ($this->internal🔀Router🔀Get🔀PetsList instanceof Internal\Router\Get\PetsList === false) { + $this->internal🔀Router🔀Get🔀PetsList = new Internal\Router\Get\PetsList(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + } + return $this->internal🔀Router🔀Get🔀PetsList; + } + public function internal🔀Router🔀Get() : Internal\Router\Get + { + if ($this->internal🔀Router🔀Get instanceof Internal\Router\Get === false) { + $this->internal🔀Router🔀Get = new Internal\Router\Get(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + } + return $this->internal🔀Router🔀Get; + } + public function internal🔀Router🔀List🔀Pets() : Internal\Router\List\Pets + { + if ($this->internal🔀Router🔀List🔀Pets instanceof Internal\Router\List\Pets === false) { + $this->internal🔀Router🔀List🔀Pets = new Internal\Router\List\Pets(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + } + return $this->internal🔀Router🔀List🔀Pets; + } + public function internal🔀Router🔀List🔀PetsList() : Internal\Router\List\PetsList + { + if ($this->internal🔀Router🔀List🔀PetsList instanceof Internal\Router\List\PetsList === false) { + $this->internal🔀Router🔀List🔀PetsList = new Internal\Router\List\PetsList(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + } + return $this->internal🔀Router🔀List🔀PetsList; + } + public function internal🔀Router🔀Post🔀Pets() : Internal\Router\Post\Pets + { + if ($this->internal🔀Router🔀Post🔀Pets instanceof Internal\Router\Post\Pets === false) { + $this->internal🔀Router🔀Post🔀Pets = new Internal\Router\Post\Pets(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + } + return $this->internal🔀Router🔀Post🔀Pets; + } +} diff --git a/tests/app/src/Operation/Pets.php b/tests/app/src/Operation/Pets.php index 7e8d546..2ceff96 100644 --- a/tests/app/src/Operation/Pets.php +++ b/tests/app/src/Operation/Pets.php @@ -4,18 +4,15 @@ namespace ApiClients\Client\PetStore\Operation; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; final class Pets { - public function __construct(private \ApiClients\Client\PetStore\Operators $operators) + public function __construct(private Internal\Operators $operators) { } /** diff --git a/tests/app/src/Operation/PetsList.php b/tests/app/src/Operation/PetsList.php index 409a0f3..ad46b3d 100644 --- a/tests/app/src/Operation/PetsList.php +++ b/tests/app/src/Operation/PetsList.php @@ -4,18 +4,15 @@ namespace ApiClients\Client\PetStore\Operation; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; final class PetsList { - public function __construct(private \ApiClients\Client\PetStore\Operators $operators) + public function __construct(private Internal\Operators $operators) { } /** diff --git a/tests/app/src/Operations.php b/tests/app/src/Operations.php index f115061..66bb391 100644 --- a/tests/app/src/Operations.php +++ b/tests/app/src/Operations.php @@ -4,18 +4,15 @@ namespace ApiClients\Client\PetStore; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; final readonly class Operations implements OperationsInterface { - public function __construct(private \ApiClients\Client\PetStore\Operators $operators) + public function __construct(private Internal\Operators $operators) { } public function pets() : Operation\Pets diff --git a/tests/app/src/OperationsInterface.php b/tests/app/src/OperationsInterface.php index e68d75f..a0516d4 100644 --- a/tests/app/src/OperationsInterface.php +++ b/tests/app/src/OperationsInterface.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Operators.php b/tests/app/src/Operators.php deleted file mode 100644 index 9d9b2b4..0000000 --- a/tests/app/src/Operators.php +++ /dev/null @@ -1,85 +0,0 @@ -pets👷List_ instanceof Operator\Pets\List_ === false) { - $this->pets👷List_ = new Operator\Pets\List_($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); - } - return $this->pets👷List_; - } - public function pets👷ListListing() : Operator\Pets\ListListing - { - if ($this->pets👷ListListing instanceof Operator\Pets\ListListing === false) { - $this->pets👷ListListing = new Operator\Pets\ListListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); - } - return $this->pets👷ListListing; - } - public function pets👷Create() : Operator\Pets\Create - { - if ($this->pets👷Create instanceof Operator\Pets\Create === false) { - $this->pets👷Create = new Operator\Pets\Create($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); - } - return $this->pets👷Create; - } - public function pets👷List_👷Gatos() : Operator\Pets\List_\Gatos - { - if ($this->pets👷List_👷Gatos instanceof Operator\Pets\List_\Gatos === false) { - $this->pets👷List_👷Gatos = new Operator\Pets\List_\Gatos($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Gatos()); - } - return $this->pets👷List_👷Gatos; - } - public function pets👷List_👷GatosListing() : Operator\Pets\List_\GatosListing - { - if ($this->pets👷List_👷GatosListing instanceof Operator\Pets\List_\GatosListing === false) { - $this->pets👷List_👷GatosListing = new Operator\Pets\List_\GatosListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Gatos()); - } - return $this->pets👷List_👷GatosListing; - } - public function pets👷Names() : Operator\Pets\Names - { - if ($this->pets👷Names instanceof Operator\Pets\Names === false) { - $this->pets👷Names = new Operator\Pets\Names($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Names()); - } - return $this->pets👷Names; - } - public function pets👷NamesListing() : Operator\Pets\NamesListing - { - if ($this->pets👷NamesListing instanceof Operator\Pets\NamesListing === false) { - $this->pets👷NamesListing = new Operator\Pets\NamesListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Names()); - } - return $this->pets👷NamesListing; - } - public function showPetById() : Operator\ShowPetById - { - if ($this->showPetById instanceof Operator\ShowPetById === false) { - $this->showPetById = new Operator\ShowPetById($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀PetId()); - } - return $this->showPetById; - } -} diff --git a/tests/app/src/Routers.php b/tests/app/src/Routers.php deleted file mode 100644 index bd41854..0000000 --- a/tests/app/src/Routers.php +++ /dev/null @@ -1,69 +0,0 @@ -router🔀Get🔀Pets instanceof Router\Get\Pets === false) { - $this->router🔀Get🔀Pets = new Router\Get\Pets(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); - } - return $this->router🔀Get🔀Pets; - } - public function router🔀Get🔀PetsList() : Router\Get\PetsList - { - if ($this->router🔀Get🔀PetsList instanceof Router\Get\PetsList === false) { - $this->router🔀Get🔀PetsList = new Router\Get\PetsList(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); - } - return $this->router🔀Get🔀PetsList; - } - public function router🔀Get() : Router\Get - { - if ($this->router🔀Get instanceof Router\Get === false) { - $this->router🔀Get = new Router\Get(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); - } - return $this->router🔀Get; - } - public function router🔀List🔀Pets() : Router\List\Pets - { - if ($this->router🔀List🔀Pets instanceof Router\List\Pets === false) { - $this->router🔀List🔀Pets = new Router\List\Pets(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); - } - return $this->router🔀List🔀Pets; - } - public function router🔀List🔀PetsList() : Router\List\PetsList - { - if ($this->router🔀List🔀PetsList instanceof Router\List\PetsList === false) { - $this->router🔀List🔀PetsList = new Router\List\PetsList(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); - } - return $this->router🔀List🔀PetsList; - } - public function router🔀Post🔀Pets() : Router\Post\Pets - { - if ($this->router🔀Post🔀Pets instanceof Router\Post\Pets === false) { - $this->router🔀Post🔀Pets = new Router\Post\Pets(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); - } - return $this->router🔀Post🔀Pets; - } -} diff --git a/tests/app/src/Schema/AliasAbstract/Tiet3079EDA6/TietC8A57480/TietAA436E3B/Tiet0E7D3D03.php b/tests/app/src/Schema/AliasAbstract/Tiet3079EDA6/TietC8A57480/TietAA436E3B/Tiet0E7D3D03.php index 8ffa34a..93dc9d9 100644 --- a/tests/app/src/Schema/AliasAbstract/Tiet3079EDA6/TietC8A57480/TietAA436E3B/Tiet0E7D3D03.php +++ b/tests/app/src/Schema/AliasAbstract/Tiet3079EDA6/TietC8A57480/TietAA436E3B/Tiet0E7D3D03.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema\AliasAbstract\Tiet3079EDA6\TietC8A57480\TietAA436E3B; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Schema/Bird.php b/tests/app/src/Schema/Bird.php index 075525f..2bc0b0e 100644 --- a/tests/app/src/Schema/Bird.php +++ b/tests/app/src/Schema/Bird.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; @@ -143,7 +140,7 @@ "flies": false, "eyes": null }'; - public function __construct(public int $id, public string4 $name, public ?bool $flies, #[\ApiClients\Client\PetStore\Attribute\CastUnionToType\Schema\Bird\Eyes] public Schema\RedEyes|Schema\BlueEyes|Schema\GreenEyes|Schema\YellowEyes|Schema\BlackEyes $eyes) + public function __construct(public int $id, public string4 $name, public ?bool $flies, #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Schema\Bird\Eyes] public Schema\RedEyes|Schema\BlueEyes|Schema\GreenEyes|Schema\YellowEyes|Schema\BlackEyes $eyes) { } } diff --git a/tests/app/src/Schema/BlackEyes.php b/tests/app/src/Schema/BlackEyes.php index 5cdf5f1..ec82c3d 100644 --- a/tests/app/src/Schema/BlackEyes.php +++ b/tests/app/src/Schema/BlackEyes.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Schema/BlueEyes.php b/tests/app/src/Schema/BlueEyes.php index 54c76bd..414254e 100644 --- a/tests/app/src/Schema/BlueEyes.php +++ b/tests/app/src/Schema/BlueEyes.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Schema/Cat.php b/tests/app/src/Schema/Cat.php index ee25b4e..1a9fd8a 100644 --- a/tests/app/src/Schema/Cat.php +++ b/tests/app/src/Schema/Cat.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; @@ -147,7 +144,7 @@ "features": [], "eyes": null }'; - public function __construct(public int $id, public string $name, public ?bool $indoor, public ?Schema\Cat\Features $features, #[\ApiClients\Client\PetStore\Attribute\CastUnionToType\Schema\Cat\Eyes] public Schema\RedEyes|Schema\BlueEyes|Schema\GreenEyes|Schema\YellowEyes|Schema\BlackEyes $eyes) + public function __construct(public int $id, public string $name, public ?bool $indoor, public ?Schema\Cat\Features $features, #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Schema\Cat\Eyes] public Schema\RedEyes|Schema\BlueEyes|Schema\GreenEyes|Schema\YellowEyes|Schema\BlackEyes $eyes) { } } diff --git a/tests/app/src/Schema/Cat/Features.php b/tests/app/src/Schema/Cat/Features.php index 41f36c9..3c0a930 100644 --- a/tests/app/src/Schema/Cat/Features.php +++ b/tests/app/src/Schema/Cat/Features.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema\Cat; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Schema/Dog.php b/tests/app/src/Schema/Dog.php index b6bb4ca..836bdf5 100644 --- a/tests/app/src/Schema/Dog.php +++ b/tests/app/src/Schema/Dog.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; @@ -143,7 +140,7 @@ "good-boy": false, "eyes": null }'; - public function __construct(public int $id, public string $name, #[\EventSauce\ObjectHydrator\MapFrom('good-boy')] public ?bool $goodMinBoy, #[\ApiClients\Client\PetStore\Attribute\CastUnionToType\Schema\Dog\Eyes] public Schema\RedEyes|Schema\BlueEyes|Schema\GreenEyes|Schema\YellowEyes|Schema\BlackEyes $eyes) + public function __construct(public int $id, public string $name, #[\EventSauce\ObjectHydrator\MapFrom('good-boy')] public ?bool $goodMinBoy, #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Schema\Dog\Eyes] public Schema\RedEyes|Schema\BlueEyes|Schema\GreenEyes|Schema\YellowEyes|Schema\BlackEyes $eyes) { } } diff --git a/tests/app/src/Schema/Error.php b/tests/app/src/Schema/Error.php index e18036a..0518472 100644 --- a/tests/app/src/Schema/Error.php +++ b/tests/app/src/Schema/Error.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Schema/Fins.php b/tests/app/src/Schema/Fins.php index f9c172b..9b54eb7 100644 --- a/tests/app/src/Schema/Fins.php +++ b/tests/app/src/Schema/Fins.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Schema/Fish.php b/tests/app/src/Schema/Fish.php index 3f19a41..85880c0 100644 --- a/tests/app/src/Schema/Fish.php +++ b/tests/app/src/Schema/Fish.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; @@ -143,7 +140,7 @@ "flat": false, "eyes": null }'; - public function __construct(public int $id, public string $name, public ?bool $flat, #[\ApiClients\Client\PetStore\Attribute\CastUnionToType\Schema\Fish\Eyes] public Schema\RedEyes|Schema\BlueEyes|Schema\GreenEyes|Schema\YellowEyes|Schema\BlackEyes $eyes) + public function __construct(public int $id, public string $name, public ?bool $flat, #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Schema\Fish\Eyes] public Schema\RedEyes|Schema\BlueEyes|Schema\GreenEyes|Schema\YellowEyes|Schema\BlackEyes $eyes) { } } diff --git a/tests/app/src/Schema/GreenEyes.php b/tests/app/src/Schema/GreenEyes.php index c7bd327..04bbdf8 100644 --- a/tests/app/src/Schema/GreenEyes.php +++ b/tests/app/src/Schema/GreenEyes.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Schema/Legs.php b/tests/app/src/Schema/Legs.php index d775470..a855747 100644 --- a/tests/app/src/Schema/Legs.php +++ b/tests/app/src/Schema/Legs.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Schema/Operations/Pets/List_/Response/ApplicationJson/Ok.php b/tests/app/src/Schema/Operations/Pets/List_/Response/ApplicationJson/Ok.php index 29e9c7d..76fa60f 100644 --- a/tests/app/src/Schema/Operations/Pets/List_/Response/ApplicationJson/Ok.php +++ b/tests/app/src/Schema/Operations/Pets/List_/Response/ApplicationJson/Ok.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema\Operations\Pets\List_\Response\ApplicationJson; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Schema/Operations/Pets/Names/Response/ApplicationJson/Ok.php b/tests/app/src/Schema/Operations/Pets/Names/Response/ApplicationJson/Ok.php index fe9700a..2e07c70 100644 --- a/tests/app/src/Schema/Operations/Pets/Names/Response/ApplicationJson/Ok.php +++ b/tests/app/src/Schema/Operations/Pets/Names/Response/ApplicationJson/Ok.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema\Operations\Pets\Names\Response\ApplicationJson; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Schema/Operations/ShowPetById/Response/ApplicationJson/Ok.php b/tests/app/src/Schema/Operations/ShowPetById/Response/ApplicationJson/Ok.php index e98c5f0..ca5acf9 100644 --- a/tests/app/src/Schema/Operations/ShowPetById/Response/ApplicationJson/Ok.php +++ b/tests/app/src/Schema/Operations/ShowPetById/Response/ApplicationJson/Ok.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema\Operations\ShowPetById\Response\ApplicationJson; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Schema/Pets/Create/Request/ApplicationJson.php b/tests/app/src/Schema/Pets/Create/Request/ApplicationJson.php index 0d656a3..17bc55c 100644 --- a/tests/app/src/Schema/Pets/Create/Request/ApplicationJson.php +++ b/tests/app/src/Schema/Pets/Create/Request/ApplicationJson.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema\Pets\Create\Request; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Schema/RedEyes.php b/tests/app/src/Schema/RedEyes.php index 38aa892..7057605 100644 --- a/tests/app/src/Schema/RedEyes.php +++ b/tests/app/src/Schema/RedEyes.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Schema/Tails.php b/tests/app/src/Schema/Tails.php index 3025e6b..1bd4f78 100644 --- a/tests/app/src/Schema/Tails.php +++ b/tests/app/src/Schema/Tails.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Schema/Wings.php b/tests/app/src/Schema/Wings.php index d7b5ea5..433928a 100644 --- a/tests/app/src/Schema/Wings.php +++ b/tests/app/src/Schema/Wings.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/src/Schema/YellowEyes.php b/tests/app/src/Schema/YellowEyes.php index 92a8859..d7445ed 100644 --- a/tests/app/src/Schema/YellowEyes.php +++ b/tests/app/src/Schema/YellowEyes.php @@ -4,12 +4,9 @@ namespace ApiClients\Client\PetStore\Schema; use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Hydrator; +use ApiClients\Client\PetStore\Internal; use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Operator; use ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\WebHook; -use ApiClients\Client\PetStore\Router; use League\OpenAPIValidation; use React\Http; use ApiClients\Contracts; diff --git a/tests/app/tests/Operation/Pets/CreateTest.php b/tests/app/tests/Internal/Operation/Pets/CreateTest.php similarity index 91% rename from tests/app/tests/Operation/Pets/CreateTest.php rename to tests/app/tests/Internal/Operation/Pets/CreateTest.php index 8c9a34c..b79cbbb 100644 --- a/tests/app/tests/Operation/Pets/CreateTest.php +++ b/tests/app/tests/Internal/Operation/Pets/CreateTest.php @@ -1,20 +1,17 @@ withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->request('POST', '/pets', \Prophecy\Argument::type('array'), json_encode(json_decode(Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Operation\Pets\Create::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(Internal\Operation\Pets\Create::OPERATION_MATCH, (static function (array $data) : array { return $data; })(json_decode(Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); } @@ -63,7 +60,7 @@ public function call_httpCode_201_requestContentType_application_json_empty() $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->request('POST', '/pets', \Prophecy\Argument::type('array'), json_encode(json_decode(Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Operation\Pets\Create::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(Internal\Operation\Pets\Create::OPERATION_MATCH, (static function (array $data) : array { return $data; })(json_decode(Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); } diff --git a/tests/app/tests/Operation/Pets/ListListingTest.php b/tests/app/tests/Internal/Operation/Pets/ListListingTest.php similarity index 86% rename from tests/app/tests/Operation/Pets/ListListingTest.php rename to tests/app/tests/Internal/Operation/Pets/ListListingTest.php index 42dbcf9..ab5d3f3 100644 --- a/tests/app/tests/Operation/Pets/ListListingTest.php +++ b/tests/app/tests/Internal/Operation/Pets/ListListingTest.php @@ -1,20 +1,17 @@ withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->request('GET', '/pets?per_page=8&page=1', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Operation\Pets\ListListing::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(Internal\Operation\Pets\ListListing::OPERATION_MATCH, (static function (array $data) : array { $data['per_page'] = 8; $data['page'] = 1; return $data; diff --git a/tests/app/tests/Operation/Pets/List_/GatosListingTest.php b/tests/app/tests/Internal/Operation/Pets/List_/GatosListingTest.php similarity index 86% rename from tests/app/tests/Operation/Pets/List_/GatosListingTest.php rename to tests/app/tests/Internal/Operation/Pets/List_/GatosListingTest.php index c6c3f65..596f0f9 100644 --- a/tests/app/tests/Operation/Pets/List_/GatosListingTest.php +++ b/tests/app/tests/Internal/Operation/Pets/List_/GatosListingTest.php @@ -1,20 +1,17 @@ withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->request('GET', '/pets/gatos?per_page=8&page=1', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Operation\Pets\List_\GatosListing::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(Internal\Operation\Pets\List_\GatosListing::OPERATION_MATCH, (static function (array $data) : array { $data['per_page'] = 8; $data['page'] = 1; return $data; diff --git a/tests/app/tests/Operation/Pets/List_/GatosTest.php b/tests/app/tests/Internal/Operation/Pets/List_/GatosTest.php similarity index 86% rename from tests/app/tests/Operation/Pets/List_/GatosTest.php rename to tests/app/tests/Internal/Operation/Pets/List_/GatosTest.php index 5bec206..d4474ac 100644 --- a/tests/app/tests/Operation/Pets/List_/GatosTest.php +++ b/tests/app/tests/Internal/Operation/Pets/List_/GatosTest.php @@ -1,20 +1,17 @@ withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->request('GET', '/pets/gatos?per_page=8&page=1', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Operation\Pets\List_\Gatos::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(Internal\Operation\Pets\List_\Gatos::OPERATION_MATCH, (static function (array $data) : array { $data['per_page'] = 8; $data['page'] = 1; return $data; diff --git a/tests/app/tests/Operation/Pets/List_Test.php b/tests/app/tests/Internal/Operation/Pets/List_Test.php similarity index 86% rename from tests/app/tests/Operation/Pets/List_Test.php rename to tests/app/tests/Internal/Operation/Pets/List_Test.php index 579b7c9..3096e09 100644 --- a/tests/app/tests/Operation/Pets/List_Test.php +++ b/tests/app/tests/Internal/Operation/Pets/List_Test.php @@ -1,20 +1,17 @@ withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->request('GET', '/pets?per_page=8&page=1', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Operation\Pets\List_::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(Internal\Operation\Pets\List_::OPERATION_MATCH, (static function (array $data) : array { $data['per_page'] = 8; $data['page'] = 1; return $data; diff --git a/tests/app/tests/Operation/Pets/NamesListingTest.php b/tests/app/tests/Internal/Operation/Pets/NamesListingTest.php similarity index 86% rename from tests/app/tests/Operation/Pets/NamesListingTest.php rename to tests/app/tests/Internal/Operation/Pets/NamesListingTest.php index 19ea9c0..c866f1b 100644 --- a/tests/app/tests/Operation/Pets/NamesListingTest.php +++ b/tests/app/tests/Internal/Operation/Pets/NamesListingTest.php @@ -1,20 +1,17 @@ withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->request('GET', '/pets/names?per_page=8&page=1', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Operation\Pets\NamesListing::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(Internal\Operation\Pets\NamesListing::OPERATION_MATCH, (static function (array $data) : array { $data['per_page'] = 8; $data['page'] = 1; return $data; diff --git a/tests/app/tests/Operation/Pets/NamesTest.php b/tests/app/tests/Internal/Operation/Pets/NamesTest.php similarity index 86% rename from tests/app/tests/Operation/Pets/NamesTest.php rename to tests/app/tests/Internal/Operation/Pets/NamesTest.php index b790a4e..f775ed3 100644 --- a/tests/app/tests/Operation/Pets/NamesTest.php +++ b/tests/app/tests/Internal/Operation/Pets/NamesTest.php @@ -1,20 +1,17 @@ withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->request('GET', '/pets/names?per_page=8&page=1', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Operation\Pets\Names::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(Internal\Operation\Pets\Names::OPERATION_MATCH, (static function (array $data) : array { $data['per_page'] = 8; $data['page'] = 1; return $data; diff --git a/tests/app/tests/Operation/ShowPetByIdTest.php b/tests/app/tests/Internal/Operation/ShowPetByIdTest.php similarity index 86% rename from tests/app/tests/Operation/ShowPetByIdTest.php rename to tests/app/tests/Internal/Operation/ShowPetByIdTest.php index 4ab2c9c..d3c4b09 100644 --- a/tests/app/tests/Operation/ShowPetByIdTest.php +++ b/tests/app/tests/Internal/Operation/ShowPetByIdTest.php @@ -1,20 +1,17 @@ withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->request('GET', '/pets/{petId}', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Operation\ShowPetById::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(Internal\Operation\ShowPetById::OPERATION_MATCH, (static function (array $data) : array { return $data; })(array())); }