@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | /** |
| 161 | 161 | * @return string |
| 162 | 162 | */ |
| 163 | - $toTraitName = static function (Tokens $use): string { |
|
| 163 | + $toTraitName = static function(Tokens $use): string { |
|
| 164 | 164 | $string = ''; |
| 165 | 165 | |
| 166 | 166 | foreach ($use as $token) { |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | }; |
| 178 | 178 | |
| 179 | 179 | $sortedElements = $elements; |
| 180 | - uasort($sortedElements, static function (Tokens $useA, Tokens $useB) use ($toTraitName) { |
|
| 180 | + uasort($sortedElements, static function(Tokens $useA, Tokens $useB) use ($toTraitName) { |
|
| 181 | 181 | return strcasecmp($toTraitName($useA), $toTraitName($useB)); |
| 182 | 182 | }); |
| 183 | 183 | |
@@ -342,7 +342,7 @@ |
||
| 342 | 342 | $sequences[] = $seq; |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | - return [$sequences, [3 => false]]; |
|
| 345 | + return [$sequences, [3 => false]]; |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | /** |
@@ -171,7 +171,7 @@ |
||
| 171 | 171 | |
| 172 | 172 | private function getClassStart(Tokens $tokens, int $index, string $namespace): ?int |
| 173 | 173 | { |
| 174 | - $namespace = ('' !== $namespace ? '\\'.$namespace : '').'\\'; |
|
| 174 | + $namespace = ('' !== $namespace ? '\\' . $namespace : '') . '\\'; |
|
| 175 | 175 | |
| 176 | 176 | foreach (array_reverse(Preg::split('/(\\\\)/', $namespace, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE)) as $piece) { |
| 177 | 177 | $index = $tokens->getPrevMeaningfulToken($index); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | protected function createConfigurationDefinition(): FixerConfigurationResolverInterface |
| 129 | 129 | { |
| 130 | - $annotationsAsserts = [static function (array $values): bool { |
|
| 130 | + $annotationsAsserts = [static function(array $values): bool { |
|
| 131 | 131 | foreach ($values as $value) { |
| 132 | 132 | if (!\is_string($value) || '' === $value) { |
| 133 | 133 | return false; |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | return true; |
| 138 | 138 | }]; |
| 139 | 139 | |
| 140 | - $annotationsNormalizer = static function (Options $options, array $value): array { |
|
| 140 | + $annotationsNormalizer = static function(Options $options, array $value): array { |
|
| 141 | 141 | $newValue = []; |
| 142 | 142 | foreach ($value as $key) { |
| 143 | 143 | if ('@' === $key[0]) { |
@@ -147,7 +147,7 @@ |
||
| 147 | 147 | return new FixerConfigurationResolver([ |
| 148 | 148 | (new FixerOptionBuilder('replacements', 'Mapping between replaced functions with the new ones.')) |
| 149 | 149 | ->setAllowedTypes(['array']) |
| 150 | - ->setAllowedValues([static function (array $value) { |
|
| 150 | + ->setAllowedValues([static function(array $value) { |
|
| 151 | 151 | foreach ($value as $functionName => $replacement) { |
| 152 | 152 | if (!\array_key_exists($functionName, self::$argumentCounts)) { |
| 153 | 153 | throw new InvalidOptionsException(sprintf( |
@@ -132,7 +132,7 @@ |
||
| 132 | 132 | |
| 133 | 133 | $kind = T_ENCAPSED_AND_WHITESPACE; |
| 134 | 134 | if (1 === $count) { |
| 135 | - $content = '"'.$content.'"'; |
|
| 135 | + $content = '"' . $content . '"'; |
|
| 136 | 136 | $kind = T_CONSTANT_ENCAPSED_STRING; |
| 137 | 137 | } |
| 138 | 138 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $string = substr($regexTokenContent, 1, -1); |
| 122 | 122 | $quote = $regexTokenContent[0]; |
| 123 | 123 | $delim = $this->getBestDelimiter($string); |
| 124 | - $preg = $delim.addcslashes($string, $delim).$delim.'D'.$map[2]; |
|
| 124 | + $preg = $delim . addcslashes($string, $delim) . $delim . 'D' . $map[2]; |
|
| 125 | 125 | |
| 126 | 126 | // check if the preg is valid |
| 127 | 127 | if (!$this->checkPreg($preg)) { |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | // modify function and argument |
| 132 | 132 | $tokens[$match[0]] = new Token([T_STRING, $map[1]]); |
| 133 | - $tokens[$match[2]] = new Token([T_CONSTANT_ENCAPSED_STRING, $quote.$preg.$quote]); |
|
| 133 | + $tokens[$match[2]] = new Token([T_CONSTANT_ENCAPSED_STRING, $quote . $preg . $quote]); |
|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | // return the least used delimiter, using the position in the list as a tie breaker |
| 174 | - uasort($delimiters, static function (array $a, array $b) { |
|
| 174 | + uasort($delimiters, static function(array $a, array $b) { |
|
| 175 | 175 | if ($a[0] === $b[0]) { |
| 176 | 176 | return $a[1] <=> $b[1]; |
| 177 | 177 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | |
| 58 | 58 | $this->functions = array_filter( |
| 59 | 59 | self::$functionsMap, |
| 60 | - static function (array $mapping) { |
|
| 60 | + static function(array $mapping) { |
|
| 61 | 61 | return \function_exists($mapping['alternativeName']) && (new \ReflectionFunction($mapping['alternativeName']))->isInternal(); |
| 62 | 62 | } |
| 63 | 63 | ); |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | } elseif (\strlen($jump) > 1 && '0' === $jump[0]) { |
| 212 | 212 | $jump = octdec($jump); // octal 01 |
| 213 | 213 | } elseif (1 === Preg::match('#^\d+$#', $jump)) { // positive int |
| 214 | - $jump = (float) $jump; // cast to float, might be a number bigger than PHP max. int value |
|
| 214 | + $jump = (float)$jump; // cast to float, might be a number bigger than PHP max. int value |
|
| 215 | 215 | } else { |
| 216 | 216 | return $afterFollowingContinueIndex; // cannot process value, ignore |
| 217 | 217 | } |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | return $afterFollowingContinueIndex; // cannot process value, ignore |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - $jump = (int) $jump; |
|
| 223 | + $jump = (int)$jump; |
|
| 224 | 224 | |
| 225 | 225 | if ($isInSwitch && (1 === $jump || 0 === $jump)) { |
| 226 | 226 | $this->replaceContinueWithBreakToken($tokens, $continueIndex); // long continue 0/1 notation |