@@ -8,15 +8,15 @@ discard block |
||
8 | 8 | |
9 | 9 | class PathParamsMapper implements ParamMapperInterface |
10 | 10 | { |
11 | - private const REQUIRED_PROPERTY_PREFIX = '!'; |
|
11 | + private const REQUIRED_PROPERTY_PREFIX='!'; |
|
12 | 12 | |
13 | 13 | public function map(Request $request, array $propsMap): array |
14 | 14 | { |
15 | - $pathProps = $propsMap['path'] ?? []; |
|
16 | - $result = []; |
|
15 | + $pathProps=$propsMap['path'] ?? []; |
|
16 | + $result=[]; |
|
17 | 17 | foreach ($pathProps as $paramName => $paramValue) { |
18 | 18 | if ($this->isParamRequired($paramName)) { |
19 | - $paramName = substr($paramName, 1); |
|
19 | + $paramName=substr($paramName, 1); |
|
20 | 20 | $this->assertRequiredParamIsPresent($paramName, $request); |
21 | 21 | } |
22 | 22 | |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | continue; |
25 | 25 | } |
26 | 26 | |
27 | - $finalPropName = $paramValue ?? $paramName; |
|
28 | - $result[$finalPropName] = $request->attributes->get($paramName); |
|
27 | + $finalPropName=$paramValue ?? $paramName; |
|
28 | + $result[$finalPropName]=$request->attributes->get($paramName); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | return $result; |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | |
10 | 10 | final class ParamMapperPass implements CompilerPassInterface |
11 | 11 | { |
12 | - public const COLLECTOR_SVC_ID = 'eps.req2cmd.collector.param_collector'; |
|
13 | - public const MAPPER_TAG = 'req2cmd.param_mapper'; |
|
12 | + public const COLLECTOR_SVC_ID='eps.req2cmd.collector.param_collector'; |
|
13 | + public const MAPPER_TAG='req2cmd.param_mapper'; |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * {@inheritdoc} |
@@ -21,25 +21,25 @@ discard block |
||
21 | 21 | return; |
22 | 22 | } |
23 | 23 | |
24 | - $collector = $container->findDefinition(self::COLLECTOR_SVC_ID); |
|
25 | - $mappersDefinitions = $container->findTaggedServiceIds(self::MAPPER_TAG); |
|
26 | - $mappers = $this->collectMappers($mappersDefinitions); |
|
24 | + $collector=$container->findDefinition(self::COLLECTOR_SVC_ID); |
|
25 | + $mappersDefinitions=$container->findTaggedServiceIds(self::MAPPER_TAG); |
|
26 | + $mappers=$this->collectMappers($mappersDefinitions); |
|
27 | 27 | |
28 | 28 | $collector->replaceArgument(0, $mappers); |
29 | 29 | } |
30 | 30 | |
31 | 31 | private function collectMappers(array $mappersDefinitions): array |
32 | 32 | { |
33 | - $queue = new \SplPriorityQueue(); |
|
33 | + $queue=new \SplPriorityQueue(); |
|
34 | 34 | |
35 | 35 | foreach ($mappersDefinitions as $mapperId => $mapperTags) { |
36 | - $tagAttributes = $mapperTags[0]; |
|
37 | - $priority = $tagAttributes['priority'] ?? 0; |
|
36 | + $tagAttributes=$mapperTags[0]; |
|
37 | + $priority=$tagAttributes['priority'] ?? 0; |
|
38 | 38 | $queue->insert($mapperId, $priority); |
39 | 39 | } |
40 | 40 | |
41 | 41 | return array_map( |
42 | - function ($mapperId) { |
|
42 | + function($mapperId) { |
|
43 | 43 | return new Reference($mapperId); |
44 | 44 | }, |
45 | 45 | iterator_to_array($queue, false) |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | */ |
18 | 18 | public function load(array $configs, ContainerBuilder $container): void |
19 | 19 | { |
20 | - $configuration = new Req2CmdConfiguration(); |
|
21 | - $config = $this->processConfiguration($configuration, $configs); |
|
20 | + $configuration=new Req2CmdConfiguration(); |
|
21 | + $config=$this->processConfiguration($configuration, $configs); |
|
22 | 22 | |
23 | - $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
23 | + $loader=new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
24 | 24 | |
25 | 25 | $loader->load('actions.xml'); |
26 | 26 | $loader->load('extractors.xml'); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | private function configureExtractors(array $config, ContainerBuilder $container): void |
43 | 43 | { |
44 | - $extractorId = (string)$config['extractor']['service_id']; |
|
44 | + $extractorId=(string) $config['extractor']['service_id']; |
|
45 | 45 | $container->setAlias('eps.req2cmd.extractor', $extractorId); |
46 | 46 | |
47 | 47 | if (!$config['extractor']['use_cmd_denormalizer']) { |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | |
52 | 52 | private function configureCommandBus(array $config, ContainerBuilder $container): void |
53 | 53 | { |
54 | - $commandBusId = (string)$config['command_bus']['service_id']; |
|
54 | + $commandBusId=(string) $config['command_bus']['service_id']; |
|
55 | 55 | if ($commandBusId === 'eps.req2cmd.command_bus.tactician') { |
56 | - $busName = (string)$config['command_bus']['name']; |
|
57 | - $tacticianServiceName = 'tactician.commandbus.' . $busName; |
|
58 | - $busDefinition = $container->findDefinition('eps.req2cmd.command_bus.tactician'); |
|
56 | + $busName=(string) $config['command_bus']['name']; |
|
57 | + $tacticianServiceName='tactician.commandbus.'.$busName; |
|
58 | + $busDefinition=$container->findDefinition('eps.req2cmd.command_bus.tactician'); |
|
59 | 59 | $busDefinition->replaceArgument(0, new Reference($tacticianServiceName)); |
60 | 60 | } |
61 | 61 | |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | |
65 | 65 | private function configureEventListeners(array $config, ContainerBuilder $container): void |
66 | 66 | { |
67 | - foreach ((array)$config['listeners'] as $listenerName => $listenerConfig) { |
|
68 | - $listenerId = $this->getListenerSvcIdByAlias($listenerName); |
|
67 | + foreach ((array) $config['listeners'] as $listenerName => $listenerConfig) { |
|
68 | + $listenerId=$this->getListenerSvcIdByAlias($listenerName); |
|
69 | 69 | |
70 | 70 | if (!$listenerConfig['enabled']) { |
71 | 71 | $container->removeDefinition($listenerId); |
@@ -78,13 +78,13 @@ discard block |
||
78 | 78 | |
79 | 79 | private function configureEventListener(ContainerBuilder $container, string $listenerId, array $listenerCfg): void |
80 | 80 | { |
81 | - $definition = $container->findDefinition($listenerId); |
|
82 | - $serviceTags = $definition->getTags(); |
|
81 | + $definition=$container->findDefinition($listenerId); |
|
82 | + $serviceTags=$definition->getTags(); |
|
83 | 83 | |
84 | 84 | array_walk( |
85 | 85 | $serviceTags['kernel.event_listener'], |
86 | - function (&$tag) use ($listenerCfg) { |
|
87 | - $tag['priority'] = $listenerCfg['priority']; |
|
86 | + function(&$tag) use ($listenerCfg) { |
|
87 | + $tag['priority']=$listenerCfg['priority']; |
|
88 | 88 | } |
89 | 89 | ); |
90 | 90 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | private function getListenerSvcIdByAlias(string $alias): string |
95 | 95 | { |
96 | - $listenersMap = [ |
|
96 | + $listenersMap=[ |
|
97 | 97 | 'extractor' => 'eps.req2cmd.listener.extract_command' |
98 | 98 | ]; |
99 | 99 |
@@ -21,26 +21,26 @@ |
||
21 | 21 | |
22 | 22 | public function __construct(SerializerInterface $jmsSerializer, ArrayTransformerInterface $jmsArrayTransformer) |
23 | 23 | { |
24 | - $this->jmsSerializer = $jmsSerializer; |
|
25 | - $this->jmsArrayTransformer = $jmsArrayTransformer; |
|
24 | + $this->jmsSerializer=$jmsSerializer; |
|
25 | + $this->jmsArrayTransformer=$jmsArrayTransformer; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
29 | 29 | * {@inheritdoc} |
30 | 30 | * @throws \LogicException |
31 | 31 | */ |
32 | - public function extractFromRequest(Request $request, string $commandClass, array $additionalProps = []) |
|
32 | + public function extractFromRequest(Request $request, string $commandClass, array $additionalProps=[]) |
|
33 | 33 | { |
34 | 34 | if (empty($request->getContent())) { |
35 | 35 | return $this->jmsArrayTransformer->fromArray($additionalProps, $commandClass); |
36 | 36 | } |
37 | 37 | |
38 | - $decodedContent = $this->jmsSerializer->deserialize( |
|
38 | + $decodedContent=$this->jmsSerializer->deserialize( |
|
39 | 39 | $request->getContent(), |
40 | 40 | 'array', |
41 | 41 | $request->getRequestFormat() |
42 | 42 | ); |
43 | - $finalProps = array_merge($decodedContent, $additionalProps); |
|
43 | + $finalProps=array_merge($decodedContent, $additionalProps); |
|
44 | 44 | |
45 | 45 | return $this->jmsArrayTransformer->fromArray($finalProps, $commandClass); |
46 | 46 | } |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | DecoderInterface $decoder, |
37 | 37 | DenormalizerInterface $denormalizer |
38 | 38 | ) { |
39 | - $this->serializer = $serializer; |
|
40 | - $this->decoder = $decoder; |
|
41 | - $this->denormalizer = $denormalizer; |
|
39 | + $this->serializer=$serializer; |
|
40 | + $this->decoder=$decoder; |
|
41 | + $this->denormalizer=$denormalizer; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -46,17 +46,17 @@ discard block |
||
46 | 46 | * @throws \LogicException |
47 | 47 | * @throws \Symfony\Component\Serializer\Exception\UnexpectedValueException |
48 | 48 | */ |
49 | - public function extractFromRequest(Request $request, string $commandClass, array $additionalProps = []) |
|
49 | + public function extractFromRequest(Request $request, string $commandClass, array $additionalProps=[]) |
|
50 | 50 | { |
51 | - $requestContent = $request->getContent(); |
|
52 | - $requestFormat = $request->getRequestFormat(); |
|
51 | + $requestContent=$request->getContent(); |
|
52 | + $requestFormat=$request->getRequestFormat(); |
|
53 | 53 | |
54 | 54 | if (empty($requestContent)) { |
55 | 55 | return $this->denormalizer->denormalize($additionalProps, $commandClass, $requestFormat); |
56 | 56 | } |
57 | 57 | |
58 | - $decodedContent = $this->decoder->decode($requestContent, $requestFormat); |
|
59 | - $finalProps = array_merge($decodedContent, $additionalProps); |
|
58 | + $decodedContent=$this->decoder->decode($requestContent, $requestFormat); |
|
59 | + $finalProps=array_merge($decodedContent, $additionalProps); |
|
60 | 60 | |
61 | 61 | return $this->denormalizer->denormalize($finalProps, $commandClass, $requestFormat); |
62 | 62 | } |