@@ -30,7 +30,7 @@ |
||
30 | 30 | /** @var Readable $file */ |
31 | 31 | $file = $opcode->getOperand(0); |
32 | 32 | |
33 | - if (! $file instanceof Readable) { |
|
33 | + if (!$file instanceof Readable) { |
|
34 | 34 | $error = 'First operand of (#%d) %s should be instance of %s'; |
35 | 35 | throw new VmException($opcode, $error, $opcode->getId(), $opcode->getName(), Readable::class); |
36 | 36 | } |
@@ -55,8 +55,8 @@ |
||
55 | 55 | */ |
56 | 56 | foreach ($runtime->execute($opcodes) as $opcode => $result) { |
57 | 57 | if ($this->logger) { |
58 | - $value = \get_class($result) . '#' . \spl_object_hash($result); |
|
59 | - $message = \sprintf('%4s = %s', '#' . $opcode->getId(), $value); |
|
58 | + $value = \get_class($result).'#'.\spl_object_hash($result); |
|
59 | + $message = \sprintf('%4s = %s', '#'.$opcode->getId(), $value); |
|
60 | 60 | |
61 | 61 | $this->logger->debug($message); |
62 | 62 | } |
@@ -54,7 +54,7 @@ |
||
54 | 54 | { |
55 | 55 | $queue = $this->priorities[$index] ?? null; |
56 | 56 | |
57 | - if (! $queue) { |
|
57 | + if (!$queue) { |
|
58 | 58 | $this->priorities[$index] = new \SplQueue(); |
59 | 59 | } |
60 | 60 |
@@ -27,6 +27,6 @@ |
||
27 | 27 | /** @var LeafInterface $token */ |
28 | 28 | $token = $this->getChild(0); |
29 | 29 | |
30 | - return new ConstantValue((string)$token->getValue(), $this->getOffset()); |
|
30 | + return new ConstantValue((string) $token->getValue(), $this->getOffset()); |
|
31 | 31 | } |
32 | 32 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | private function renderUtfSequences(string $body): string |
95 | 95 | { |
96 | - $callee = function (array $matches): string { |
|
96 | + $callee = function(array $matches): string { |
|
97 | 97 | [$char, $code] = [$matches[0], $matches[1]]; |
98 | 98 | |
99 | 99 | try { |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | { |
124 | 124 | try { |
125 | 125 | if (\function_exists('\\json_decode')) { |
126 | - $result = @\json_decode('{"char": "' . $body . '"}')->char; |
|
126 | + $result = @\json_decode('{"char": "'.$body.'"}')->char; |
|
127 | 127 | |
128 | 128 | if (\json_last_error() === \JSON_ERROR_NONE) { |
129 | 129 | $body = $result; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | private function renderSpecialCharacters(string $body): string |
145 | 145 | { |
146 | - $callee = function (array $matches): string { |
|
146 | + $callee = function(array $matches): string { |
|
147 | 147 | [$char, $code] = [$matches[0], $matches[1]]; |
148 | 148 | |
149 | 149 | switch ($code) { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | return new IntValue($value, $this->getOffset()); |
33 | 33 | } |
34 | 34 | |
35 | - return new FloatValue((float)$value, $this->getOffset()); |
|
35 | + return new FloatValue((float) $value, $this->getOffset()); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | return $this->parseInt($value->getValue()); |
61 | 61 | } |
62 | 62 | |
63 | - return (float)$value->getValue(); |
|
63 | + return (float) $value->getValue(); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | private function parseExponential(string $value): float |
116 | 116 | { |
117 | - return (float)$value; |
|
117 | + return (float) $value; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | private function parseFloat(string $value): float |
134 | 134 | { |
135 | - return (float)$value; |
|
135 | + return (float) $value; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
@@ -46,7 +46,7 @@ |
||
46 | 46 | */ |
47 | 47 | public function __construct() |
48 | 48 | { |
49 | - $this->parser = new Parser(); |
|
49 | + $this->parser = new Parser(); |
|
50 | 50 | $this->analyzer = new Analyzer(); |
51 | 51 | } |
52 | 52 |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | $this->file = $file; |
53 | 53 | $this->offset = $offset; |
54 | 54 | |
55 | - $this->description = function () use ($opcode): string { |
|
56 | - return \trim((string)(new \ReflectionObject($opcode))->getDocComment(), " \t\n\r\0\x0B/*"); |
|
55 | + $this->description = function() use ($opcode): string { |
|
56 | + return \trim((string) (new \ReflectionObject($opcode))->getDocComment(), " \t\n\r\0\x0B/*"); |
|
57 | 57 | }; |
58 | 58 | } |
59 | 59 | |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function getDescription(): string |
72 | 72 | { |
73 | - return \preg_replace_callback('/\$(\d+)/iu', function (array $m): string { |
|
74 | - return $this->operandToString($this->operands[(int)$m[1]] ?? null); |
|
73 | + return \preg_replace_callback('/\$(\d+)/iu', function(array $m): string { |
|
74 | + return $this->operandToString($this->operands[(int) $m[1]] ?? null); |
|
75 | 75 | }, ($this->description)()); |
76 | 76 | } |
77 | 77 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | public function __toString(): string |
122 | 122 | { |
123 | 123 | return \vsprintf('%4s | %-80s %s:%d', [ |
124 | - '#' . $this->getId(), |
|
124 | + '#'.$this->getId(), |
|
125 | 125 | parent::__toString(), |
126 | 126 | $this->getFile()->getPathname(), |
127 | 127 | $this->getLine(), |
@@ -51,7 +51,7 @@ |
||
51 | 51 | * @var ValueInterface $value |
52 | 52 | */ |
53 | 53 | foreach ($this->getValue() as $key => $value) { |
54 | - $result[] = $key->toString() . ': ' . (string)$value; |
|
54 | + $result[] = $key->toString().': '.(string) $value; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | return \sprintf('{%s}', \implode(', ', $result)); |