@@ -326,6 +326,9 @@ |
||
326 | 326 | $this->assertEquals(array(true), $this->exporter->toArray(true)); |
327 | 327 | } |
328 | 328 | |
329 | + /** |
|
330 | + * @param string $string |
|
331 | + */ |
|
329 | 332 | private function trimNewline($string) |
330 | 333 | { |
331 | 334 | return preg_replace('/[ ]*\n/', "\n", $string); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $obj2 = new \stdClass; |
31 | 31 | $obj2->foo = 'bar'; |
32 | 32 | |
33 | - $obj3 = (object)array(1,2,"Test\r\n",4,5,6,7,8); |
|
33 | + $obj3 = (object) array(1, 2, "Test\r\n", 4, 5, 6, 7, 8); |
|
34 | 34 | |
35 | 35 | $obj = new \stdClass; |
36 | 36 | //@codingStandardsIgnoreStart |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | array(1.2, '1.2'), |
60 | 60 | array(fopen('php://memory', 'r'), 'resource(%d) of type (stream)'), |
61 | 61 | array('1', "'1'"), |
62 | - array(array(array(1,2,3), array(3,4,5)), |
|
62 | + array(array(array(1, 2, 3), array(3, 4, 5)), |
|
63 | 63 | <<<EOF |
64 | 64 | Array &0 ( |
65 | 65 | 0 => Array &1 ( |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | * |
197 | 197 | * @param string $scalar |
198 | 198 | * @param string $delimiters |
199 | - * @param array $stringDelimiters |
|
199 | + * @param string[] $stringDelimiters |
|
200 | 200 | * @param int &$i |
201 | 201 | * @param bool $evaluate |
202 | 202 | * @param array $references |
@@ -254,6 +254,7 @@ discard block |
||
254 | 254 | * |
255 | 255 | * @param string $scalar |
256 | 256 | * @param int &$i |
257 | + * @param integer $i |
|
257 | 258 | * |
258 | 259 | * @return string A YAML string |
259 | 260 | * |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | return 'null'; |
106 | 106 | case is_object($value): |
107 | 107 | if ($objectSupport) { |
108 | - return '!php/object:'.serialize($value); |
|
108 | + return '!php/object:' . serialize($value); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | if ($exceptionOnInvalidType) { |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $repr = str_ireplace('INF', '.Inf', $repr); |
135 | 135 | } elseif (floor($value) == $value && $repr == $value) { |
136 | 136 | // Preserve float data type since storing a whole number will result in integer value. |
137 | - $repr = '!!float '.$repr; |
|
137 | + $repr = '!!float ' . $repr; |
|
138 | 138 | } |
139 | 139 | } else { |
140 | 140 | $repr = is_string($value) ? "'$value'" : (string) $value; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $keys = array_keys($value); |
173 | 173 | $keysCount = count($keys); |
174 | 174 | if ((1 === $keysCount && '0' == $keys[0]) |
175 | - || ($keysCount > 1 && array_reduce($keys, function ($v, $w) { return (int) $v + $w; }, 0) === $keysCount * ($keysCount - 1) / 2) |
|
175 | + || ($keysCount > 1 && array_reduce($keys, function($v, $w) { return (int) $v + $w; }, 0) === $keysCount * ($keysCount - 1) / 2) |
|
176 | 176 | ) { |
177 | 177 | $output = array(); |
178 | 178 | foreach ($value as $val) { |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | if (preg_match('/[ \t]+#/', $output, $match, PREG_OFFSET_CAPTURE)) { |
230 | 230 | $output = substr($output, 0, $match[0][1]); |
231 | 231 | } |
232 | - } elseif (preg_match('/^(.+?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) { |
|
232 | + } elseif (preg_match('/^(.+?)(' . implode('|', $delimiters) . ')/', substr($scalar, $i), $match)) { |
|
233 | 233 | $output = $match[1]; |
234 | 234 | $i += strlen($output); |
235 | 235 | } else { |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | */ |
262 | 262 | private static function parseQuotedScalar($scalar, &$i) |
263 | 263 | { |
264 | - if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { |
|
264 | + if (!preg_match('/' . self::REGEX_QUOTED_STRING . '/Au', substr($scalar, $i), $match)) { |
|
265 | 265 | throw new ParseException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i))); |
266 | 266 | } |
267 | 267 | |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | // embedded mapping? |
322 | 322 | try { |
323 | 323 | $pos = 0; |
324 | - $value = self::parseMapping('{'.$value.'}', $pos, $references); |
|
324 | + $value = self::parseMapping('{' . $value . '}', $pos, $references); |
|
325 | 325 | } catch (\InvalidArgumentException $e) { |
326 | 326 | // no, it's not |
327 | 327 | } |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | return '0' == $scalar[1] ? octdec($scalar) : (((string) $raw === (string) $cast) ? $cast : $raw); |
511 | 511 | case is_numeric($scalar): |
512 | 512 | case preg_match(self::getHexRegex(), $scalar): |
513 | - return '0x' === $scalar[0].$scalar[1] ? hexdec($scalar) : (float) $scalar; |
|
513 | + return '0x' === $scalar[0] . $scalar[1] ? hexdec($scalar) : (float) $scalar; |
|
514 | 514 | case '.inf' === $scalarLower: |
515 | 515 | case '.nan' === $scalarLower: |
516 | 516 | return -log(0); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $reflectionClass = $this->getReflectionClass($className); |
101 | 101 | |
102 | 102 | if ($this->isInstantiableViaReflection($reflectionClass)) { |
103 | - return function () use ($reflectionClass) { |
|
103 | + return function() use ($reflectionClass) { |
|
104 | 104 | return $reflectionClass->newInstanceWithoutConstructor(); |
105 | 105 | }; |
106 | 106 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | $this->checkIfUnSerializationIsSupported($reflectionClass, $serializedString); |
116 | 116 | |
117 | - return function () use ($serializedString) { |
|
117 | + return function() use ($serializedString) { |
|
118 | 118 | return unserialize($serializedString); |
119 | 119 | }; |
120 | 120 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | private function getReflectionClass($className) |
130 | 130 | { |
131 | - if (! class_exists($className)) { |
|
131 | + if (!class_exists($className)) { |
|
132 | 132 | throw InvalidArgumentException::fromNonExistingClass($className); |
133 | 133 | } |
134 | 134 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | private function checkIfUnSerializationIsSupported(ReflectionClass $reflectionClass, $serializedString) |
153 | 153 | { |
154 | - set_error_handler(function ($code, $message, $file, $line) use ($reflectionClass, & $error) { |
|
154 | + set_error_handler(function($code, $message, $file, $line) use ($reflectionClass, & $error) { |
|
155 | 155 | $error = UnexpectedValueException::fromUncleanUnSerialization( |
156 | 156 | $reflectionClass, |
157 | 157 | $message, |
@@ -197,10 +197,10 @@ discard block |
||
197 | 197 | private function isInstantiableViaReflection(ReflectionClass $reflectionClass) |
198 | 198 | { |
199 | 199 | if (\PHP_VERSION_ID >= 50600) { |
200 | - return ! ($this->hasInternalAncestors($reflectionClass) && $reflectionClass->isFinal()); |
|
200 | + return !($this->hasInternalAncestors($reflectionClass) && $reflectionClass->isFinal()); |
|
201 | 201 | } |
202 | 202 | |
203 | - return \PHP_VERSION_ID >= 50400 && ! $this->hasInternalAncestors($reflectionClass); |
|
203 | + return \PHP_VERSION_ID >= 50400 && !$this->hasInternalAncestors($reflectionClass); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
@@ -263,11 +263,11 @@ discard block |
||
263 | 263 | */ |
264 | 264 | private function isSafeToClone(ReflectionClass $reflection) |
265 | 265 | { |
266 | - if (method_exists($reflection, 'isCloneable') && ! $reflection->isCloneable()) { |
|
266 | + if (method_exists($reflection, 'isCloneable') && !$reflection->isCloneable()) { |
|
267 | 267 | return false; |
268 | 268 | } |
269 | 269 | |
270 | 270 | // not cloneable if it implements `__clone`, as we want to avoid calling it |
271 | - return ! $reflection->hasMethod('__clone'); |
|
271 | + return !$reflection->hasMethod('__clone'); |
|
272 | 272 | } |
273 | 273 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $this->assertSame($previous, $exception->getPrevious()); |
44 | 44 | $this->assertSame( |
45 | 45 | 'An exception was raised while trying to instantiate an instance of "' |
46 | - . __CLASS__ . '" via un-serialization', |
|
46 | + . __CLASS__ . '" via un-serialization', |
|
47 | 47 | $exception->getMessage() |
48 | 48 | ); |
49 | 49 | } |
@@ -113,7 +113,7 @@ |
||
113 | 113 | $this->assertInstanceOf('Exception', $previous); |
114 | 114 | |
115 | 115 | // in PHP 5.4.29 and PHP 5.5.13, this case is not a notice, but an exception being thrown |
116 | - if (! (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513)) { |
|
116 | + if (!(\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513)) { |
|
117 | 117 | $this->assertSame( |
118 | 118 | 'Could not produce an instance of "DoctrineTest\\InstantiatorTestAsset\WakeUpNoticesAsset" ' |
119 | 119 | . 'via un-serialization, since an error was triggered in file "' |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | && 'default' !== $namespace |
95 | 95 | ) { |
96 | 96 | // Srip leading and trailing slash |
97 | - $this->namespace = trim((string)$namespace, '\\'); |
|
97 | + $this->namespace = trim((string) $namespace, '\\'); |
|
98 | 98 | } else { |
99 | 99 | $this->namespace = ''; |
100 | 100 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function setNamespaceAlias($alias, $fqnn) |
133 | 133 | { |
134 | - $this->namespace_aliases[$alias] = '\\' . trim((string)$fqnn, '\\'); |
|
134 | + $this->namespace_aliases[$alias] = '\\' . trim((string) $fqnn, '\\'); |
|
135 | 135 | return $this; |
136 | 136 | } |
137 | 137 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public function setLSEN($lsen) |
150 | 150 | { |
151 | - $this->lsen = (string)$lsen; |
|
151 | + $this->lsen = (string) $lsen; |
|
152 | 152 | return $this; |
153 | 153 | } |
154 | 154 | } |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * phpDocumentor |
|
4 | - * |
|
5 | - * PHP Version 5.3 |
|
6 | - * |
|
7 | - * @author Vasil Rangelov <[email protected]> |
|
8 | - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) |
|
9 | - * @license http://www.opensource.org/licenses/mit-license.php MIT |
|
10 | - * @link http://phpdoc.org |
|
11 | - */ |
|
3 | + * phpDocumentor |
|
4 | + * |
|
5 | + * PHP Version 5.3 |
|
6 | + * |
|
7 | + * @author Vasil Rangelov <[email protected]> |
|
8 | + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) |
|
9 | + * @license http://www.opensource.org/licenses/mit-license.php MIT |
|
10 | + * @link http://phpdoc.org |
|
11 | + */ |
|
12 | 12 | |
13 | 13 | namespace phpDocumentor\Reflection\DocBlock\Tag; |
14 | 14 |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | ); |
115 | 115 | |
116 | 116 | $count = count($this->parsedContents); |
117 | - for ($i=1; $i<$count; $i += 2) { |
|
117 | + for ($i = 1; $i < $count; $i += 2) { |
|
118 | 118 | $this->parsedContents[$i] = Tag::createInstance( |
119 | 119 | $this->parsedContents[$i], |
120 | 120 | $this->docblock |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | //In order to allow "literal" inline tags, the otherwise invalid |
125 | 125 | //sequence "{@}" is changed to "@", and "{}" is changed to "}". |
126 | 126 | //See unit tests for examples. |
127 | - for ($i=0; $i<$count; $i += 2) { |
|
127 | + for ($i = 0; $i < $count; $i += 2) { |
|
128 | 128 | $this->parsedContents[$i] = str_replace( |
129 | 129 | array('{@}', '{}'), |
130 | 130 | array('@', '}'), |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * phpDocumentor |
|
4 | - * |
|
5 | - * PHP Version 5.3 |
|
6 | - * |
|
7 | - * @author Mike van Riel <[email protected]> |
|
8 | - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) |
|
9 | - * @license http://www.opensource.org/licenses/mit-license.php MIT |
|
10 | - * @link http://phpdoc.org |
|
11 | - */ |
|
3 | + * phpDocumentor |
|
4 | + * |
|
5 | + * PHP Version 5.3 |
|
6 | + * |
|
7 | + * @author Mike van Riel <[email protected]> |
|
8 | + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) |
|
9 | + * @license http://www.opensource.org/licenses/mit-license.php MIT |
|
10 | + * @link http://phpdoc.org |
|
11 | + */ |
|
12 | 12 | |
13 | 13 | namespace phpDocumentor\Reflection\DocBlock\Type; |
14 | 14 |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | if (isset(self::$tagHandlerMappings[$matches[1]])) { |
129 | 129 | $handler = self::$tagHandlerMappings[$matches[1]]; |
130 | 130 | } elseif (isset($docblock)) { |
131 | - $tagName = (string)new Type\Collection( |
|
131 | + $tagName = (string) new Type\Collection( |
|
132 | 132 | array($matches[1]), |
133 | 133 | $docblock->getContext() |
134 | 134 | ); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | final public static function registerTagHandler($tag, $handler) |
164 | 164 | { |
165 | - $tag = trim((string)$tag); |
|
165 | + $tag = trim((string) $tag); |
|
166 | 166 | |
167 | 167 | if (null === $handler) { |
168 | 168 | unset(self::$tagHandlerMappings[$tag]); |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * phpDocumentor |
|
4 | - * |
|
5 | - * PHP Version 5.3 |
|
6 | - * |
|
7 | - * @author Mike van Riel <[email protected]> |
|
8 | - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) |
|
9 | - * @license http://www.opensource.org/licenses/mit-license.php MIT |
|
10 | - * @link http://phpdoc.org |
|
11 | - */ |
|
3 | + * phpDocumentor |
|
4 | + * |
|
5 | + * PHP Version 5.3 |
|
6 | + * |
|
7 | + * @author Mike van Riel <[email protected]> |
|
8 | + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) |
|
9 | + * @license http://www.opensource.org/licenses/mit-license.php MIT |
|
10 | + * @link http://phpdoc.org |
|
11 | + */ |
|
12 | 12 | |
13 | 13 | namespace phpDocumentor\Reflection\DocBlock\Type; |
14 | 14 |
@@ -1,14 +1,14 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * phpDocumentor |
|
4 | - * |
|
5 | - * PHP Version 5.3 |
|
6 | - * |
|
7 | - * @author Ben Selby <[email protected]> |
|
8 | - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) |
|
9 | - * @license http://www.opensource.org/licenses/mit-license.php MIT |
|
10 | - * @link http://phpdoc.org |
|
11 | - */ |
|
3 | + * phpDocumentor |
|
4 | + * |
|
5 | + * PHP Version 5.3 |
|
6 | + * |
|
7 | + * @author Ben Selby <[email protected]> |
|
8 | + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) |
|
9 | + * @license http://www.opensource.org/licenses/mit-license.php MIT |
|
10 | + * @link http://phpdoc.org |
|
11 | + */ |
|
12 | 12 | |
13 | 13 | namespace phpDocumentor\Reflection\DocBlock\Tag; |
14 | 14 | |
@@ -55,22 +55,22 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
58 | - * Gets the link |
|
59 | - * |
|
60 | - * @return string |
|
61 | - */ |
|
58 | + * Gets the link |
|
59 | + * |
|
60 | + * @return string |
|
61 | + */ |
|
62 | 62 | public function getLink() |
63 | 63 | { |
64 | 64 | return $this->link; |
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
68 | - * Sets the link |
|
69 | - * |
|
70 | - * @param string $link The link |
|
71 | - * |
|
72 | - * @return $this |
|
73 | - */ |
|
68 | + * Sets the link |
|
69 | + * |
|
70 | + * @param string $link The link |
|
71 | + * |
|
72 | + * @return $this |
|
73 | + */ |
|
74 | 74 | public function setLink($link) |
75 | 75 | { |
76 | 76 | $this->link = $link; |