@@ -14,6 +14,7 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @param DataEnricher $invoker |
16 | 16 | * @param string $property Property key which should trigger the processor |
17 | + * @return void |
|
17 | 18 | */ |
18 | 19 | public function __construct(DataEnricher $invoker, $property); |
19 | 20 | |
@@ -28,6 +29,7 @@ discard block |
||
28 | 29 | * Apply processing to nodes |
29 | 30 | * |
30 | 31 | * @param Node[] $nodes |
32 | + * @return void |
|
31 | 33 | */ |
32 | 34 | public function applyTo(array $nodes); |
33 | 35 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | foreach ($merge as $object) { |
57 | 57 | foreach ($object as $key => $value) { |
58 | - $value->$key = $value; |
|
58 | + $value->$key = $value; |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 |
@@ -53,7 +53,7 @@ |
||
53 | 53 | { |
54 | 54 | $value = (object)[]; |
55 | 55 | |
56 | - foreach ($merge as $object) { |
|
56 | + foreach ($merge as $object) { |
|
57 | 57 | foreach ($object as $key => $value) { |
58 | 58 | $value->$key = $value; |
59 | 59 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public function __construct($source) |
46 | 46 | { |
47 | 47 | if (!is_object($source)) { |
48 | - throw new \Exception("Data enricher on works on an object, not on a " . gettype($source)); |
|
48 | + throw new \Exception("Data enricher on works on an object, not on a ".gettype($source)); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | $this->source = $source; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | protected function hasProcessorProperty($value) |
125 | 125 | { |
126 | - $processorProps = array_map(function ($processor) { |
|
126 | + $processorProps = array_map(function($processor) { |
|
127 | 127 | return $processor->getProperty(); |
128 | 128 | }, $this->processors); |
129 | 129 |
@@ -137,7 +137,6 @@ |
||
137 | 137 | * Check if object has at leas one process property |
138 | 138 | * |
139 | 139 | * @param \stdClass $value |
140 | - * @param Processor[] $processors |
|
141 | 140 | * @return boolean |
142 | 141 | */ |
143 | 142 | protected function hasProcessorProperty($value) |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | $url = $node->getInstruction($this); |
26 | 26 | |
27 | - $type = (is_object($url) ? get_class($url) . ' ' : '') . gettype($url); |
|
27 | + $type = (is_object($url) ? get_class($url).' ' : '').gettype($url); |
|
28 | 28 | if (!assert(is_string($url), "Expected '{$this->property}' to be a string, but got a $type")) { |
29 | 29 | return null; |
30 | 30 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | $client = new Client(['http_errors' => false]); |
48 | - $promise = $client->getAsync($url)->then(function (Response $response) use ($node) { |
|
48 | + $promise = $client->getAsync($url)->then(function(Response $response) use ($node) { |
|
49 | 49 | $this->applyResult($node, $response); |
50 | 50 | }); |
51 | 51 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $target = $target->getResult(); |
47 | 47 | $this->applyNodeResults($target); |
48 | 48 | } elseif (is_array($target) || is_object($target)) { |
49 | - foreach ($target as &$value) { |
|
49 | + foreach ($target as &$value) { |
|
50 | 50 | $this->applyNodeResults($value); |
51 | 51 | } |
52 | 52 | } |