@@ -48,20 +48,20 @@ |
||
| 48 | 48 | { |
| 49 | 49 | foreach (self::$sizes as $unit => $value) { |
| 50 | 50 | if ($bytes >= $value) { |
| 51 | - return \sprintf('%.2f %s', $bytes >= 1024 ? $bytes / $value : $bytes, $unit); |
|
| 51 | + return \sprintf('%.2f %s', $bytes >= 1024 ? $bytes/$value : $bytes, $unit); |
|
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - return $bytes . ' byte' . ((int) $bytes !== 1 ? 's' : ''); |
|
| 55 | + return $bytes . ' byte' . ((int)$bytes !== 1 ? 's' : ''); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | public static function secondsToTimeString(float $time): string |
| 59 | 59 | { |
| 60 | - $ms = \round($time * 1000); |
|
| 60 | + $ms = \round($time*1000); |
|
| 61 | 61 | |
| 62 | 62 | foreach (self::$times as $unit => $value) { |
| 63 | 63 | if ($ms >= $value) { |
| 64 | - $time = \floor($ms / $value * 100.0) / 100.0; |
|
| 64 | + $time = \floor($ms/$value*100.0)/100.0; |
|
| 65 | 65 | |
| 66 | 66 | return $time . ' ' . ($time == 1 ? $unit : $unit . 's'); |
| 67 | 67 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | public function testGetName() |
| 16 | 16 | { |
| 17 | 17 | $tokenStream = new PHP_Token_Stream( |
| 18 | - TEST_FILES_PATH . 'classInNamespace.php' |
|
| 18 | + TEST_FILES_PATH . 'classInNamespace.php' |
|
| 19 | 19 | ); |
| 20 | 20 | |
| 21 | 21 | foreach ($tokenStream as $token) { |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | $function1 = function($foo, $bar) use ($var) {}; |
| 3 | 3 | $function2 = function(Foo $foo, $bar) use ($var) {}; |
| 4 | -$function3 = function ($foo, $bar, $baz) {}; |
|
| 5 | -$function4 = function (Foo $foo, $bar, $baz) {}; |
|
| 6 | -$function5 = function () {}; |
|
| 4 | +$function3 = function($foo, $bar, $baz) {}; |
|
| 5 | +$function4 = function(Foo $foo, $bar, $baz) {}; |
|
| 6 | +$function5 = function() {}; |
|
| 7 | 7 | $function6 = function() {}; |
@@ -15,11 +15,11 @@ |
||
| 15 | 15 | } |
| 16 | 16 | }; |
| 17 | 17 | |
| 18 | - $f = function ($a, $b) { |
|
| 18 | + $f = function($a, $b) { |
|
| 19 | 19 | return $a + $b; |
| 20 | 20 | }; |
| 21 | 21 | |
| 22 | - $g = function ($a, $b) { |
|
| 22 | + $g = function($a, $b) { |
|
| 23 | 23 | return $a - $b; |
| 24 | 24 | }; |
| 25 | 25 | } |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | /** |
| 3 | 3 | * Some comment |
| 4 | 4 | */ |
| 5 | -class Foo{function foo(){} |
|
| 5 | +class Foo {function foo() {} |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * @param Baz $baz |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | class Test { |
| 3 | - public function methodOne() { |
|
| 4 | - $foo = new class { |
|
| 5 | - public function method_in_anonymous_class() { |
|
| 6 | - return true; |
|
| 7 | - } |
|
| 8 | - }; |
|
| 3 | + public function methodOne() { |
|
| 4 | + $foo = new class { |
|
| 5 | + public function method_in_anonymous_class() { |
|
| 6 | + return true; |
|
| 7 | + } |
|
| 8 | + }; |
|
| 9 | 9 | |
| 10 | - return $foo->method_in_anonymous_class(); |
|
| 11 | - } |
|
| 10 | + return $foo->method_in_anonymous_class(); |
|
| 11 | + } |
|
| 12 | 12 | |
| 13 | - public function methodTwo() { |
|
| 14 | - return false; |
|
| 15 | - } |
|
| 13 | + public function methodTwo() { |
|
| 14 | + return false; |
|
| 15 | + } |
|
| 16 | 16 | } |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | public function method() |
| 8 | 8 | { |
| 9 | 9 | $o = new class { public function foo() {} }; |
| 10 | - $o = new class{public function foo(){}}; |
|
| 10 | + $o = new class{public function foo() {}}; |
|
| 11 | 11 | $o = new class extends stdClass {}; |
| 12 | 12 | $o = new class extends stdClass {}; |
| 13 | 13 | $o = new class implements foo {}; |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | public function even($numbers) |
| 6 | 6 | { |
| 7 | 7 | $numbers = array_filter($numbers, function($number) { |
| 8 | - return $number % 2 === 0; |
|
| 8 | + return $number%2 === 0; |
|
| 9 | 9 | }); |
| 10 | 10 | |
| 11 | 11 | return array_merge($numbers); |
@@ -296,10 +296,10 @@ discard block |
||
| 296 | 296 | { |
| 297 | 297 | if ($this->includes === null) { |
| 298 | 298 | $this->includes = [ |
| 299 | - 'require_once' => [], |
|
| 300 | - 'require' => [], |
|
| 301 | - 'include_once' => [], |
|
| 302 | - 'include' => [] |
|
| 299 | + 'require_once' => [], |
|
| 300 | + 'require' => [], |
|
| 301 | + 'include_once' => [], |
|
| 302 | + 'include' => [] |
|
| 303 | 303 | ]; |
| 304 | 304 | |
| 305 | 305 | foreach ($this->tokens as $token) { |
@@ -367,29 +367,29 @@ discard block |
||
| 367 | 367 | $interfaceEndLine = $token->getEndLine(); |
| 368 | 368 | |
| 369 | 369 | $this->interfaces[$interface] = [ |
| 370 | - 'methods' => [], |
|
| 371 | - 'parent' => $token->getParent(), |
|
| 372 | - 'keywords' => $token->getKeywords(), |
|
| 373 | - 'docblock' => $token->getDocblock(), |
|
| 374 | - 'startLine' => $token->getLine(), |
|
| 375 | - 'endLine' => $interfaceEndLine, |
|
| 376 | - 'package' => $token->getPackage(), |
|
| 377 | - 'file' => $this->filename |
|
| 370 | + 'methods' => [], |
|
| 371 | + 'parent' => $token->getParent(), |
|
| 372 | + 'keywords' => $token->getKeywords(), |
|
| 373 | + 'docblock' => $token->getDocblock(), |
|
| 374 | + 'startLine' => $token->getLine(), |
|
| 375 | + 'endLine' => $interfaceEndLine, |
|
| 376 | + 'package' => $token->getPackage(), |
|
| 377 | + 'file' => $this->filename |
|
| 378 | 378 | ]; |
| 379 | 379 | break; |
| 380 | 380 | |
| 381 | 381 | case 'PHP_Token_CLASS': |
| 382 | 382 | case 'PHP_Token_TRAIT': |
| 383 | 383 | $tmp = [ |
| 384 | - 'methods' => [], |
|
| 385 | - 'parent' => $token->getParent(), |
|
| 386 | - 'interfaces'=> $token->getInterfaces(), |
|
| 387 | - 'keywords' => $token->getKeywords(), |
|
| 388 | - 'docblock' => $token->getDocblock(), |
|
| 389 | - 'startLine' => $token->getLine(), |
|
| 390 | - 'endLine' => $token->getEndLine(), |
|
| 391 | - 'package' => $token->getPackage(), |
|
| 392 | - 'file' => $this->filename |
|
| 384 | + 'methods' => [], |
|
| 385 | + 'parent' => $token->getParent(), |
|
| 386 | + 'interfaces'=> $token->getInterfaces(), |
|
| 387 | + 'keywords' => $token->getKeywords(), |
|
| 388 | + 'docblock' => $token->getDocblock(), |
|
| 389 | + 'startLine' => $token->getLine(), |
|
| 390 | + 'endLine' => $token->getEndLine(), |
|
| 391 | + 'package' => $token->getPackage(), |
|
| 392 | + 'file' => $this->filename |
|
| 393 | 393 | ]; |
| 394 | 394 | |
| 395 | 395 | if ($token->getName() !== null) { |
@@ -409,14 +409,14 @@ discard block |
||
| 409 | 409 | case 'PHP_Token_FUNCTION': |
| 410 | 410 | $name = $token->getName(); |
| 411 | 411 | $tmp = [ |
| 412 | - 'docblock' => $token->getDocblock(), |
|
| 413 | - 'keywords' => $token->getKeywords(), |
|
| 414 | - 'visibility'=> $token->getVisibility(), |
|
| 415 | - 'signature' => $token->getSignature(), |
|
| 416 | - 'startLine' => $token->getLine(), |
|
| 417 | - 'endLine' => $token->getEndLine(), |
|
| 418 | - 'ccn' => $token->getCCN(), |
|
| 419 | - 'file' => $this->filename |
|
| 412 | + 'docblock' => $token->getDocblock(), |
|
| 413 | + 'keywords' => $token->getKeywords(), |
|
| 414 | + 'visibility'=> $token->getVisibility(), |
|
| 415 | + 'signature' => $token->getSignature(), |
|
| 416 | + 'startLine' => $token->getLine(), |
|
| 417 | + 'endLine' => $token->getEndLine(), |
|
| 418 | + 'ccn' => $token->getCCN(), |
|
| 419 | + 'file' => $this->filename |
|
| 420 | 420 | ]; |
| 421 | 421 | |
| 422 | 422 | if (empty($class) && |