@@ -54,7 +54,7 @@ |
||
| 54 | 54 | continue; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - $this->_results = array_merge($this->_results, array_map(function ($record) { |
|
| 57 | + $this->_results = array_merge($this->_results, array_map(function($record) { |
|
| 58 | 58 | return [$record['target'], $record['port']]; |
| 59 | 59 | }, $result)); |
| 60 | 60 | } |
@@ -24,10 +24,10 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | function typeof($value) : string |
| 26 | 26 | { |
| 27 | - if(is_object($value)) { |
|
| 28 | - return "object of type ".get_class($value); |
|
| 29 | - } elseif(is_resource($value)) { |
|
| 30 | - return get_resource_type($value).' resource'; |
|
| 27 | + if (is_object($value)) { |
|
| 28 | + return "object of type " . get_class($value); |
|
| 29 | + } elseif (is_resource($value)) { |
|
| 30 | + return get_resource_type($value) . ' resource'; |
|
| 31 | 31 | } else { |
| 32 | 32 | return gettype($value); |
| 33 | 33 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | return function(...$arguments) use ($callable, $argument, $position) { |
| 39 | 39 | $arguments = array_merge( |
| 40 | 40 | array_slice($arguments, 0, $position), |
| 41 | - [ $argument ], |
|
| 41 | + [$argument], |
|
| 42 | 42 | array_slice($arguments, $position) |
| 43 | 43 | ); |
| 44 | 44 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | function dd($value) |
| 50 | 50 | { |
| 51 | - echo Dumper::get()->dump($value).PHP_EOL.PHP_EOL; |
|
| 51 | + echo Dumper::get()->dump($value) . PHP_EOL . PHP_EOL; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | function format($string, array $arguments = []) |
@@ -106,7 +106,7 @@ |
||
| 106 | 106 | |
| 107 | 107 | protected function handleFeatures(Features $element) |
| 108 | 108 | { |
| 109 | - if(!parent::handleFeatures($element)) { |
|
| 109 | + if (!parent::handleFeatures($element)) { |
|
| 110 | 110 | return false; |
| 111 | 111 | } |
| 112 | 112 | |
@@ -71,13 +71,13 @@ discard block |
||
| 71 | 71 | xml_parser_set_option($this->_parser, XML_OPTION_SKIP_WHITE, 1); |
| 72 | 72 | xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, 0); |
| 73 | 73 | |
| 74 | - xml_set_element_handler($this->_parser, function ($parser, $name, $attrs) { |
|
| 74 | + xml_set_element_handler($this->_parser, function($parser, $name, $attrs) { |
|
| 75 | 75 | $this->handleElementStart($name, $attrs); |
| 76 | - }, function () { |
|
| 76 | + }, function() { |
|
| 77 | 77 | $this->handleElementEnd(); |
| 78 | 78 | }); |
| 79 | 79 | |
| 80 | - xml_set_character_data_handler($this->_parser, function ($parser, $data) { |
|
| 80 | + xml_set_character_data_handler($this->_parser, function($parser, $data) { |
|
| 81 | 81 | $this->handleTextData($data); |
| 82 | 82 | }); |
| 83 | 83 | |
@@ -119,10 +119,10 @@ discard block |
||
| 119 | 119 | list($attributes, $namespaces) = $this->_attributes($attrs); |
| 120 | 120 | list($tag, $prefix) = XmlElement::resolve($name); |
| 121 | 121 | |
| 122 | - $uri = $this->_lookup($prefix, $namespaces); |
|
| 122 | + $uri = $this->_lookup($prefix, $namespaces); |
|
| 123 | 123 | |
| 124 | 124 | /** @var XmlElement $element */ |
| 125 | - $element = $this->factory->create($uri, $tag, [ $name, $uri ]); |
|
| 125 | + $element = $this->factory->create($uri, $tag, [$name, $uri]); |
|
| 126 | 126 | foreach ($attributes as $name => $value) { |
| 127 | 127 | $element->setAttribute($name, $value); |
| 128 | 128 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | if (count($this->_stack) > 1) { |
| 138 | 138 | end($this->_stack)->append($element); |
| 139 | 139 | } |
| 140 | - $this->emit('parse.begin', [ $element ]); |
|
| 140 | + $this->emit('parse.begin', [$element]); |
|
| 141 | 141 | |
| 142 | 142 | $this->_stack[] = $element; |
| 143 | 143 | } |
@@ -150,10 +150,10 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | $element = array_pop($this->_stack); |
| 152 | 152 | if (count($this->_stack) == 1) { |
| 153 | - $this->emit('element', [ $element ]); |
|
| 153 | + $this->emit('element', [$element]); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - $this->emit('parse.end', [ $element ]); |
|
| 156 | + $this->emit('parse.end', [$element]); |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | private function handleTextData($data) |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function getInnerXml() |
| 129 | 129 | { |
| 130 | - return implode('', array_map(function ($element) { |
|
| 130 | + return implode('', array_map(function($element) { |
|
| 131 | 131 | if (is_string($element)) { |
| 132 | 132 | return htmlspecialchars($element); |
| 133 | 133 | } elseif ($element instanceof XmlElement) { |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $attributes = $this->attributes(); |
| 155 | 155 | |
| 156 | 156 | $result = "<{$this->name}"; |
| 157 | - $result .= ' ' . implode(' ', array_map(function ($key, $value) { |
|
| 157 | + $result .= ' ' . implode(' ', array_map(function($key, $value) { |
|
| 158 | 158 | return $key . '="' . htmlspecialchars($value, ENT_QUOTES) . '"'; |
| 159 | 159 | }, array_keys($attributes), array_values($attributes))); |
| 160 | 160 | |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | private function attributes(): array |
| 420 | 420 | { |
| 421 | 421 | $namespaces = $this->getNamespaces(false); |
| 422 | - $namespaces = array_map(function ($prefix, $uri) { |
|
| 422 | + $namespaces = array_map(function($prefix, $uri) { |
|
| 423 | 423 | return [$prefix ? "xmlns:{$prefix}" : 'xmlns', $uri]; |
| 424 | 424 | }, array_values($namespaces), array_keys($namespaces)); |
| 425 | 425 | |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | */ |
| 440 | 440 | protected function _prefix(string $name, string $uri = null): string |
| 441 | 441 | { |
| 442 | - if($uri === null) { |
|
| 442 | + if ($uri === null) { |
|
| 443 | 443 | return $name; |
| 444 | 444 | } |
| 445 | 445 | |