@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | $matches = []; |
65 | - if (!preg_match('/^(' . self::REGEX_VECTOR . ')\s*(.+)?$/sux', $body, $matches)) { |
|
65 | + if (!preg_match('/^('.self::REGEX_VECTOR.')\s*(.+)?$/sux', $body, $matches)) { |
|
66 | 66 | return new static( |
67 | 67 | null, |
68 | 68 | null !== $descriptionFactory ? $descriptionFactory->create($body, $context) : null |
@@ -92,6 +92,6 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function __toString() |
94 | 94 | { |
95 | - return $this->version . ($this->description ? ' ' . $this->description->render() : ''); |
|
95 | + return $this->version.($this->description ? ' '.$this->description->render() : ''); |
|
96 | 96 | } |
97 | 97 | } |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | Assert::integerish($startingLine); |
37 | 37 | Assert::nullOrIntegerish($lineCount); |
38 | 38 | |
39 | - $this->startingLine = (int)$startingLine; |
|
40 | - $this->lineCount = $lineCount !== null ? (int)$lineCount : null; |
|
39 | + $this->startingLine = (int) $startingLine; |
|
40 | + $this->lineCount = $lineCount !== null ? (int) $lineCount : null; |
|
41 | 41 | $this->description = $description; |
42 | 42 | } |
43 | 43 | |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | |
56 | 56 | // Starting line / Number of lines / Description |
57 | 57 | if (preg_match('/^([1-9]\d*)\s*(?:((?1))\s+)?(.*)$/sux', $body, $matches)) { |
58 | - $startingLine = (int)$matches[1]; |
|
58 | + $startingLine = (int) $matches[1]; |
|
59 | 59 | if (isset($matches[2]) && $matches[2] !== '') { |
60 | - $lineCount = (int)$matches[2]; |
|
60 | + $lineCount = (int) $matches[2]; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | $description = $matches[3]; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | public function __toString() |
92 | 92 | { |
93 | 93 | return $this->startingLine |
94 | - . ($this->lineCount !== null ? ' ' . $this->lineCount : '') |
|
95 | - . ($this->description ? ' ' . $this->description->render() : ''); |
|
94 | + . ($this->lineCount !== null ? ' '.$this->lineCount : '') |
|
95 | + . ($this->description ? ' '.$this->description->render() : ''); |
|
96 | 96 | } |
97 | 97 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | $matches = []; |
65 | - if (!preg_match('/^(' . self::REGEX_VECTOR . ')\s*(.+)?$/sux', $body, $matches)) { |
|
65 | + if (!preg_match('/^('.self::REGEX_VECTOR.')\s*(.+)?$/sux', $body, $matches)) { |
|
66 | 66 | return null; |
67 | 67 | } |
68 | 68 | |
@@ -89,6 +89,6 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function __toString() |
91 | 91 | { |
92 | - return $this->version . ($this->description ? ' ' . $this->description->render() : ''); |
|
92 | + return $this->version.($this->description ? ' '.$this->description->render() : ''); |
|
93 | 93 | } |
94 | 94 | } |
@@ -53,6 +53,6 @@ |
||
53 | 53 | |
54 | 54 | public function __toString() |
55 | 55 | { |
56 | - return $this->type . ' ' . $this->description; |
|
56 | + return $this->type.' '.$this->description; |
|
57 | 57 | } |
58 | 58 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | TypeContext $context = null |
71 | 71 | ) { |
72 | 72 | Assert::stringNotEmpty($body); |
73 | - Assert::allNotNull([ $typeResolver, $descriptionFactory ]); |
|
73 | + Assert::allNotNull([$typeResolver, $descriptionFactory]); |
|
74 | 74 | |
75 | 75 | // 1. none or more whitespace |
76 | 76 | // 2. optionally the keyword "static" followed by whitespace |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | list(, $static, $returnType, $methodName, $arguments, $description) = $matches; |
122 | 122 | |
123 | - $static = $static === 'static'; |
|
123 | + $static = $static === 'static'; |
|
124 | 124 | |
125 | 125 | if ($returnType === '') { |
126 | 126 | $returnType = 'void'; |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | } |
146 | 146 | } |
147 | 147 | |
148 | - $argument = [ 'name' => $argumentName, 'type' => $argumentType]; |
|
148 | + $argument = ['name' => $argumentName, 'type' => $argumentType]; |
|
149 | 149 | } |
150 | 150 | } else { |
151 | 151 | $arguments = []; |
@@ -194,32 +194,32 @@ discard block |
||
194 | 194 | { |
195 | 195 | $arguments = []; |
196 | 196 | foreach ($this->arguments as $argument) { |
197 | - $arguments[] = $argument['type'] . ' $' . $argument['name']; |
|
197 | + $arguments[] = $argument['type'].' $'.$argument['name']; |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | return trim(($this->isStatic() ? 'static ' : '') |
201 | - . (string)$this->returnType . ' ' |
|
201 | + . (string) $this->returnType.' ' |
|
202 | 202 | . $this->methodName |
203 | - . '(' . implode(', ', $arguments) . ')' |
|
204 | - . ($this->description ? ' ' . $this->description->render() : '')); |
|
203 | + . '('.implode(', ', $arguments).')' |
|
204 | + . ($this->description ? ' '.$this->description->render() : '')); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | private function filterArguments($arguments) |
208 | 208 | { |
209 | 209 | foreach ($arguments as &$argument) { |
210 | 210 | if (is_string($argument)) { |
211 | - $argument = [ 'name' => $argument ]; |
|
211 | + $argument = ['name' => $argument]; |
|
212 | 212 | } |
213 | 213 | |
214 | - if (! isset($argument['type'])) { |
|
214 | + if (!isset($argument['type'])) { |
|
215 | 215 | $argument['type'] = new Void_(); |
216 | 216 | } |
217 | 217 | |
218 | 218 | $keys = array_keys($argument); |
219 | 219 | sort($keys); |
220 | - if ($keys !== [ 'name', 'type' ]) { |
|
220 | + if ($keys !== ['name', 'type']) { |
|
221 | 221 | throw new \InvalidArgumentException( |
222 | - 'Arguments can only have the "name" and "type" fields, found: ' . var_export($keys, true) |
|
222 | + 'Arguments can only have the "name" and "type" fields, found: '.var_export($keys, true) |
|
223 | 223 | ); |
224 | 224 | } |
225 | 225 | } |
@@ -99,8 +99,8 @@ |
||
99 | 99 | */ |
100 | 100 | public function __toString() |
101 | 101 | { |
102 | - return ($this->type ? $this->type . ' ' : '') |
|
103 | - . (empty($this->variableName) ? null : ('$' . $this->variableName)) |
|
104 | - . ($this->description ? ' ' . $this->description : ''); |
|
102 | + return ($this->type ? $this->type.' ' : '') |
|
103 | + . (empty($this->variableName) ? null : ('$'.$this->variableName)) |
|
104 | + . ($this->description ? ' '.$this->description : ''); |
|
105 | 105 | } |
106 | 106 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | $matches = []; |
65 | - if (! preg_match('/^(' . self::REGEX_VECTOR . ')\s*(.+)?$/sux', $body, $matches)) { |
|
65 | + if (!preg_match('/^('.self::REGEX_VECTOR.')\s*(.+)?$/sux', $body, $matches)) { |
|
66 | 66 | return null; |
67 | 67 | } |
68 | 68 | |
@@ -89,6 +89,6 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function __toString() |
91 | 91 | { |
92 | - return $this->version . ($this->description ? ' ' . $this->description->render() : ''); |
|
92 | + return $this->version.($this->description ? ' '.$this->description->render() : ''); |
|
93 | 93 | } |
94 | 94 | } |
@@ -56,10 +56,10 @@ |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
59 | - * Gets the link |
|
60 | - * |
|
61 | - * @return string |
|
62 | - */ |
|
59 | + * Gets the link |
|
60 | + * |
|
61 | + * @return string |
|
62 | + */ |
|
63 | 63 | public function getLink() |
64 | 64 | { |
65 | 65 | return $this->link; |
@@ -72,6 +72,6 @@ |
||
72 | 72 | */ |
73 | 73 | public function __toString() |
74 | 74 | { |
75 | - return $this->link . ($this->description ? ' ' . $this->description->render() : ''); |
|
75 | + return $this->link.($this->description ? ' '.$this->description->render() : ''); |
|
76 | 76 | } |
77 | 77 | } |
@@ -99,8 +99,8 @@ |
||
99 | 99 | */ |
100 | 100 | public function __toString() |
101 | 101 | { |
102 | - return ($this->type ? $this->type . ' ' : '') |
|
103 | - . '$' . $this->variableName |
|
104 | - . ($this->description ? ' ' . $this->description : ''); |
|
102 | + return ($this->type ? $this->type.' ' : '') |
|
103 | + . '$'.$this->variableName |
|
104 | + . ($this->description ? ' '.$this->description : ''); |
|
105 | 105 | } |
106 | 106 | } |