@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | /** |
20 | 20 | * @var array |
21 | 21 | */ |
22 | - protected static $listArgumentForMethodCache = []; |
|
22 | + protected static $listArgumentForMethodCache = [ ]; |
|
23 | 23 | |
24 | 24 | /** |
25 | 25 | * @param callable $service |
@@ -54,17 +54,17 @@ discard block |
||
54 | 54 | $key = get_class($serviceObject) . '--' . $serviceMethod; |
55 | 55 | |
56 | 56 | if (array_key_exists($key, static::$listArgumentForMethodCache)) { |
57 | - return static::$listArgumentForMethodCache[$key]; |
|
57 | + return static::$listArgumentForMethodCache[ $key ]; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | $r = new ReflectionObject($serviceObject); |
61 | 61 | $rParameters = $r->getMethod($serviceMethod)->getParameters(); |
62 | 62 | |
63 | - $arguments = []; |
|
63 | + $arguments = [ ]; |
|
64 | 64 | foreach ($rParameters as $rParameter) { |
65 | 65 | $position = $rParameter->getPosition(); |
66 | 66 | |
67 | - $arguments[$position] = [ |
|
67 | + $arguments[ $position ] = [ |
|
68 | 68 | 'name' => $rParameter->getName(), |
69 | 69 | 'defaultValue' => $rParameter->isDefaultValueAvailable() ? $rParameter->getDefaultValue() : null |
70 | 70 | ]; |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | |
73 | 73 | ksort($arguments, SORT_NUMERIC); |
74 | 74 | |
75 | - $listArgument = []; |
|
75 | + $listArgument = [ ]; |
|
76 | 76 | foreach ($arguments as $argument) { |
77 | - $listArgument[$argument['name']] = $argument['defaultValue']; |
|
77 | + $listArgument[ $argument[ 'name' ] ] = $argument[ 'defaultValue' ]; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | return $listArgument; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @throws Exception\FunctionArgumentNotFoundException |
95 | 95 | * @throws Exception\ArgumentNotFoundInTransientVarsException |
96 | 96 | */ |
97 | - public function buildArgumentsForService(callable $service, MetadataInterface $metadata, TransientVarsInterface $transientVars, array $args = []) |
|
97 | + public function buildArgumentsForService(callable $service, MetadataInterface $metadata, TransientVarsInterface $transientVars, array $args = [ ]) |
|
98 | 98 | { |
99 | 99 | $listArgument = $this->getListArgumentForService($service); |
100 | 100 | |
@@ -110,14 +110,14 @@ discard block |
||
110 | 110 | // } |
111 | 111 | |
112 | 112 | |
113 | - $arguments = []; |
|
113 | + $arguments = [ ]; |
|
114 | 114 | foreach ($listArgument as $name => $defaultValue) { |
115 | 115 | if (array_key_exists($name, $args)) { |
116 | - $arguments[$name] = $args[$name]; |
|
116 | + $arguments[ $name ] = $args[ $name ]; |
|
117 | 117 | continue; |
118 | 118 | } |
119 | 119 | |
120 | - $arguments[$name] = $defaultValue; |
|
120 | + $arguments[ $name ] = $defaultValue; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | return $arguments; |
@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | * |
39 | 39 | * @var array |
40 | 40 | */ |
41 | - protected $resultMap = []; |
|
41 | + protected $resultMap = [ ]; |
|
42 | 42 | |
43 | 43 | /** |
44 | 44 | * Хеши обеспечивающие уникальность данных используемых для маппинга результатов работы сервиса |
45 | 45 | * |
46 | 46 | * @var array |
47 | 47 | */ |
48 | - protected $resultMapHash = []; |
|
48 | + protected $resultMapHash = [ ]; |
|
49 | 49 | |
50 | 50 | /** |
51 | 51 | * Имя переменной в transientVars, в которую нужно сохранить результаты сервиса |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function setResultVariableName($resultVariableName) |
68 | 68 | { |
69 | - $this->resultVariableName = (string)$resultVariableName; |
|
69 | + $this->resultVariableName = (string) $resultVariableName; |
|
70 | 70 | |
71 | 71 | return $this; |
72 | 72 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function setAllowOverrideResult($allowOverrideResult) |
92 | 92 | { |
93 | - $this->allowOverrideResult = (boolean)$allowOverrideResult; |
|
93 | + $this->allowOverrideResult = (boolean) $allowOverrideResult; |
|
94 | 94 | |
95 | 95 | return $this; |
96 | 96 | } |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | } |
124 | 124 | |
125 | 125 | |
126 | - $this->resultMap[$item->getFrom()] = $item; |
|
127 | - $this->resultMapHash[$key] = $key; |
|
126 | + $this->resultMap[ $item->getFrom() ] = $item; |
|
127 | + $this->resultMapHash[ $key ] = $key; |
|
128 | 128 | $this->flagUseResultMap = true; |
129 | 129 | |
130 | 130 | return $this; |
@@ -158,6 +158,6 @@ discard block |
||
158 | 158 | $errMsg = sprintf('Map for key %s not found', $from); |
159 | 159 | throw new Exception\InvalidResultMapException($errMsg); |
160 | 160 | } |
161 | - return $this->resultMap[$from]; |
|
161 | + return $this->resultMap[ $from ]; |
|
162 | 162 | } |
163 | 163 | } |