@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types = 1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | namespace TheSeer\Tokenizer; |
3 | 3 | |
4 | 4 | use PHPUnit\Framework\TestCase; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | private $token; |
10 | 10 | |
11 | 11 | protected function setUp() { |
12 | - $this->token = new Token(1,'test-dummy', 'blank'); |
|
12 | + $this->token = new Token(1, 'test-dummy', 'blank'); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | public function testTokenCanBeCreated() { |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types = 1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | namespace TheSeer\Tokenizer; |
3 | 3 | |
4 | 4 | use PHPUnit\Framework\TestCase; |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | |
11 | 11 | public function testValidSourceGetsParsed() { |
12 | 12 | $tokenizer = new Tokenizer(); |
13 | - $result = $tokenizer->parse(file_get_contents(__DIR__ . '/_files/test.php')); |
|
13 | + $result = $tokenizer->parse(file_get_contents(__DIR__.'/_files/test.php')); |
|
14 | 14 | |
15 | 15 | $expected = unserialize( |
16 | - file_get_contents(__DIR__ . '/_files/test.php.tokens'), |
|
16 | + file_get_contents(__DIR__.'/_files/test.php.tokens'), |
|
17 | 17 | [TokenCollection::class] |
18 | 18 | ); |
19 | 19 | $this->assertEquals($expected, $result); |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types = 1); |
|
1 | +<?php declare(strict_types=1); |
|
2 | 2 | namespace TheSeer\Tokenizer; |
3 | 3 | |
4 | 4 | use PHPUnit\Framework\TestCase; |
@@ -64,11 +64,11 @@ |
||
64 | 64 | $namespace .= self::OPERATOR_NAMESPACE; |
65 | 65 | } |
66 | 66 | |
67 | - return new Fqsen(self::OPERATOR_NAMESPACE . $namespace . $type); |
|
67 | + return new Fqsen(self::OPERATOR_NAMESPACE.$namespace.$type); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $typeParts[0] = $namespaceAliases[$typeParts[0]]; |
71 | 71 | |
72 | - return new Fqsen(self::OPERATOR_NAMESPACE . implode(self::OPERATOR_NAMESPACE, $typeParts)); |
|
72 | + return new Fqsen(self::OPERATOR_NAMESPACE.implode(self::OPERATOR_NAMESPACE, $typeParts)); |
|
73 | 73 | } |
74 | 74 | } |
@@ -58,9 +58,9 @@ |
||
58 | 58 | $objectType = (string) ($this->fqsen ?? 'object'); |
59 | 59 | |
60 | 60 | if ($this->keyType === null) { |
61 | - return $objectType . '<' . $this->valueType . '>'; |
|
61 | + return $objectType.'<'.$this->valueType.'>'; |
|
62 | 62 | } |
63 | 63 | |
64 | - return $objectType . '<' . $this->keyType . ',' . $this->valueType . '>'; |
|
64 | + return $objectType.'<'.$this->keyType.','.$this->valueType.'>'; |
|
65 | 65 | } |
66 | 66 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | if (strpos((string) $fqsen, '::') !== false || strpos((string) $fqsen, '()') !== false) { |
41 | 41 | throw new InvalidArgumentException( |
42 | 42 | 'Object types can only refer to a class, interface or trait but a method, function, constant or ' |
43 | - . 'property was received: ' . (string) $fqsen |
|
43 | + . 'property was received: '.(string) $fqsen |
|
44 | 44 | ); |
45 | 45 | } |
46 | 46 |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | return $this->createFromReflectionClassConstant($reflector); |
84 | 84 | } |
85 | 85 | |
86 | - throw new UnexpectedValueException('Unhandled \Reflector instance given: ' . get_class($reflector)); |
|
86 | + throw new UnexpectedValueException('Unhandled \Reflector instance given: '.get_class($reflector)); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | private function createFromReflectionParameter(ReflectionParameter $parameter) : Context |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | return $this->createFromReflectionClass($class); |
94 | 94 | } |
95 | 95 | |
96 | - throw new InvalidArgumentException('Unable to get class of ' . $parameter->getName()); |
|
96 | + throw new InvalidArgumentException('Unable to get class of '.$parameter->getName()); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | private function createFromReflectionMethod(ReflectionMethod $method) : Context |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | if (is_string($fileName) && file_exists($fileName)) { |
120 | 120 | $contents = file_get_contents($fileName); |
121 | 121 | if ($contents === false) { |
122 | - throw new RuntimeException('Unable to read file "' . $fileName . '"'); |
|
122 | + throw new RuntimeException('Unable to read file "'.$fileName.'"'); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | return $this->createForNamespace($namespace, $contents); |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | case T_STRING: |
262 | 262 | case T_NS_SEPARATOR: |
263 | 263 | $currentNs .= $tokenValue; |
264 | - $currentAlias = $tokenValue; |
|
264 | + $currentAlias = $tokenValue; |
|
265 | 265 | break; |
266 | 266 | case T_CURLY_OPEN: |
267 | 267 | case '{': |
@@ -44,6 +44,6 @@ |
||
44 | 44 | */ |
45 | 45 | public function __toString() : string |
46 | 46 | { |
47 | - return '?' . $this->realType->__toString(); |
|
47 | + return '?'.$this->realType->__toString(); |
|
48 | 48 | } |
49 | 49 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | public function __toString() : string |
70 | 70 | { |
71 | 71 | if ($this->keyType) { |
72 | - return 'array<' . $this->keyType . ',' . $this->valueType . '>'; |
|
72 | + return 'array<'.$this->keyType.','.$this->valueType.'>'; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | if ($this->valueType instanceof Mixed_) { |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | if ($this->valueType instanceof Compound) { |
80 | - return '(' . $this->valueType . ')[]'; |
|
80 | + return '('.$this->valueType.')[]'; |
|
81 | 81 | } |
82 | 82 | |
83 | - return $this->valueType . '[]'; |
|
83 | + return $this->valueType.'[]'; |
|
84 | 84 | } |
85 | 85 | } |