@@ -37,16 +37,16 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | private function getDumper($value) |
| 39 | 39 | { |
| 40 | - if(is_object($value)) { |
|
| 40 | + if (is_object($value)) { |
|
| 41 | 41 | $class = get_class($value); |
| 42 | 42 | foreach (array_merge([$class], class_parents($class), class_implements($class)) as $class) { |
| 43 | - if(isset($this->_dumpers[$class])) { |
|
| 43 | + if (isset($this->_dumpers[$class])) { |
|
| 44 | 44 | return $this->_dumpers[$class]; |
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - if(isset($this->_dumpers[gettype($value)])) { |
|
| 49 | + if (isset($this->_dumpers[gettype($value)])) { |
|
| 50 | 50 | return $this->_dumpers[gettype($value)]; |
| 51 | 51 | } |
| 52 | 52 | |
@@ -72,9 +72,9 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | $console = Console::get(); |
| 74 | 74 | |
| 75 | - $result = $console->styled(['color' => 'yellow'], 'array').' with '.$console->styled(['color' => 'magenta'], count($array)).' elements:'.PHP_EOL; |
|
| 76 | - foreach($array as $key => $value) { |
|
| 77 | - $result .= "\t".str_replace("\n", "\n\t", '['.$this->dump($key).']: '.$this->dump($value)).PHP_EOL; |
|
| 75 | + $result = $console->styled(['color' => 'yellow'], 'array') . ' with ' . $console->styled(['color' => 'magenta'], count($array)) . ' elements:' . PHP_EOL; |
|
| 76 | + foreach ($array as $key => $value) { |
|
| 77 | + $result .= "\t" . str_replace("\n", "\n\t", '[' . $this->dump($key) . ']: ' . $this->dump($value)) . PHP_EOL; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | return $result; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | public function init() |
| 84 | 84 | { |
| 85 | - $this->register('array', [$this, '_dumpArray']); |
|
| 85 | + $this->register('array', [$this, '_dumpArray']); |
|
| 86 | 86 | $this->register('object', [$this, '_dumpObject']); |
| 87 | 87 | } |
| 88 | 88 | } |
@@ -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 | |
@@ -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 | |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | private function attributes(): array |
| 415 | 415 | { |
| 416 | 416 | $namespaces = $this->getNamespaces(false); |
| 417 | - $namespaces = array_map(function ($prefix, $uri) { |
|
| 417 | + $namespaces = array_map(function($prefix, $uri) { |
|
| 418 | 418 | return [$prefix ? "xmlns:{$prefix}" : 'xmlns', $uri]; |
| 419 | 419 | }, array_values($namespaces), array_keys($namespaces)); |
| 420 | 420 | |