@@ -139,11 +139,11 @@ discard block |
||
139 | 139 | if (is_string($value)) { |
140 | 140 | // Match for most non printable chars somewhat taking multibyte chars into account |
141 | 141 | if (preg_match('/[^\x09-\x0d\x20-\xff]/', $value)) { |
142 | - return 'Binary String: 0x' . bin2hex($value); |
|
142 | + return 'Binary String: 0x'.bin2hex($value); |
|
143 | 143 | } |
144 | 144 | |
145 | - return "'" . |
|
146 | - str_replace(array("\r\n", "\n\r", "\r"), array("\n", "\n", "\n"), $value) . |
|
145 | + return "'". |
|
146 | + str_replace(array("\r\n", "\n\r", "\r"), array("\n", "\n", "\n"), $value). |
|
147 | 147 | "'"; |
148 | 148 | } |
149 | 149 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | if (is_array($value)) { |
157 | 157 | if (($key = $processed->contains($value)) !== false) { |
158 | - return 'Array &' . $key; |
|
158 | + return 'Array &'.$key; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | $array = $value; |
@@ -165,14 +165,14 @@ discard block |
||
165 | 165 | if (count($array) > 0) { |
166 | 166 | foreach ($array as $k => $v) { |
167 | 167 | $values .= sprintf( |
168 | - '%s %s => %s' . "\n", |
|
168 | + '%s %s => %s'."\n", |
|
169 | 169 | $whitespace, |
170 | 170 | self::recursiveExport($k, $indentation), |
171 | 171 | self::recursiveExport($value[$k], $indentation + 1, $processed) |
172 | 172 | ); |
173 | 173 | } |
174 | 174 | |
175 | - $values = "\n" . $values . $whitespace; |
|
175 | + $values = "\n".$values.$whitespace; |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | return sprintf('Array &%s (%s)', $key, $values); |
@@ -194,14 +194,14 @@ discard block |
||
194 | 194 | if (count($array) > 0) { |
195 | 195 | foreach ($array as $k => $v) { |
196 | 196 | $values .= sprintf( |
197 | - '%s %s => %s' . "\n", |
|
197 | + '%s %s => %s'."\n", |
|
198 | 198 | $whitespace, |
199 | 199 | self::recursiveExport($k, $indentation), |
200 | 200 | self::recursiveExport($v, $indentation + 1, $processed) |
201 | 201 | ); |
202 | 202 | } |
203 | 203 | |
204 | - $values = "\n" . $values . $whitespace; |
|
204 | + $values = "\n".$values.$whitespace; |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | return sprintf('%s:%s Object (%s)', $class, $hash, $values); |
@@ -58,9 +58,9 @@ |
||
58 | 58 | return false; |
59 | 59 | } |
60 | 60 | |
61 | - $keyScores = array_map(array($this->key,'scoreArgument'), array_keys($argument)); |
|
62 | - $valueScores = array_map(array($this->value,'scoreArgument'), $argument); |
|
63 | - $scoreEntry = function ($value, $key) { |
|
61 | + $keyScores = array_map(array($this->key, 'scoreArgument'), array_keys($argument)); |
|
62 | + $valueScores = array_map(array($this->value, 'scoreArgument'), $argument); |
|
63 | + $scoreEntry = function($value, $key) { |
|
64 | 64 | return $value && $key ? min(8, ($key + $value) / 2) : false; |
65 | 65 | }; |
66 | 66 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | public function __construct($value) |
28 | 28 | { |
29 | - $this->token = $value instanceof TokenInterface? $value : new ExactValueToken($value); |
|
29 | + $this->token = $value instanceof TokenInterface ? $value : new ExactValueToken($value); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -83,7 +83,7 @@ |
||
83 | 83 | public function __toString() |
84 | 84 | { |
85 | 85 | if (null === $this->string) { |
86 | - $this->string = implode(', ', array_map(function ($token) { |
|
86 | + $this->string = implode(', ', array_map(function($token) { |
|
87 | 87 | return (string) $token; |
88 | 88 | }, $this->tokens)); |
89 | 89 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | $code = sprintf("class %s extends \%s implements %s {\n", |
37 | 37 | $classname, $class->getParentClass(), implode(', ', |
38 | - array_map(function ($interface) {return '\\'.$interface;}, $class->getInterfaces()) |
|
38 | + array_map(function($interface) {return '\\'.$interface; }, $class->getInterfaces()) |
|
39 | 39 | ) |
40 | 40 | ); |
41 | 41 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $php = sprintf("%s %s function %s%s(%s)%s {\n", |
58 | 58 | $method->getVisibility(), |
59 | 59 | $method->isStatic() ? 'static' : '', |
60 | - $method->returnsReference() ? '&':'', |
|
60 | + $method->returnsReference() ? '&' : '', |
|
61 | 61 | $method->getName(), |
62 | 62 | implode(', ', $this->generateArguments($method->getArguments())), |
63 | 63 | $this->getReturnType($method) |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | private function generateArguments(array $arguments) |
93 | 93 | { |
94 | - return array_map(function (Node\ArgumentNode $argument) { |
|
94 | + return array_map(function(Node\ArgumentNode $argument) { |
|
95 | 95 | $php = ''; |
96 | 96 | |
97 | 97 | if (version_compare(PHP_VERSION, '7.1', '>=')) { |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * @var MethodNode[] |
31 | 31 | */ |
32 | - private $methods = array(); |
|
32 | + private $methods = array(); |
|
33 | 33 | |
34 | 34 | public function getParentClass() |
35 | 35 | { |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | public function addMethod(MethodNode $method) |
104 | 104 | { |
105 | - if (!$this->isExtendable($method->getName())){ |
|
105 | + if (!$this->isExtendable($method->getName())) { |
|
106 | 106 | $message = sprintf( |
107 | 107 | 'Method `%s` is not extendable, so can not be added.', $method->getName() |
108 | 108 | ); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function addUnextendableMethod($unextendableMethod) |
151 | 151 | { |
152 | - if (!$this->isExtendable($unextendableMethod)){ |
|
152 | + if (!$this->isExtendable($unextendableMethod)) { |
|
153 | 153 | return; |
154 | 154 | } |
155 | 155 | $this->unextendableMethods[] = $unextendableMethod; |
@@ -142,7 +142,7 @@ |
||
142 | 142 | break; |
143 | 143 | |
144 | 144 | default: |
145 | - $this->returnType = '\\' . ltrim($type, '\\'); |
|
145 | + $this->returnType = '\\'.ltrim($type, '\\'); |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | public function __construct(ClassMirror $mirror = null, ClassCreator $creator = null, |
51 | 51 | NameGenerator $namer = null) |
52 | 52 | { |
53 | - $this->mirror = $mirror ?: new ClassMirror; |
|
53 | + $this->mirror = $mirror ?: new ClassMirror; |
|
54 | 54 | $this->creator = $creator ?: new ClassCreator; |
55 | - $this->namer = $namer ?: new NameGenerator; |
|
55 | + $this->namer = $namer ?: new NameGenerator; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | $this->patches[] = $patch; |
76 | 76 | |
77 | - @usort($this->patches, function (ClassPatchInterface $patch1, ClassPatchInterface $patch2) { |
|
77 | + @usort($this->patches, function(ClassPatchInterface $patch1, ClassPatchInterface $patch2) { |
|
78 | 78 | return $patch2->getPriority() - $patch1->getPriority(); |
79 | 79 | }); |
80 | 80 | } |
@@ -55,14 +55,14 @@ |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | if ($this->nodeIsDirectoryIterator($node)) { |
58 | - $constructor->setCode('return parent::__construct("' . __DIR__ . '");'); |
|
58 | + $constructor->setCode('return parent::__construct("'.__DIR__.'");'); |
|
59 | 59 | |
60 | 60 | return; |
61 | 61 | } |
62 | 62 | |
63 | 63 | if ($this->nodeIsSplFileObject($node)) { |
64 | - $filePath = str_replace('\\','\\\\',__FILE__); |
|
65 | - $constructor->setCode('return parent::__construct("' . $filePath .'");'); |
|
64 | + $filePath = str_replace('\\', '\\\\', __FILE__); |
|
65 | + $constructor->setCode('return parent::__construct("'.$filePath.'");'); |
|
66 | 66 | |
67 | 67 | return; |
68 | 68 | } |