@@ -16,15 +16,15 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public function __construct() |
18 | 18 | { |
19 | - $this->toReturnForArgs = []; |
|
19 | + $this->toReturnForArgs=[]; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
23 | 23 | * {@inheritdoc} |
24 | 24 | */ |
25 | - public function extractFromRequest(Request $request, string $commandClass, array $additionalProps = []) |
|
25 | + public function extractFromRequest(Request $request, string $commandClass, array $additionalProps=[]) |
|
26 | 26 | { |
27 | - $paramsHash = serialize([$request, $commandClass, $additionalProps]); |
|
27 | + $paramsHash=serialize([$request, $commandClass, $additionalProps]); |
|
28 | 28 | if (array_key_exists($paramsHash, $this->toReturnForArgs)) { |
29 | 29 | return $this->toReturnForArgs[$paramsHash]; |
30 | 30 | } |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | public function willReturn($command): self |
36 | 36 | { |
37 | 37 | if ($this->lastArgsHash !== null) { |
38 | - $this->toReturnForArgs[$this->lastArgsHash] = $command; |
|
38 | + $this->toReturnForArgs[$this->lastArgsHash]=$command; |
|
39 | 39 | return $this; |
40 | 40 | } |
41 | 41 | |
42 | - $this->toReturn = $command; |
|
42 | + $this->toReturn=$command; |
|
43 | 43 | |
44 | 44 | return $this; |
45 | 45 | } |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | return $this; |
50 | 50 | } |
51 | 51 | |
52 | - public function forArguments(Request $request, string $cmdClass, array $additionalProps = []): self |
|
52 | + public function forArguments(Request $request, string $cmdClass, array $additionalProps=[]): self |
|
53 | 53 | { |
54 | - $this->lastArgsHash = serialize([$request, $cmdClass, $additionalProps]); |
|
54 | + $this->lastArgsHash=serialize([$request, $cmdClass, $additionalProps]); |
|
55 | 55 | |
56 | 56 | return $this; |
57 | 57 | } |
@@ -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,27 +59,27 @@ discard block |
||
59 | 59 | |
60 | 60 | private function configureEventListeners(array $config, ContainerBuilder $container): void |
61 | 61 | { |
62 | - $listenersMap = [ |
|
62 | + $listenersMap=[ |
|
63 | 63 | 'extractor' => 'eps.req2cmd.listener.extract_command' |
64 | 64 | ]; |
65 | - foreach ((array)$config['listeners'] as $listenerName => $listenerConfig) { |
|
66 | - $listenerId = $listenersMap[$listenerName]; |
|
65 | + foreach ((array) $config['listeners'] as $listenerName => $listenerConfig) { |
|
66 | + $listenerId=$listenersMap[$listenerName]; |
|
67 | 67 | if (!$listenerConfig['enabled']) { |
68 | 68 | $container->removeDefinition($listenerId); |
69 | 69 | continue; |
70 | 70 | } |
71 | - $definition = $container->findDefinition($listenerId); |
|
72 | - $serviceTags = $definition->getTags(); |
|
71 | + $definition=$container->findDefinition($listenerId); |
|
72 | + $serviceTags=$definition->getTags(); |
|
73 | 73 | foreach ($serviceTags as $tagName => $tags) { |
74 | 74 | if ($tagName === 'kernel.event_listener') { |
75 | - $newTags = array_map( |
|
76 | - function ($tag) use ($listenerConfig) { |
|
77 | - $tag['priority'] = $listenerConfig['priority']; |
|
75 | + $newTags=array_map( |
|
76 | + function($tag) use ($listenerConfig) { |
|
77 | + $tag['priority']=$listenerConfig['priority']; |
|
78 | 78 | return $tag; |
79 | 79 | }, |
80 | 80 | $tags |
81 | 81 | ); |
82 | - $serviceTags[$tagName] = $newTags; |
|
82 | + $serviceTags[$tagName]=$newTags; |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 | $definition->setTags($serviceTags); |