forked from loafle/openapi-generator-original
Zend Expressive fix and upgrade to version 2 (#6461)
* upgraded zend-expressive from version 1 to 2 * Changed error handler for compatibility with Zend Expressive 2 * generated newest sample files for Petstore ze-ph * removed ErrorMiddleware because it is never been used anymore. Regenerated samples * removed ErrorMiddleware Template from Codegen * remove ErrorMiddleware from petstore sample * Fixed some code styles * regenerated ze-ph samples with corrected code styles * added new line at the end of the file
This commit is contained in:
parent
ccc980e619
commit
c5c639b62b
@ -55,7 +55,6 @@ public class ZendExpressivePathHandlerServerCodegen extends AbstractPhpCodegen {
|
|||||||
supportingFiles.add(new SupportingFile("Date.php.mustache", packagePath + File.separator + srcBasePath + File.separator + "Strategy", "Date.php"));
|
supportingFiles.add(new SupportingFile("Date.php.mustache", packagePath + File.separator + srcBasePath + File.separator + "Strategy", "Date.php"));
|
||||||
supportingFiles.add(new SupportingFile("DateTime.php.mustache", packagePath + File.separator + srcBasePath + File.separator + "Strategy", "DateTime.php"));
|
supportingFiles.add(new SupportingFile("DateTime.php.mustache", packagePath + File.separator + srcBasePath + File.separator + "Strategy", "DateTime.php"));
|
||||||
supportingFiles.add(new SupportingFile("Type.php.mustache", packagePath + File.separator + srcBasePath + File.separator + "Validator", "Type.php"));
|
supportingFiles.add(new SupportingFile("Type.php.mustache", packagePath + File.separator + srcBasePath + File.separator + "Validator", "Type.php"));
|
||||||
supportingFiles.add(new SupportingFile("ErrorMiddleware.php.mustache", packagePath + File.separator + srcBasePath, "ErrorMiddleware.php"));
|
|
||||||
|
|
||||||
additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, "1.0.0");
|
additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, "1.0.0");
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,10 @@ class Date extends DateTime
|
|||||||
*/
|
*/
|
||||||
protected function parseDateString($arrayValue)
|
protected function parseDateString($arrayValue)
|
||||||
{
|
{
|
||||||
return \DateTime::createFromFormat(static::DATE_TIME_FORMAT.' H:i:sP', $arrayValue.' 00:00:00+00:00', new \DateTimeZone('UTC'));
|
return \DateTime::createFromFormat(
|
||||||
|
static::DATE_TIME_FORMAT . ' H:i:sP',
|
||||||
|
$arrayValue . ' 00:00:00+00:00',
|
||||||
|
new \DateTimeZone('UTC')
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace {{invokerPackage}}\Strategy;
|
namespace {{invokerPackage}}\Strategy;
|
||||||
|
|
||||||
use Articus\DataTransfer\Strategy\StrategyInterface;
|
use Articus\DataTransfer\Strategy\StrategyInterface;
|
||||||
|
|
||||||
class DateTime implements StrategyInterface
|
class DateTime implements StrategyInterface
|
||||||
{
|
{
|
||||||
const DATE_TIME_FORMAT = \DateTime::RFC3339;
|
const DATE_TIME_FORMAT = \DateTime::RFC3339;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
@ -41,4 +43,4 @@ class DateTime implements StrategyInterface
|
|||||||
{
|
{
|
||||||
return \DateTime::createFromFormat(static::DATE_TIME_FORMAT, $arrayValue, new \DateTimeZone('UTC'));
|
return \DateTime::createFromFormat(static::DATE_TIME_FORMAT, $arrayValue, new \DateTimeZone('UTC'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace {{invokerPackage}};
|
|
||||||
|
|
||||||
use Psr\Http\Message\ResponseInterface as Response;
|
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
|
||||||
use Zend\Stratigility\ErrorMiddlewareInterface;
|
|
||||||
|
|
||||||
class ErrorMiddleware implements ErrorMiddlewareInterface
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
public function __invoke($error, Request $request, Response $response, callable $out = null)
|
|
||||||
{
|
|
||||||
$response = $response->withStatus(500, 'Internal server error');
|
|
||||||
$response->getBody()->write((string)$error);
|
|
||||||
error_log((string) $error);
|
|
||||||
return ($out === null)? $response : $out($request, $response);
|
|
||||||
}
|
|
||||||
}
|
|
@ -68,4 +68,4 @@ class Type extends AbstractValidator
|
|||||||
throw new \InvalidArgumentException(sprintf('Can not check for type %s.', $this->type));
|
throw new \InvalidArgumentException(sprintf('Can not check for type %s.', $this->type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@ use Articus\PathHandler\Exception as PHException;
|
|||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
{{#operations}}
|
{{#operations}}
|
||||||
|
|
||||||
{{#description}}
|
{{#description}}
|
||||||
/**
|
/**
|
||||||
* {{&description}}
|
* {{&description}}
|
||||||
@ -40,7 +39,11 @@ class {{classname}} implements {{interfacesToImplement}}
|
|||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="{{mediaType}}")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="{{mediaType}}")
|
||||||
{{/produces}}
|
{{/produces}}
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
{{#returnType}}
|
{{#returnType}}
|
||||||
|
*
|
||||||
* @return {{returnType}}
|
* @return {{returnType}}
|
||||||
{{/returnType}}
|
{{/returnType}}
|
||||||
*/
|
*/
|
||||||
|
@ -3,17 +3,24 @@ dependencies:
|
|||||||
#Has to add this line because currently router is strict requirement for Zend\Expressive\Application even if only middleware_pipeline is used
|
#Has to add this line because currently router is strict requirement for Zend\Expressive\Application even if only middleware_pipeline is used
|
||||||
Zend\Expressive\Router\RouterInterface: Zend\Expressive\Router\ZendRouter
|
Zend\Expressive\Router\RouterInterface: Zend\Expressive\Router\ZendRouter
|
||||||
Zend\Diactoros\Response\EmitterInterface: Zend\Diactoros\Response\SapiStreamEmitter
|
Zend\Diactoros\Response\EmitterInterface: Zend\Diactoros\Response\SapiStreamEmitter
|
||||||
{{invokerPackage}}\ErrorMiddleware: {{invokerPackage}}\ErrorMiddleware
|
|
||||||
factories:
|
factories:
|
||||||
Zend\Expressive\Application: Zend\Expressive\Container\ApplicationFactory
|
Zend\Expressive\Application: Zend\Expressive\Container\ApplicationFactory
|
||||||
Articus\PathHandler\Middleware: Articus\PathHandler\MiddlewareFactory
|
Articus\PathHandler\Middleware: Articus\PathHandler\MiddlewareFactory
|
||||||
Articus\DataTransfer\Service: Articus\DataTransfer\ServiceFactory
|
Articus\DataTransfer\Service: Articus\DataTransfer\ServiceFactory
|
||||||
|
Zend\Stratigility\Middleware\ErrorHandler: Zend\Expressive\Container\ErrorHandlerFactory
|
||||||
|
Zend\Expressive\Middleware\ErrorResponseGenerator: Zend\Expressive\Container\WhoopsErrorResponseGeneratorFactory
|
||||||
|
Zend\Expressive\Whoops: Zend\Expressive\Container\WhoopsFactory
|
||||||
|
Zend\Expressive\WhoopsPageHandler: Zend\Expressive\Container\WhoopsPageHandlerFactory
|
||||||
|
|
||||||
middleware_pipeline:
|
middleware_pipeline:
|
||||||
|
error:
|
||||||
|
middleware: Zend\Stratigility\Middleware\ErrorHandler
|
||||||
api:
|
api:
|
||||||
middleware: Articus\PathHandler\Middleware
|
middleware: Articus\PathHandler\Middleware
|
||||||
path: {{basePathWithoutHost}}
|
path: {{basePathWithoutHost}}
|
||||||
error:
|
|
||||||
middleware: {{invokerPackage}}\ErrorMiddleware
|
whoops:
|
||||||
error: true
|
json_exceptions:
|
||||||
priority: -10000
|
display: true
|
||||||
|
show_trace: true
|
||||||
|
ajax_only: true
|
||||||
|
@ -7,12 +7,14 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": "^5.6 || ^7.0",
|
"php": "^5.6 || ^7.0",
|
||||||
"ext-yaml" : "^1.2 || ^2.0",
|
"ext-yaml" : "^1.2 || ^2.0",
|
||||||
"zendframework/zend-expressive": "^1.0",
|
"zendframework/zend-expressive": "^2.0",
|
||||||
"zendframework/zend-expressive-router": "1.2.*",
|
"zendframework/zend-expressive-router": "^2.1",
|
||||||
"articus/path-handler": "0.1.*",
|
"zendframework/zend-expressive-zendrouter": "^2.0",
|
||||||
|
"articus/path-handler": "0.2.*",
|
||||||
"articus/data-transfer": "*",
|
"articus/data-transfer": "*",
|
||||||
"zendframework/zend-serializer": "*",
|
"zendframework/zend-serializer": "*",
|
||||||
"zendframework/zend-config": "*"
|
"zendframework/zend-config": "*",
|
||||||
|
"filp/whoops": "^2.1.7"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
#App
|
#App
|
||||||
cache_configuration: false
|
cache_configuration: false
|
||||||
|
debug: true
|
||||||
|
@ -7,4 +7,4 @@ $container = require_once __DIR__.'/../application/container.php';
|
|||||||
|
|
||||||
/** @var \Zend\Expressive\Application $app */
|
/** @var \Zend\Expressive\Application $app */
|
||||||
$app = $container->get(\Zend\Expressive\Application::class);
|
$app = $container->get(\Zend\Expressive\Application::class);
|
||||||
$app->run();
|
$app->run();
|
||||||
|
@ -9,7 +9,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
* {{description}}
|
* {{description}}
|
||||||
{{/description}}
|
{{/description}}
|
||||||
*/
|
*/
|
||||||
class {{classname}}
|
class {{classname}}
|
||||||
{
|
{
|
||||||
{{#vars}}
|
{{#vars}}
|
||||||
/**
|
/**
|
||||||
@ -127,5 +127,4 @@ class {{classname}}
|
|||||||
*/
|
*/
|
||||||
public ${{name}};
|
public ${{name}};
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
}
|
}{{/model}}{{/models}}
|
||||||
{{/model}}{{/models}}
|
|
||||||
|
@ -1 +1 @@
|
|||||||
2.2.3-SNAPSHOT
|
2.3.0-SNAPSHOT
|
@ -1,2 +1,3 @@
|
|||||||
#App
|
#App
|
||||||
cache_configuration: false
|
cache_configuration: false
|
||||||
|
debug: true
|
||||||
|
@ -3,17 +3,24 @@ dependencies:
|
|||||||
#Has to add this line because currently router is strict requirement for Zend\Expressive\Application even if only middleware_pipeline is used
|
#Has to add this line because currently router is strict requirement for Zend\Expressive\Application even if only middleware_pipeline is used
|
||||||
Zend\Expressive\Router\RouterInterface: Zend\Expressive\Router\ZendRouter
|
Zend\Expressive\Router\RouterInterface: Zend\Expressive\Router\ZendRouter
|
||||||
Zend\Diactoros\Response\EmitterInterface: Zend\Diactoros\Response\SapiStreamEmitter
|
Zend\Diactoros\Response\EmitterInterface: Zend\Diactoros\Response\SapiStreamEmitter
|
||||||
App\ErrorMiddleware: App\ErrorMiddleware
|
|
||||||
factories:
|
factories:
|
||||||
Zend\Expressive\Application: Zend\Expressive\Container\ApplicationFactory
|
Zend\Expressive\Application: Zend\Expressive\Container\ApplicationFactory
|
||||||
Articus\PathHandler\Middleware: Articus\PathHandler\MiddlewareFactory
|
Articus\PathHandler\Middleware: Articus\PathHandler\MiddlewareFactory
|
||||||
Articus\DataTransfer\Service: Articus\DataTransfer\ServiceFactory
|
Articus\DataTransfer\Service: Articus\DataTransfer\ServiceFactory
|
||||||
|
Zend\Stratigility\Middleware\ErrorHandler: Zend\Expressive\Container\ErrorHandlerFactory
|
||||||
|
Zend\Expressive\Middleware\ErrorResponseGenerator: Zend\Expressive\Container\WhoopsErrorResponseGeneratorFactory
|
||||||
|
Zend\Expressive\Whoops: Zend\Expressive\Container\WhoopsFactory
|
||||||
|
Zend\Expressive\WhoopsPageHandler: Zend\Expressive\Container\WhoopsPageHandlerFactory
|
||||||
|
|
||||||
middleware_pipeline:
|
middleware_pipeline:
|
||||||
|
error:
|
||||||
|
middleware: Zend\Stratigility\Middleware\ErrorHandler
|
||||||
api:
|
api:
|
||||||
middleware: Articus\PathHandler\Middleware
|
middleware: Articus\PathHandler\Middleware
|
||||||
path: /v2
|
path: /v2
|
||||||
error:
|
|
||||||
middleware: App\ErrorMiddleware
|
whoops:
|
||||||
error: true
|
json_exceptions:
|
||||||
priority: -10000
|
display: true
|
||||||
|
show_trace: true
|
||||||
|
ajax_only: true
|
||||||
|
@ -9,6 +9,12 @@ path_handler:
|
|||||||
handler: Fake
|
handler: Fake
|
||||||
may_terminate: true
|
may_terminate: true
|
||||||
child_routes:
|
child_routes:
|
||||||
|
'jsonFormData':
|
||||||
|
type: Literal
|
||||||
|
options:
|
||||||
|
route: /jsonFormData
|
||||||
|
defaults:
|
||||||
|
handler: FakeJsonFormData
|
||||||
'outer':
|
'outer':
|
||||||
type: Literal
|
type: Literal
|
||||||
options:
|
options:
|
||||||
@ -38,6 +44,12 @@ path_handler:
|
|||||||
route: /string
|
route: /string
|
||||||
defaults:
|
defaults:
|
||||||
handler: FakeOuterString
|
handler: FakeOuterString
|
||||||
|
'fake_classname_test':
|
||||||
|
type: Literal
|
||||||
|
options:
|
||||||
|
route: /fake_classname_test
|
||||||
|
defaults:
|
||||||
|
handler: FakeClassnameTest
|
||||||
'pet':
|
'pet':
|
||||||
type: Literal
|
type: Literal
|
||||||
options:
|
options:
|
||||||
@ -150,10 +162,12 @@ path_handler:
|
|||||||
handlers:
|
handlers:
|
||||||
invokables:
|
invokables:
|
||||||
Fake: App\Handler\Fake
|
Fake: App\Handler\Fake
|
||||||
|
FakeJsonFormData: App\Handler\FakeJsonFormData
|
||||||
FakeOuterBoolean: App\Handler\FakeOuterBoolean
|
FakeOuterBoolean: App\Handler\FakeOuterBoolean
|
||||||
FakeOuterComposite: App\Handler\FakeOuterComposite
|
FakeOuterComposite: App\Handler\FakeOuterComposite
|
||||||
FakeOuterNumber: App\Handler\FakeOuterNumber
|
FakeOuterNumber: App\Handler\FakeOuterNumber
|
||||||
FakeOuterString: App\Handler\FakeOuterString
|
FakeOuterString: App\Handler\FakeOuterString
|
||||||
|
FakeClassnameTest: App\Handler\FakeClassnameTest
|
||||||
Pet: App\Handler\Pet
|
Pet: App\Handler\Pet
|
||||||
PetFindByStatus: App\Handler\PetFindByStatus
|
PetFindByStatus: App\Handler\PetFindByStatus
|
||||||
PetFindByTags: App\Handler\PetFindByTags
|
PetFindByTags: App\Handler\PetFindByTags
|
||||||
|
@ -7,12 +7,14 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": "^5.6 || ^7.0",
|
"php": "^5.6 || ^7.0",
|
||||||
"ext-yaml" : "^1.2 || ^2.0",
|
"ext-yaml" : "^1.2 || ^2.0",
|
||||||
"zendframework/zend-expressive": "^1.0",
|
"zendframework/zend-expressive": "^2.0",
|
||||||
"zendframework/zend-expressive-router": "1.2.*",
|
"zendframework/zend-expressive-router": "^2.1",
|
||||||
"articus/path-handler": "0.1.*",
|
"zendframework/zend-expressive-zendrouter": "^2.0",
|
||||||
|
"articus/path-handler": "0.2.*",
|
||||||
"articus/data-transfer": "*",
|
"articus/data-transfer": "*",
|
||||||
"zendframework/zend-serializer": "*",
|
"zendframework/zend-serializer": "*",
|
||||||
"zendframework/zend-config": "*"
|
"zendframework/zend-config": "*",
|
||||||
|
"filp/whoops": "^2.1.7"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
@ -7,4 +7,4 @@ $container = require_once __DIR__.'/../application/container.php';
|
|||||||
|
|
||||||
/** @var \Zend\Expressive\Application $app */
|
/** @var \Zend\Expressive\Application $app */
|
||||||
$app = $container->get(\Zend\Expressive\Application::class);
|
$app = $container->get(\Zend\Expressive\Application::class);
|
||||||
$app->run();
|
$app->run();
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class AdditionalPropertiesClass
|
class AdditionalPropertiesClass
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="map_property", nullable=true)
|
* @DTA\Data(field="map_property", nullable=true)
|
||||||
@ -21,4 +21,3 @@ class AdditionalPropertiesClass
|
|||||||
*/
|
*/
|
||||||
public $map_of_map_property;
|
public $map_of_map_property;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class Animal
|
class Animal
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="className")
|
* @DTA\Data(field="className")
|
||||||
@ -21,4 +21,3 @@ class Animal
|
|||||||
*/
|
*/
|
||||||
public $color;
|
public $color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class AnimalFarm
|
class AnimalFarm
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class ApiResponse
|
class ApiResponse
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="code", nullable=true)
|
* @DTA\Data(field="code", nullable=true)
|
||||||
@ -27,4 +27,3 @@ class ApiResponse
|
|||||||
*/
|
*/
|
||||||
public $message;
|
public $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class ArrayOfArrayOfNumberOnly
|
class ArrayOfArrayOfNumberOnly
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="ArrayArrayNumber", nullable=true)
|
* @DTA\Data(field="ArrayArrayNumber", nullable=true)
|
||||||
@ -18,4 +18,3 @@ class ArrayOfArrayOfNumberOnly
|
|||||||
*/
|
*/
|
||||||
public $array_array_number;
|
public $array_array_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class ArrayOfNumberOnly
|
class ArrayOfNumberOnly
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="ArrayNumber", nullable=true)
|
* @DTA\Data(field="ArrayNumber", nullable=true)
|
||||||
@ -17,4 +17,3 @@ class ArrayOfNumberOnly
|
|||||||
*/
|
*/
|
||||||
public $array_number;
|
public $array_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class ArrayTest
|
class ArrayTest
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="array_of_string", nullable=true)
|
* @DTA\Data(field="array_of_string", nullable=true)
|
||||||
@ -35,4 +35,3 @@ class ArrayTest
|
|||||||
*/
|
*/
|
||||||
public $array_array_of_model;
|
public $array_array_of_model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class Capitalization
|
class Capitalization
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="smallCamel", nullable=true)
|
* @DTA\Data(field="smallCamel", nullable=true)
|
||||||
@ -46,4 +46,3 @@ class Capitalization
|
|||||||
*/
|
*/
|
||||||
public $att_name;
|
public $att_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class Cat
|
class Cat
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="className")
|
* @DTA\Data(field="className")
|
||||||
@ -27,4 +27,3 @@ class Cat
|
|||||||
*/
|
*/
|
||||||
public $declawed;
|
public $declawed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class Category
|
class Category
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="id", nullable=true)
|
* @DTA\Data(field="id", nullable=true)
|
||||||
@ -21,4 +21,3 @@ class Category
|
|||||||
*/
|
*/
|
||||||
public $name;
|
public $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
/**
|
/**
|
||||||
* Model for testing model with \"_class\" property
|
* Model for testing model with \"_class\" property
|
||||||
*/
|
*/
|
||||||
class ClassModel
|
class ClassModel
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="_class", nullable=true)
|
* @DTA\Data(field="_class", nullable=true)
|
||||||
@ -16,4 +16,3 @@ class ClassModel
|
|||||||
*/
|
*/
|
||||||
public $_class;
|
public $_class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class Client
|
class Client
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="client", nullable=true)
|
* @DTA\Data(field="client", nullable=true)
|
||||||
@ -15,4 +15,3 @@ class Client
|
|||||||
*/
|
*/
|
||||||
public $client;
|
public $client;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class Dog
|
class Dog
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="className")
|
* @DTA\Data(field="className")
|
||||||
@ -27,4 +27,3 @@ class Dog
|
|||||||
*/
|
*/
|
||||||
public $breed;
|
public $breed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class EnumArrays
|
class EnumArrays
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="just_symbol", nullable=true)
|
* @DTA\Data(field="just_symbol", nullable=true)
|
||||||
@ -23,4 +23,3 @@ class EnumArrays
|
|||||||
*/
|
*/
|
||||||
public $array_enum;
|
public $array_enum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class EnumClass
|
class EnumClass
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class EnumTest
|
class EnumTest
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="enum_string", nullable=true)
|
* @DTA\Data(field="enum_string", nullable=true)
|
||||||
@ -34,4 +34,3 @@ class EnumTest
|
|||||||
*/
|
*/
|
||||||
public $outer_enum;
|
public $outer_enum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class FormatTest
|
class FormatTest
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="integer", nullable=true)
|
* @DTA\Data(field="integer", nullable=true)
|
||||||
@ -63,6 +63,8 @@ class FormatTest
|
|||||||
public $string;
|
public $string;
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="byte")
|
* @DTA\Data(field="byte")
|
||||||
|
* @DTA\Validator(name="Type", options={"type":"string"})
|
||||||
|
* @DTA\Validator(name="Regex", options={"pattern":"/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/"})
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $byte;
|
public $byte;
|
||||||
@ -99,4 +101,3 @@ class FormatTest
|
|||||||
*/
|
*/
|
||||||
public $password;
|
public $password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class HasOnlyReadOnly
|
class HasOnlyReadOnly
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="bar", nullable=true)
|
* @DTA\Data(field="bar", nullable=true)
|
||||||
@ -21,4 +21,3 @@ class HasOnlyReadOnly
|
|||||||
*/
|
*/
|
||||||
public $foo;
|
public $foo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class MapTest
|
class MapTest
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="map_map_of_string", nullable=true)
|
* @DTA\Data(field="map_map_of_string", nullable=true)
|
||||||
@ -21,4 +21,3 @@ class MapTest
|
|||||||
*/
|
*/
|
||||||
public $map_of_enum_string;
|
public $map_of_enum_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class MixedPropertiesAndAdditionalPropertiesClass
|
class MixedPropertiesAndAdditionalPropertiesClass
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="uuid", nullable=true)
|
* @DTA\Data(field="uuid", nullable=true)
|
||||||
@ -29,4 +29,3 @@ class MixedPropertiesAndAdditionalPropertiesClass
|
|||||||
*/
|
*/
|
||||||
public $map;
|
public $map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
/**
|
/**
|
||||||
* Model for testing model name starting with number
|
* Model for testing model name starting with number
|
||||||
*/
|
*/
|
||||||
class Model200Response
|
class Model200Response
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="name", nullable=true)
|
* @DTA\Data(field="name", nullable=true)
|
||||||
@ -22,4 +22,3 @@ class Model200Response
|
|||||||
*/
|
*/
|
||||||
public $class;
|
public $class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
/**
|
/**
|
||||||
* Model for testing reserved words
|
* Model for testing reserved words
|
||||||
*/
|
*/
|
||||||
class ModelReturn
|
class ModelReturn
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="return", nullable=true)
|
* @DTA\Data(field="return", nullable=true)
|
||||||
@ -16,4 +16,3 @@ class ModelReturn
|
|||||||
*/
|
*/
|
||||||
public $return;
|
public $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
/**
|
/**
|
||||||
* Model for testing model name same as property name
|
* Model for testing model name same as property name
|
||||||
*/
|
*/
|
||||||
class Name
|
class Name
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="name")
|
* @DTA\Data(field="name")
|
||||||
@ -34,4 +34,3 @@ class Name
|
|||||||
*/
|
*/
|
||||||
public $_123_number;
|
public $_123_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class NumberOnly
|
class NumberOnly
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="JustNumber", nullable=true)
|
* @DTA\Data(field="JustNumber", nullable=true)
|
||||||
@ -15,4 +15,3 @@ class NumberOnly
|
|||||||
*/
|
*/
|
||||||
public $just_number;
|
public $just_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class Order
|
class Order
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="id", nullable=true)
|
* @DTA\Data(field="id", nullable=true)
|
||||||
@ -47,4 +47,3 @@ class Order
|
|||||||
*/
|
*/
|
||||||
public $complete;
|
public $complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class OuterBoolean
|
class OuterBoolean
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class OuterComposite
|
class OuterComposite
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="my_number", nullable=true)
|
* @DTA\Data(field="my_number", nullable=true)
|
||||||
@ -30,4 +30,3 @@ class OuterComposite
|
|||||||
*/
|
*/
|
||||||
public $my_boolean;
|
public $my_boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class OuterEnum
|
class OuterEnum
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class OuterNumber
|
class OuterNumber
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class OuterString
|
class OuterString
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class Pet
|
class Pet
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="id", nullable=true)
|
* @DTA\Data(field="id", nullable=true)
|
||||||
@ -52,4 +52,3 @@ class Pet
|
|||||||
*/
|
*/
|
||||||
public $status;
|
public $status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class ReadOnlyFirst
|
class ReadOnlyFirst
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="bar", nullable=true)
|
* @DTA\Data(field="bar", nullable=true)
|
||||||
@ -21,4 +21,3 @@ class ReadOnlyFirst
|
|||||||
*/
|
*/
|
||||||
public $baz;
|
public $baz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class SpecialModelName
|
class SpecialModelName
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="$special[property.name]", nullable=true)
|
* @DTA\Data(field="$special[property.name]", nullable=true)
|
||||||
@ -15,4 +15,3 @@ class SpecialModelName
|
|||||||
*/
|
*/
|
||||||
public $special_property_name;
|
public $special_property_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class Tag
|
class Tag
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="id", nullable=true)
|
* @DTA\Data(field="id", nullable=true)
|
||||||
@ -21,4 +21,3 @@ class Tag
|
|||||||
*/
|
*/
|
||||||
public $name;
|
public $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use Articus\DataTransfer\Annotation as DTA;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class User
|
class User
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @DTA\Data(field="id", nullable=true)
|
* @DTA\Data(field="id", nullable=true)
|
||||||
@ -58,4 +58,3 @@ class User
|
|||||||
*/
|
*/
|
||||||
public $user_status;
|
public $user_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace App;
|
|
||||||
|
|
||||||
use Psr\Http\Message\ResponseInterface as Response;
|
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
|
||||||
use Zend\Stratigility\ErrorMiddlewareInterface;
|
|
||||||
|
|
||||||
class ErrorMiddleware implements ErrorMiddlewareInterface
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
public function __invoke($error, Request $request, Response $response, callable $out = null)
|
|
||||||
{
|
|
||||||
$response = $response->withStatus(500, 'Internal server error');
|
|
||||||
$response->getBody()->write((string)$error);
|
|
||||||
error_log((string) $error);
|
|
||||||
return ($out === null)? $response : $out($request, $response);
|
|
||||||
}
|
|
||||||
}
|
|
@ -10,7 +10,6 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class Fake implements Operation\PatchInterface, Operation\PostInterface, Operation\GetInterface
|
class Fake implements Operation\PatchInterface, Operation\PostInterface, Operation\GetInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -20,6 +19,10 @@ class Fake implements Operation\PatchInterface, Operation\PostInterface, Operati
|
|||||||
* @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":\App\DTO\Client::class,"objectAttr":"body"})
|
* @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":\App\DTO\Client::class,"objectAttr":"body"})
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
|
*
|
||||||
* @return \App\DTO\Client
|
* @return \App\DTO\Client
|
||||||
*/
|
*/
|
||||||
public function handlePatch(ServerRequestInterface $request)
|
public function handlePatch(ServerRequestInterface $request)
|
||||||
@ -35,6 +38,9 @@ class Fake implements Operation\PatchInterface, Operation\PostInterface, Operati
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml; charset=utf-8")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml; charset=utf-8")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json; charset=utf-8")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json; charset=utf-8")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
*/
|
*/
|
||||||
public function handlePost(ServerRequestInterface $request)
|
public function handlePost(ServerRequestInterface $request)
|
||||||
{
|
{
|
||||||
@ -45,6 +51,9 @@ class Fake implements Operation\PatchInterface, Operation\PostInterface, Operati
|
|||||||
* To test enum parameters
|
* To test enum parameters
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="*/*")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="*/*")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
*/
|
*/
|
||||||
public function handleGet(ServerRequestInterface $request)
|
public function handleGet(ServerRequestInterface $request)
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Handler;
|
||||||
|
|
||||||
|
use Articus\PathHandler\Operation;
|
||||||
|
use Articus\PathHandler\Annotation as PHA;
|
||||||
|
use Articus\PathHandler\Consumer as PHConsumer;
|
||||||
|
use Articus\PathHandler\Producer as PHProducer;
|
||||||
|
use Articus\PathHandler\Attribute as PHAttribute;
|
||||||
|
use Articus\PathHandler\Exception as PHException;
|
||||||
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
class FakeClassnameTest implements Operation\PatchInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* To test class name in snake case
|
||||||
|
* TODO check if consumer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
|
* @PHA\Consumer(name=PHConsumer\Json::class, mediaType="application/json")
|
||||||
|
* @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":\App\DTO\Client::class,"objectAttr":"body"})
|
||||||
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
|
*
|
||||||
|
* @return \App\DTO\Client
|
||||||
|
*/
|
||||||
|
public function handlePatch(ServerRequestInterface $request)
|
||||||
|
{
|
||||||
|
//TODO implement method
|
||||||
|
/** @var \App\DTO\Client $body */
|
||||||
|
$body = $request->getAttribute("body");
|
||||||
|
throw new PHException\HttpCode(500, "Not implemented");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Handler;
|
||||||
|
|
||||||
|
use Articus\PathHandler\Operation;
|
||||||
|
use Articus\PathHandler\Annotation as PHA;
|
||||||
|
use Articus\PathHandler\Consumer as PHConsumer;
|
||||||
|
use Articus\PathHandler\Producer as PHProducer;
|
||||||
|
use Articus\PathHandler\Attribute as PHAttribute;
|
||||||
|
use Articus\PathHandler\Exception as PHException;
|
||||||
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
class FakeJsonFormData implements Operation\GetInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* test json serialization of form data
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
|
*/
|
||||||
|
public function handleGet(ServerRequestInterface $request)
|
||||||
|
{
|
||||||
|
//TODO implement method
|
||||||
|
throw new PHException\HttpCode(500, "Not implemented");
|
||||||
|
}
|
||||||
|
}
|
@ -10,11 +10,14 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class FakeOuterBoolean implements Operation\PostInterface
|
class FakeOuterBoolean implements Operation\PostInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":\App\DTO\OuterBoolean::class,"objectAttr":"body"})
|
* @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":\App\DTO\OuterBoolean::class,"objectAttr":"body"})
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
|
*
|
||||||
* @return \App\DTO\OuterBoolean
|
* @return \App\DTO\OuterBoolean
|
||||||
*/
|
*/
|
||||||
public function handlePost(ServerRequestInterface $request)
|
public function handlePost(ServerRequestInterface $request)
|
||||||
|
@ -10,11 +10,14 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class FakeOuterComposite implements Operation\PostInterface
|
class FakeOuterComposite implements Operation\PostInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":\App\DTO\OuterComposite::class,"objectAttr":"body"})
|
* @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":\App\DTO\OuterComposite::class,"objectAttr":"body"})
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
|
*
|
||||||
* @return \App\DTO\OuterComposite
|
* @return \App\DTO\OuterComposite
|
||||||
*/
|
*/
|
||||||
public function handlePost(ServerRequestInterface $request)
|
public function handlePost(ServerRequestInterface $request)
|
||||||
|
@ -10,11 +10,14 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class FakeOuterNumber implements Operation\PostInterface
|
class FakeOuterNumber implements Operation\PostInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":\App\DTO\OuterNumber::class,"objectAttr":"body"})
|
* @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":\App\DTO\OuterNumber::class,"objectAttr":"body"})
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
|
*
|
||||||
* @return \App\DTO\OuterNumber
|
* @return \App\DTO\OuterNumber
|
||||||
*/
|
*/
|
||||||
public function handlePost(ServerRequestInterface $request)
|
public function handlePost(ServerRequestInterface $request)
|
||||||
|
@ -10,11 +10,14 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class FakeOuterString implements Operation\PostInterface
|
class FakeOuterString implements Operation\PostInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":\App\DTO\OuterString::class,"objectAttr":"body"})
|
* @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":\App\DTO\OuterString::class,"objectAttr":"body"})
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
|
*
|
||||||
* @return \App\DTO\OuterString
|
* @return \App\DTO\OuterString
|
||||||
*/
|
*/
|
||||||
public function handlePost(ServerRequestInterface $request)
|
public function handlePost(ServerRequestInterface $request)
|
||||||
|
@ -10,7 +10,6 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class Pet implements Operation\PostInterface, Operation\PutInterface
|
class Pet implements Operation\PostInterface, Operation\PutInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -24,6 +23,9 @@ class Pet implements Operation\PostInterface, Operation\PutInterface
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
*/
|
*/
|
||||||
public function handlePost(ServerRequestInterface $request)
|
public function handlePost(ServerRequestInterface $request)
|
||||||
{
|
{
|
||||||
@ -43,6 +45,9 @@ class Pet implements Operation\PostInterface, Operation\PutInterface
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
*/
|
*/
|
||||||
public function handlePut(ServerRequestInterface $request)
|
public function handlePut(ServerRequestInterface $request)
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,6 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class PetFindByStatus implements Operation\GetInterface
|
class PetFindByStatus implements Operation\GetInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -19,6 +18,10 @@ class PetFindByStatus implements Operation\GetInterface
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
|
*
|
||||||
* @return \App\DTO\Pet[]
|
* @return \App\DTO\Pet[]
|
||||||
*/
|
*/
|
||||||
public function handleGet(ServerRequestInterface $request)
|
public function handleGet(ServerRequestInterface $request)
|
||||||
|
@ -10,7 +10,6 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class PetFindByTags implements Operation\GetInterface
|
class PetFindByTags implements Operation\GetInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -19,6 +18,10 @@ class PetFindByTags implements Operation\GetInterface
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
|
*
|
||||||
* @return \App\DTO\Pet[]
|
* @return \App\DTO\Pet[]
|
||||||
*/
|
*/
|
||||||
public function handleGet(ServerRequestInterface $request)
|
public function handleGet(ServerRequestInterface $request)
|
||||||
|
@ -10,7 +10,6 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class PetPetId implements Operation\DeleteInterface, Operation\GetInterface, Operation\PostInterface
|
class PetPetId implements Operation\DeleteInterface, Operation\GetInterface, Operation\PostInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -19,6 +18,9 @@ class PetPetId implements Operation\DeleteInterface, Operation\GetInterface, Ope
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
*/
|
*/
|
||||||
public function handleDelete(ServerRequestInterface $request)
|
public function handleDelete(ServerRequestInterface $request)
|
||||||
{
|
{
|
||||||
@ -31,6 +33,10 @@ class PetPetId implements Operation\DeleteInterface, Operation\GetInterface, Ope
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
|
*
|
||||||
* @return \App\DTO\Pet
|
* @return \App\DTO\Pet
|
||||||
*/
|
*/
|
||||||
public function handleGet(ServerRequestInterface $request)
|
public function handleGet(ServerRequestInterface $request)
|
||||||
@ -44,6 +50,9 @@ class PetPetId implements Operation\DeleteInterface, Operation\GetInterface, Ope
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
*/
|
*/
|
||||||
public function handlePost(ServerRequestInterface $request)
|
public function handlePost(ServerRequestInterface $request)
|
||||||
{
|
{
|
||||||
|
@ -10,13 +10,16 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class PetPetIdUploadImage implements Operation\PostInterface
|
class PetPetIdUploadImage implements Operation\PostInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* uploads an image
|
* uploads an image
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
|
*
|
||||||
* @return \App\DTO\ApiResponse
|
* @return \App\DTO\ApiResponse
|
||||||
*/
|
*/
|
||||||
public function handlePost(ServerRequestInterface $request)
|
public function handlePost(ServerRequestInterface $request)
|
||||||
|
@ -10,13 +10,16 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class StoreInventory implements Operation\GetInterface
|
class StoreInventory implements Operation\GetInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Returns pet inventories by status
|
* Returns pet inventories by status
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
|
*
|
||||||
* @return map[string,int]
|
* @return map[string,int]
|
||||||
*/
|
*/
|
||||||
public function handleGet(ServerRequestInterface $request)
|
public function handleGet(ServerRequestInterface $request)
|
||||||
|
@ -10,7 +10,6 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class StoreOrder implements Operation\PostInterface
|
class StoreOrder implements Operation\PostInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -20,6 +19,10 @@ class StoreOrder implements Operation\PostInterface
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
|
*
|
||||||
* @return \App\DTO\Order
|
* @return \App\DTO\Order
|
||||||
*/
|
*/
|
||||||
public function handlePost(ServerRequestInterface $request)
|
public function handlePost(ServerRequestInterface $request)
|
||||||
|
@ -10,7 +10,6 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class StoreOrderOrderId implements Operation\DeleteInterface, Operation\GetInterface
|
class StoreOrderOrderId implements Operation\DeleteInterface, Operation\GetInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -19,6 +18,9 @@ class StoreOrderOrderId implements Operation\DeleteInterface, Operation\GetInter
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
*/
|
*/
|
||||||
public function handleDelete(ServerRequestInterface $request)
|
public function handleDelete(ServerRequestInterface $request)
|
||||||
{
|
{
|
||||||
@ -31,6 +33,10 @@ class StoreOrderOrderId implements Operation\DeleteInterface, Operation\GetInter
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
|
*
|
||||||
* @return \App\DTO\Order
|
* @return \App\DTO\Order
|
||||||
*/
|
*/
|
||||||
public function handleGet(ServerRequestInterface $request)
|
public function handleGet(ServerRequestInterface $request)
|
||||||
|
@ -10,7 +10,6 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class User implements Operation\PostInterface
|
class User implements Operation\PostInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -20,6 +19,9 @@ class User implements Operation\PostInterface
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
*/
|
*/
|
||||||
public function handlePost(ServerRequestInterface $request)
|
public function handlePost(ServerRequestInterface $request)
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,6 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class UserCreateWithArray implements Operation\PostInterface
|
class UserCreateWithArray implements Operation\PostInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -20,6 +19,9 @@ class UserCreateWithArray implements Operation\PostInterface
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
*/
|
*/
|
||||||
public function handlePost(ServerRequestInterface $request)
|
public function handlePost(ServerRequestInterface $request)
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,6 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class UserCreateWithList implements Operation\PostInterface
|
class UserCreateWithList implements Operation\PostInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -20,6 +19,9 @@ class UserCreateWithList implements Operation\PostInterface
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
*/
|
*/
|
||||||
public function handlePost(ServerRequestInterface $request)
|
public function handlePost(ServerRequestInterface $request)
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,6 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class UserLogin implements Operation\GetInterface
|
class UserLogin implements Operation\GetInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -19,6 +18,10 @@ class UserLogin implements Operation\GetInterface
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function handleGet(ServerRequestInterface $request)
|
public function handleGet(ServerRequestInterface $request)
|
||||||
|
@ -10,7 +10,6 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class UserLogout implements Operation\GetInterface
|
class UserLogout implements Operation\GetInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -19,6 +18,9 @@ class UserLogout implements Operation\GetInterface
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
*/
|
*/
|
||||||
public function handleGet(ServerRequestInterface $request)
|
public function handleGet(ServerRequestInterface $request)
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,6 @@ use Articus\PathHandler\Attribute as PHAttribute;
|
|||||||
use Articus\PathHandler\Exception as PHException;
|
use Articus\PathHandler\Exception as PHException;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
|
||||||
class UserUsername implements Operation\DeleteInterface, Operation\GetInterface, Operation\PutInterface
|
class UserUsername implements Operation\DeleteInterface, Operation\GetInterface, Operation\PutInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -19,6 +18,9 @@ class UserUsername implements Operation\DeleteInterface, Operation\GetInterface,
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
*/
|
*/
|
||||||
public function handleDelete(ServerRequestInterface $request)
|
public function handleDelete(ServerRequestInterface $request)
|
||||||
{
|
{
|
||||||
@ -31,6 +33,10 @@ class UserUsername implements Operation\DeleteInterface, Operation\GetInterface,
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
|
*
|
||||||
* @return \App\DTO\User
|
* @return \App\DTO\User
|
||||||
*/
|
*/
|
||||||
public function handleGet(ServerRequestInterface $request)
|
public function handleGet(ServerRequestInterface $request)
|
||||||
@ -45,6 +51,9 @@ class UserUsername implements Operation\DeleteInterface, Operation\GetInterface,
|
|||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml")
|
||||||
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
* TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation
|
||||||
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
* @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/json")
|
||||||
|
* @param ServerRequestInterface $request
|
||||||
|
*
|
||||||
|
* @throws PHException\HttpCode 500 if the method is not implemented
|
||||||
*/
|
*/
|
||||||
public function handlePut(ServerRequestInterface $request)
|
public function handlePut(ServerRequestInterface $request)
|
||||||
{
|
{
|
||||||
|
@ -12,6 +12,10 @@ class Date extends DateTime
|
|||||||
*/
|
*/
|
||||||
protected function parseDateString($arrayValue)
|
protected function parseDateString($arrayValue)
|
||||||
{
|
{
|
||||||
return \DateTime::createFromFormat(static::DATE_TIME_FORMAT.' H:i:sP', $arrayValue.' 00:00:00+00:00', new \DateTimeZone('UTC'));
|
return \DateTime::createFromFormat(
|
||||||
|
static::DATE_TIME_FORMAT . ' H:i:sP',
|
||||||
|
$arrayValue . ' 00:00:00+00:00',
|
||||||
|
new \DateTimeZone('UTC')
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Strategy;
|
namespace App\Strategy;
|
||||||
|
|
||||||
use Articus\DataTransfer\Strategy\StrategyInterface;
|
use Articus\DataTransfer\Strategy\StrategyInterface;
|
||||||
|
|
||||||
class DateTime implements StrategyInterface
|
class DateTime implements StrategyInterface
|
||||||
{
|
{
|
||||||
const DATE_TIME_FORMAT = \DateTime::RFC3339;
|
const DATE_TIME_FORMAT = \DateTime::RFC3339;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
@ -41,4 +43,4 @@ class DateTime implements StrategyInterface
|
|||||||
{
|
{
|
||||||
return \DateTime::createFromFormat(static::DATE_TIME_FORMAT, $arrayValue, new \DateTimeZone('UTC'));
|
return \DateTime::createFromFormat(static::DATE_TIME_FORMAT, $arrayValue, new \DateTimeZone('UTC'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,4 +68,4 @@ class Type extends AbstractValidator
|
|||||||
throw new \InvalidArgumentException(sprintf('Can not check for type %s.', $this->type));
|
throw new \InvalidArgumentException(sprintf('Can not check for type %s.', $this->type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user