@@ -44,8 +44,7 @@ |
||
44 | 44 | { |
45 | 45 | if (!$pair instanceof OrderedPair) |
46 | 46 | { |
47 | - $pair = new OrderedPair |
|
48 | - ( |
|
47 | + $pair = new OrderedPair( |
|
49 | 48 | $this->size(), |
50 | 49 | $pair->key, |
51 | 50 | $pair->value |
@@ -37,8 +37,6 @@ |
||
37 | 37 | /** |
38 | 38 | * Adds an element to the Map |
39 | 39 | * |
40 | - * @param KeyType $key The key to add |
|
41 | - * @param ValueType $value The value to add |
|
42 | 40 | */ |
43 | 41 | public function insert(Pair $pair) |
44 | 42 | { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $this->initParams(); |
98 | 98 | |
99 | 99 | $this->accessor->setRawValue('visibility', |
100 | - ($this->reflector->isPublic() ? 'public' |
|
100 | + ($this->reflector->isPublic() ? 'public' |
|
101 | 101 | : ($this->reflector->isProtected() ? 'protected' |
102 | 102 | : ($this->reflector->isPrivate() ? 'private' |
103 | 103 | : ('')))) |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | { |
155 | 155 | throw new \Exception |
156 | 156 | ( |
157 | - 'Tried to set param annotation for non existant ' |
|
157 | + 'Tried to set param annotation for non existant ' |
|
158 | 158 | . 'parameter: ' . $param |
159 | 159 | ); |
160 | 160 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | { |
169 | 169 | throw new \Exception |
170 | 170 | ( |
171 | - 'Types are incompatible for: ' |
|
171 | + 'Types are incompatible for: ' |
|
172 | 172 | . $this->reflector->getName() . '::' . $items[1] |
173 | 173 | ); |
174 | 174 | } |
@@ -64,8 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public static function fromName(string $class, string $method) |
66 | 66 | { |
67 | - return new static(new PHPNativeReflectionMethod |
|
68 | - ( |
|
67 | + return new static(new PHPNativeReflectionMethod( |
|
69 | 68 | $class, $method |
70 | 69 | )); |
71 | 70 | } |
@@ -89,8 +88,7 @@ discard block |
||
89 | 88 | { |
90 | 89 | $this->typeParser = new TypeParser($parent); |
91 | 90 | $this->accessor->setRawValue('owner', $parent); |
92 | - $this->accessor->setRawValue |
|
93 | - ( |
|
91 | + $this->accessor->setRawValue( |
|
94 | 92 | 'name', |
95 | 93 | $this->reflector->getName() |
96 | 94 | ); |
@@ -118,8 +116,7 @@ discard block |
||
118 | 116 | $type = $this->reflector->getReturnType(); |
119 | 117 | if ($type) |
120 | 118 | { |
121 | - $this->accessor->setRawValue |
|
122 | - ( |
|
119 | + $this->accessor->setRawValue( |
|
123 | 120 | 'nativeReturnType', |
124 | 121 | !$type->isBuiltin() ? '\\' . $type : (string)$type |
125 | 122 | ); |
@@ -136,13 +133,11 @@ discard block |
||
136 | 133 | */ |
137 | 134 | protected function initParams() |
138 | 135 | { |
139 | - $this->accessor->setRawValue |
|
140 | - ( |
|
136 | + $this->accessor->setRawValue( |
|
141 | 137 | 'parameters', |
142 | 138 | new FixedList(count($this->reflector->getParameters())) |
143 | 139 | ); |
144 | - $this->accessor->setRawValue |
|
145 | - ( |
|
140 | + $this->accessor->setRawValue( |
|
146 | 141 | 'nativeParameters', |
147 | 142 | new FixedList(count($this->reflector->getParameters())) |
148 | 143 | ); |
@@ -163,8 +158,7 @@ discard block |
||
163 | 158 | |
164 | 159 | if (!$this->parameters->containsKey($param)) |
165 | 160 | { |
166 | - throw new \Exception |
|
167 | - ( |
|
161 | + throw new \Exception( |
|
168 | 162 | 'Tried to set param annotation for non existant ' |
169 | 163 | . 'parameter: ' . $param |
170 | 164 | ); |
@@ -177,8 +171,7 @@ discard block |
||
177 | 171 | |
178 | 172 | if (!$comparator->compatible($nativeType, $type)) |
179 | 173 | { |
180 | - throw new \Exception |
|
181 | - ( |
|
174 | + throw new \Exception( |
|
182 | 175 | 'Types are incompatible for: ' |
183 | 176 | . $this->reflector->getName() . '::' . $items[1] |
184 | 177 | ); |
@@ -193,8 +186,7 @@ discard block |
||
193 | 186 | * |
194 | 187 | * @param PHPNativeReflectionParameter $reflect |
195 | 188 | */ |
196 | - protected function addParameter |
|
197 | - ( |
|
189 | + protected function addParameter( |
|
198 | 190 | PHPNativeReflectionParameter $reflect |
199 | 191 | ) |
200 | 192 | : void |
@@ -41,8 +41,7 @@ discard block |
||
41 | 41 | return static::$defaultHashProducer; |
42 | 42 | } |
43 | 43 | |
44 | - public static function setDefaultHashProducer |
|
45 | - ( |
|
44 | + public static function setDefaultHashProducer( |
|
46 | 45 | HashProducerInterface $hashProducer |
47 | 46 | ) |
48 | 47 | : HashProducerInterface |
@@ -60,8 +59,7 @@ discard block |
||
60 | 59 | */ |
61 | 60 | protected $hashProducer; |
62 | 61 | |
63 | - public function __construct |
|
64 | - ( |
|
62 | + public function __construct( |
|
65 | 63 | ?HashProducerInterface $hashProducer = null |
66 | 64 | ) |
67 | 65 | { |
@@ -45,8 +45,7 @@ |
||
45 | 45 | /** |
46 | 46 | * {@inheritDoc} |
47 | 47 | */ |
48 | - public function splice |
|
49 | - ( |
|
48 | + public function splice( |
|
50 | 49 | int $offset, |
51 | 50 | ?int $length = null, |
52 | 51 | array $replacement = [] |
@@ -43,8 +43,7 @@ |
||
43 | 43 | * @param int $length The number of elements to remove |
44 | 44 | * @param array $items Items to add |
45 | 45 | */ |
46 | - public function splice |
|
47 | - ( |
|
46 | + public function splice( |
|
48 | 47 | int $offset, |
49 | 48 | ?int$length = null, |
50 | 49 | array $items = [] |
@@ -169,6 +169,9 @@ |
||
169 | 169 | return new ObjectType($context); |
170 | 170 | } |
171 | 171 | |
172 | + /** |
|
173 | + * @param string $var |
|
174 | + */ |
|
172 | 175 | public function scalarToType($var) : ?AbstractType |
173 | 176 | { |
174 | 177 | switch (strtolower($var)) |
@@ -146,7 +146,7 @@ |
||
146 | 146 | } |
147 | 147 | elseif ($i + 2 !== strlen($value)) |
148 | 148 | { |
149 | - if (!in_array($value{$i + 2}, ['>',','])) |
|
149 | + if (!in_array($value{$i + 2}, ['>', ','])) |
|
150 | 150 | { |
151 | 151 | throw new \Exception('Unexpected char after collection'); |
152 | 152 | } |
@@ -139,12 +139,10 @@ discard block |
||
139 | 139 | if ($i + 1 === strlen($value)) |
140 | 140 | { |
141 | 141 | throw new \Exception('Unexpected EOF'); |
142 | - } |
|
143 | - elseif ($value{$i + 1} !== ']') |
|
142 | + } elseif ($value{$i + 1} !== ']') |
|
144 | 143 | { |
145 | 144 | throw new \Exception('[ must be followed by ]'); |
146 | - } |
|
147 | - elseif ($i + 2 !== strlen($value)) |
|
145 | + } elseif ($i + 2 !== strlen($value)) |
|
148 | 146 | { |
149 | 147 | if (!in_array($value{$i + 2}, ['>',','])) |
150 | 148 | { |
@@ -240,8 +238,7 @@ discard block |
||
240 | 238 | if ($useStatements->containsKey($this->currentValue)) |
241 | 239 | { |
242 | 240 | return $useStatements[$this->currentValue]->classname; |
243 | - } |
|
244 | - else |
|
241 | + } else |
|
245 | 242 | { |
246 | 243 | return $this->context->namespace->namespace |
247 | 244 | . '\\' . $this->currentValue; |
@@ -73,8 +73,7 @@ |
||
73 | 73 | } |
74 | 74 | else |
75 | 75 | { |
76 | - throw new DomainException |
|
77 | - ( |
|
76 | + throw new DomainException( |
|
78 | 77 | 'The given IteratorAggregate\'s ' . |
79 | 78 | 'getIterator() method should return an ' . |
80 | 79 | 'Iterator or IteratorAggregate, but it did not' |
@@ -51,12 +51,10 @@ discard block |
||
51 | 51 | if (is_array($iterator)) |
52 | 52 | { |
53 | 53 | $this->iterator = new ArrayIterator($iterator); |
54 | - } |
|
55 | - elseif ($iterator instanceof Iterator) |
|
54 | + } elseif ($iterator instanceof Iterator) |
|
56 | 55 | { |
57 | 56 | $this->iterator = $iterator; |
58 | - } |
|
59 | - elseif ($iterator instanceof IteratorAggregate) |
|
57 | + } elseif ($iterator instanceof IteratorAggregate) |
|
60 | 58 | { |
61 | 59 | while (true) |
62 | 60 | { |
@@ -66,12 +64,10 @@ discard block |
||
66 | 64 | { |
67 | 65 | $this->iterator = $newIterator; |
68 | 66 | break; |
69 | - } |
|
70 | - elseif ($newIterator instanceof IteratorAggregate) |
|
67 | + } elseif ($newIterator instanceof IteratorAggregate) |
|
71 | 68 | { |
72 | 69 | $iterator = $newIterator; |
73 | - } |
|
74 | - else |
|
70 | + } else |
|
75 | 71 | { |
76 | 72 | throw new DomainException |
77 | 73 | ( |
@@ -81,8 +77,7 @@ discard block |
||
81 | 77 | ); |
82 | 78 | } |
83 | 79 | } |
84 | - } |
|
85 | - else |
|
80 | + } else |
|
86 | 81 | { |
87 | 82 | throw new DomainException('Unknown type of iterator'); |
88 | 83 | } |
@@ -45,8 +45,7 @@ |
||
45 | 45 | /** |
46 | 46 | * {@inheritDoc} |
47 | 47 | */ |
48 | - public function splice |
|
49 | - ( |
|
48 | + public function splice( |
|
50 | 49 | int $offset, |
51 | 50 | ?int $length = null, |
52 | 51 | array $replacement = [] |