@@ -29,7 +29,7 @@ |
||
| 29 | 29 | |
| 30 | 30 | public static function callMethod(\ReflectionMethod $method, array $params = null) { |
| 31 | 31 | if (null === $params) { |
| 32 | - $params = array_map(function ($p) { |
|
| 32 | + $params = array_map(function($p) { |
|
| 33 | 33 | return '$' . $p->name; |
| 34 | 34 | }, $method->getParameters()); |
| 35 | 35 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $filter |= \ReflectionMethod::IS_PROTECTED; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - return array_filter($class->getMethods($filter), function ($method) { |
|
| 35 | + return array_filter($class->getMethods($filter), function($method) { |
|
| 36 | 36 | return !$method->isFinal() && !$method->isStatic(); |
| 37 | 37 | }); |
| 38 | 38 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | $tokenizer = new PhpTokenizer(); |
| 83 | 83 | $tokens = $tokenizer->tokenize($content); |
| 84 | - $tokens = $tokens->filter(function ($token) { |
|
| 84 | + $tokens = $tokens->filter(function($token) { |
|
| 85 | 85 | return $token->type !== T_WHITESPACE && $token->type !== T_COMMENT && $token->type !== T_DOC_COMMENT; |
| 86 | 86 | }); |
| 87 | 87 | $statements = []; |
@@ -187,7 +187,7 @@ |
||
| 187 | 187 | $p->setDefaultValue($this->getValue($default)); |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - $tag = $params->find($p, function (ParamTag $t, $p) { |
|
| 190 | + $tag = $params->find($p, function(ParamTag $t, $p) { |
|
| 191 | 191 | return $t->getVariable() == '$' . $p->getName(); |
| 192 | 192 | }); |
| 193 | 193 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $docblock = new Docblock($ref->getDeclaringFunction()); |
| 65 | 65 | |
| 66 | 66 | $params = $docblock->getTags('param'); |
| 67 | - $tag = $params->find($ref->name, function (ParamTag $t, $name) { |
|
| 67 | + $tag = $params->find($ref->name, function(ParamTag $t, $name) { |
|
| 68 | 68 | return $t->getVariable() == '$' . $name; |
| 69 | 69 | }); |
| 70 | 70 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public function getDocblockTag() { |
| 125 | 125 | return ParamTag::create() |
| 126 | - ->setType($this->getType() ? : 'mixed') |
|
| 126 | + ->setType($this->getType() ?: 'mixed') |
|
| 127 | 127 | ->setVariable($this->getName()) |
| 128 | 128 | ->setDescription($this->getTypeDescription()); |
| 129 | 129 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | private function getConstantSortFunc() { |
| 163 | - return $this->constantSortFunc ? : 'strcasecmp'; |
|
| 163 | + return $this->constantSortFunc ?: 'strcasecmp'; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | private function getUseSortFunc() { |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | if (empty(self::$defaultUseStatementSortFunc)) { |
| 172 | - self::$defaultUseStatementSortFunc = function ($s1, $s2) { |
|
| 172 | + self::$defaultUseStatementSortFunc = function($s1, $s2) { |
|
| 173 | 173 | // find first difference |
| 174 | 174 | $cmp1 = null; |
| 175 | 175 | $cmp2 = null; |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | return 0; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - $getAscii = function ($str) { |
|
| 189 | + $getAscii = function($str) { |
|
| 190 | 190 | $ord = ord($str); |
| 191 | 191 | if ($ord >= 65 && $ord <= 90) { |
| 192 | 192 | $ord += 32; |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | if (empty(self::$defaultMethodSortFunc)) { |
| 212 | - self::$defaultMethodSortFunc = function ($a, $b) { |
|
| 212 | + self::$defaultMethodSortFunc = function($a, $b) { |
|
| 213 | 213 | if ($a->isStatic() !== $isStatic = $b->isStatic()) { |
| 214 | 214 | return $isStatic ? 1 : -1; |
| 215 | 215 | } |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | if (empty(self::$defaultPropertySortFunc)) { |
| 237 | - self::$defaultPropertySortFunc = function ($a, $b) { |
|
| 237 | + self::$defaultPropertySortFunc = function($a, $b) { |
|
| 238 | 238 | if (($aV = $a->getVisibility()) !== $bV = $b->getVisibility()) { |
| 239 | 239 | $aV = 'public' === $aV ? 3 : ('protected' === $aV ? 2 : 1); |
| 240 | 240 | $bV = 'public' === $bV ? 3 : ('protected' === $bV ? 2 : 1); |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | foreach ($this->parameters as $param) { |
| 15 | 15 | $ptag = $param->getDocblockTag(); |
| 16 | 16 | |
| 17 | - $tag = $tags->find($ptag, function (ParamTag $tag, ParamTag $ptag) { |
|
| 17 | + $tag = $tags->find($ptag, function(ParamTag $tag, ParamTag $ptag) { |
|
| 18 | 18 | return $tag->getVariable() == $ptag->getVariable(); |
| 19 | 19 | }); |
| 20 | 20 | |
@@ -19,10 +19,10 @@ |
||
| 19 | 19 | 'headerDocblock' => null, |
| 20 | 20 | 'blankLineAtEnd' => true, |
| 21 | 21 | 'declareStrictTypes' => false, |
| 22 | - 'generateScalarTypeHints' => function (Options $options) { |
|
| 22 | + 'generateScalarTypeHints' => function(Options $options) { |
|
| 23 | 23 | return $options['declareStrictTypes']; |
| 24 | 24 | }, |
| 25 | - 'generateReturnTypeHints' => function (Options $options) { |
|
| 25 | + 'generateReturnTypeHints' => function(Options $options) { |
|
| 26 | 26 | return $options['declareStrictTypes']; |
| 27 | 27 | }, |
| 28 | 28 | ]); |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | protected function getDefaultOptions() { |
| 42 | 42 | return [ |
| 43 | 43 | 'generateDocblock' => true, |
| 44 | - 'generateEmptyDocblock' => function (Options $options) { |
|
| 44 | + 'generateEmptyDocblock' => function(Options $options) { |
|
| 45 | 45 | return $options['generateDocblock']; |
| 46 | 46 | }, |
| 47 | 47 | 'generateScalarTypeHints' => false, |