@@ -13,5 +13,5 @@ |
||
13 | 13 | * @param array $additionalProps |
14 | 14 | * @return mixed |
15 | 15 | */ |
16 | - public function extractFromRequest(Request $request, string $commandClass, array $additionalProps = []); |
|
16 | + public function extractFromRequest(Request $request, string $commandClass, array $additionalProps=[]); |
|
17 | 17 | } |
@@ -21,23 +21,23 @@ |
||
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($additionalProps)) { |
35 | - $decodedContent = $this->jmsSerializer->deserialize( |
|
35 | + $decodedContent=$this->jmsSerializer->deserialize( |
|
36 | 36 | $request->getContent(), |
37 | 37 | 'array', |
38 | 38 | $request->getRequestFormat() |
39 | 39 | ); |
40 | - $finalProps = array_merge($decodedContent, $additionalProps); |
|
40 | + $finalProps=array_merge($decodedContent, $additionalProps); |
|
41 | 41 | return $this->jmsArrayTransformer->fromArray($finalProps, $commandClass); |
42 | 42 | } |
43 | 43 |
@@ -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'); |
@@ -40,17 +40,17 @@ discard block |
||
40 | 40 | |
41 | 41 | private function configureExtractors(array $config, ContainerBuilder $container): void |
42 | 42 | { |
43 | - $extractorId = (string)$config['extractor']['service_id']; |
|
43 | + $extractorId=(string) $config['extractor']['service_id']; |
|
44 | 44 | $container->setAlias('eps.req2cmd.extractor', $extractorId); |
45 | 45 | } |
46 | 46 | |
47 | 47 | private function configureCommandBus(array $config, ContainerBuilder $container): void |
48 | 48 | { |
49 | - $commandBusId = (string)$config['command_bus']['service_id']; |
|
49 | + $commandBusId=(string) $config['command_bus']['service_id']; |
|
50 | 50 | if ($commandBusId === 'eps.req2cmd.command_bus.tactician') { |
51 | - $busName = (string)$config['command_bus']['name']; |
|
52 | - $tacticianServiceName = 'tactician.commandbus.' . $busName; |
|
53 | - $busDefinition = $container->findDefinition('eps.req2cmd.command_bus.tactician'); |
|
51 | + $busName=(string) $config['command_bus']['name']; |
|
52 | + $tacticianServiceName='tactician.commandbus.'.$busName; |
|
53 | + $busDefinition=$container->findDefinition('eps.req2cmd.command_bus.tactician'); |
|
54 | 54 | $busDefinition->replaceArgument(0, new Reference($tacticianServiceName)); |
55 | 55 | } |
56 | 56 | |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | |
60 | 60 | private function configureEventListeners(array $config, ContainerBuilder $container): void |
61 | 61 | { |
62 | - foreach ((array)$config['listeners'] as $listenerName => $listenerConfig) { |
|
63 | - $listenerId = $this->getListenerSvcIdByAlias($listenerName); |
|
62 | + foreach ((array) $config['listeners'] as $listenerName => $listenerConfig) { |
|
63 | + $listenerId=$this->getListenerSvcIdByAlias($listenerName); |
|
64 | 64 | |
65 | 65 | if (!$listenerConfig['enabled']) { |
66 | 66 | $container->removeDefinition($listenerId); |
@@ -73,13 +73,13 @@ discard block |
||
73 | 73 | |
74 | 74 | private function configureEventListener(ContainerBuilder $container, string $listenerId, array $listenerCfg): void |
75 | 75 | { |
76 | - $definition = $container->findDefinition($listenerId); |
|
77 | - $serviceTags = $definition->getTags(); |
|
76 | + $definition=$container->findDefinition($listenerId); |
|
77 | + $serviceTags=$definition->getTags(); |
|
78 | 78 | |
79 | 79 | array_walk( |
80 | 80 | $serviceTags['kernel.event_listener'], |
81 | - function (&$tag) use ($listenerCfg) { |
|
82 | - $tag['priority'] = $listenerCfg['priority']; |
|
81 | + function(&$tag) use ($listenerCfg) { |
|
82 | + $tag['priority']=$listenerCfg['priority']; |
|
83 | 83 | } |
84 | 84 | ); |
85 | 85 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | private function getListenerSvcIdByAlias(string $alias): string |
90 | 90 | { |
91 | - $listenersMap = [ |
|
91 | + $listenersMap=[ |
|
92 | 92 | 'extractor' => 'eps.req2cmd.listener.extract_command' |
93 | 93 | ]; |
94 | 94 |
@@ -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) |