@@ -15,7 +15,7 @@ |
||
| 15 | 15 | |
| 16 | 16 | public function __construct(SerializerInterface $serializer) |
| 17 | 17 | { |
| 18 | - $this->serializer = $serializer; |
|
| 18 | + $this->serializer=$serializer; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
@@ -19,6 +19,6 @@ |
||
| 19 | 19 | |
| 20 | 20 | public function willReturn($command): void |
| 21 | 21 | { |
| 22 | - $this->toReturn = $command; |
|
| 22 | + $this->toReturn=$command; |
|
| 23 | 23 | } |
| 24 | 24 | } |
@@ -8,10 +8,10 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | class ExtractCommandFromRequestListener |
| 10 | 10 | { |
| 11 | - public const API_RESPONDER_CONTROLLER = 'eps.req2cmd.action.api_responder'; |
|
| 12 | - public const CMD_CLASS_PARAM = '_command_class'; |
|
| 13 | - public const CMD_PARAM = '_command'; |
|
| 14 | - private const CONTROLLER_PARAM = '_controller'; |
|
| 11 | + public const API_RESPONDER_CONTROLLER='eps.req2cmd.action.api_responder'; |
|
| 12 | + public const CMD_CLASS_PARAM='_command_class'; |
|
| 13 | + public const CMD_PARAM='_command'; |
|
| 14 | + private const CONTROLLER_PARAM='_controller'; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * @var CommandExtractorInterface |
@@ -20,18 +20,18 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | public function __construct(CommandExtractorInterface $extractor) |
| 22 | 22 | { |
| 23 | - $this->extractor = $extractor; |
|
| 23 | + $this->extractor=$extractor; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public function onKernelRequest(GetResponseEvent $event): void |
| 27 | 27 | { |
| 28 | - $request = $event->getRequest(); |
|
| 29 | - $commandClass = $request->attributes->get(self::CMD_CLASS_PARAM); |
|
| 28 | + $request=$event->getRequest(); |
|
| 29 | + $commandClass=$request->attributes->get(self::CMD_CLASS_PARAM); |
|
| 30 | 30 | if ($commandClass === null) { |
| 31 | 31 | return; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - $command = $this->extractor->extractFromRequest($request, $commandClass); |
|
| 34 | + $command=$this->extractor->extractFromRequest($request, $commandClass); |
|
| 35 | 35 | |
| 36 | 36 | $request->attributes->set(self::CMD_PARAM, $command); |
| 37 | 37 | $request->attributes->remove(self::CMD_CLASS_PARAM); |
@@ -11,15 +11,15 @@ |
||
| 11 | 11 | /** |
| 12 | 12 | * {@inheritdoc} |
| 13 | 13 | */ |
| 14 | - public function denormalize($data, $class, $format = null, array $context = []) |
|
| 14 | + public function denormalize($data, $class, $format=null, array $context=[]) |
|
| 15 | 15 | { |
| 16 | - return call_user_func($class . '::fromArray', $data); |
|
| 16 | + return call_user_func($class.'::fromArray', $data); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * {@inheritdoc} |
| 21 | 21 | */ |
| 22 | - public function supportsDenormalization($data, $type, $format = null): bool |
|
| 22 | + public function supportsDenormalization($data, $type, $format=null): bool |
|
| 23 | 23 | { |
| 24 | 24 | return is_subclass_of($type, DeserializableCommandInterface::class); |
| 25 | 25 | } |
@@ -16,12 +16,12 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | public function __construct(CommandBus $commandBus) |
| 18 | 18 | { |
| 19 | - $this->commandBus = $commandBus; |
|
| 19 | + $this->commandBus=$commandBus; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | public function __invoke(Request $request): Response |
| 23 | 23 | { |
| 24 | - $command = $request->attributes->get('_command'); |
|
| 24 | + $command=$request->attributes->get('_command'); |
|
| 25 | 25 | if ($command === null) { |
| 26 | 26 | throw new \InvalidArgumentException('No _command argument found for action'); |
| 27 | 27 | } |
@@ -34,16 +34,16 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | switch ($request->getMethod()) { |
| 36 | 36 | case Request::METHOD_PUT: |
| 37 | - $statusCode = Response::HTTP_OK; |
|
| 37 | + $statusCode=Response::HTTP_OK; |
|
| 38 | 38 | break; |
| 39 | 39 | case Request::METHOD_POST: |
| 40 | - $statusCode = Response::HTTP_CREATED; |
|
| 40 | + $statusCode=Response::HTTP_CREATED; |
|
| 41 | 41 | break; |
| 42 | 42 | case Request::METHOD_DELETE: |
| 43 | - $statusCode = Response::HTTP_NO_CONTENT; |
|
| 43 | + $statusCode=Response::HTTP_NO_CONTENT; |
|
| 44 | 44 | break; |
| 45 | 45 | default: |
| 46 | - $statusCode = Response::HTTP_OK; |
|
| 46 | + $statusCode=Response::HTTP_OK; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | return $statusCode; |
@@ -16,9 +16,9 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function load(array $configs, ContainerBuilder $container): void |
| 18 | 18 | { |
| 19 | - $loader = new XmlFileLoader( |
|
| 19 | + $loader=new XmlFileLoader( |
|
| 20 | 20 | $container, |
| 21 | - new FileLocator(__DIR__ . '/../Resources/config') |
|
| 21 | + new FileLocator(__DIR__.'/../Resources/config') |
|
| 22 | 22 | ); |
| 23 | 23 | |
| 24 | 24 | $loader->load('actions.xml'); |