@@ -21,9 +21,9 @@ |
||
21 | 21 | public function append(PredictionException $exception) |
22 | 22 | { |
23 | 23 | $message = $exception->getMessage(); |
24 | - $message = ' '.strtr($message, array("\n" => "\n "))."\n"; |
|
24 | + $message = ' ' . strtr($message, array("\n" => "\n ")) . "\n"; |
|
25 | 25 | |
26 | - $this->message = rtrim($this->message.$message); |
|
26 | + $this->message = rtrim($this->message . $message); |
|
27 | 27 | $this->exceptions[] = $exception; |
28 | 28 | } |
29 | 29 |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | |
61 | 61 | if (count($methodCalls)) { |
62 | 62 | throw new NoCallsException(sprintf( |
63 | - "No calls have been made that match:\n". |
|
64 | - " %s->%s(%s)\n". |
|
65 | - "but expected at least one.\n". |
|
63 | + "No calls have been made that match:\n" . |
|
64 | + " %s->%s(%s)\n" . |
|
65 | + "but expected at least one.\n" . |
|
66 | 66 | "Recorded `%s(...)` calls:\n%s", |
67 | 67 | |
68 | 68 | get_class($object->reveal()), |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | throw new NoCallsException(sprintf( |
77 | - "No calls have been made that match:\n". |
|
78 | - " %s->%s(%s)\n". |
|
77 | + "No calls have been made that match:\n" . |
|
78 | + " %s->%s(%s)\n" . |
|
79 | 79 | "but expected at least one.", |
80 | 80 | |
81 | 81 | get_class($object->reveal()), |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | |
65 | 65 | if (count($calls)) { |
66 | 66 | $message = sprintf( |
67 | - "Expected exactly %d calls that match:\n". |
|
68 | - " %s->%s(%s)\n". |
|
67 | + "Expected exactly %d calls that match:\n" . |
|
68 | + " %s->%s(%s)\n" . |
|
69 | 69 | "but %d were made:\n%s", |
70 | 70 | |
71 | 71 | $this->times, |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | ); |
78 | 78 | } elseif (count($methodCalls)) { |
79 | 79 | $message = sprintf( |
80 | - "Expected exactly %d calls that match:\n". |
|
81 | - " %s->%s(%s)\n". |
|
82 | - "but none were made.\n". |
|
80 | + "Expected exactly %d calls that match:\n" . |
|
81 | + " %s->%s(%s)\n" . |
|
82 | + "but none were made.\n" . |
|
83 | 83 | "Recorded `%s(...)` calls:\n%s", |
84 | 84 | |
85 | 85 | $this->times, |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | ); |
92 | 92 | } else { |
93 | 93 | $message = sprintf( |
94 | - "Expected exactly %d calls that match:\n". |
|
95 | - " %s->%s(%s)\n". |
|
94 | + "Expected exactly %d calls that match:\n" . |
|
95 | + " %s->%s(%s)\n" . |
|
96 | 96 | "but none were made.", |
97 | 97 | |
98 | 98 | $this->times, |
@@ -54,8 +54,8 @@ |
||
54 | 54 | $verb = count($calls) === 1 ? 'was' : 'were'; |
55 | 55 | |
56 | 56 | throw new UnexpectedCallsException(sprintf( |
57 | - "No calls expected that match:\n". |
|
58 | - " %s->%s(%s)\n". |
|
57 | + "No calls expected that match:\n" . |
|
58 | + " %s->%s(%s)\n" . |
|
59 | 59 | "but %d %s made:\n%s", |
60 | 60 | get_class($object->reveal()), |
61 | 61 | $method->getMethodName(), |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | if (null === $double || !$double instanceof ProphecySubjectInterface) { |
117 | 117 | throw new ObjectProphecyException( |
118 | - "Generated double must implement ProphecySubjectInterface, but it does not.\n". |
|
118 | + "Generated double must implement ProphecySubjectInterface, but it does not.\n" . |
|
119 | 119 | 'It seems you have wrongly configured doubler without required ClassPatch.', |
120 | 120 | $this |
121 | 121 | ); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $argumentsWildcard = $methodProphecy->getArgumentsWildcard(); |
140 | 140 | if (null === $argumentsWildcard) { |
141 | 141 | throw new MethodProphecyException(sprintf( |
142 | - "Can not add prophecy for a method `%s::%s()`\n". |
|
142 | + "Can not add prophecy for a method `%s::%s()`\n" . |
|
143 | 143 | "as you did not specify arguments wildcard for it.", |
144 | 144 | get_class($this->reveal()), |
145 | 145 | $methodProphecy->getMethodName() |
@@ -176,7 +176,7 @@ |
||
176 | 176 | ); |
177 | 177 | } |
178 | 178 | |
179 | - if (is_double($value) && (double)(integer) $value === $value) { |
|
179 | + if (is_double($value) && (double) (integer) $value === $value) { |
|
180 | 180 | return $value . '.0'; |
181 | 181 | } |
182 | 182 |
@@ -32,18 +32,18 @@ discard block |
||
32 | 32 | { |
33 | 33 | if (is_array($value)) { |
34 | 34 | if (range(0, count($value) - 1) === array_keys($value)) { |
35 | - return '['.implode(', ', array_map(array($this, __FUNCTION__), $value)).']'; |
|
35 | + return '[' . implode(', ', array_map(array($this, __FUNCTION__), $value)) . ']'; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $stringify = array($this, __FUNCTION__); |
39 | 39 | |
40 | - return '['.implode(', ', array_map(function ($item, $key) use ($stringify) { |
|
41 | - return (is_integer($key) ? $key : '"'.$key.'"'). |
|
42 | - ' => '.call_user_func($stringify, $item); |
|
43 | - }, $value, array_keys($value))).']'; |
|
40 | + return '[' . implode(', ', array_map(function($item, $key) use ($stringify) { |
|
41 | + return (is_integer($key) ? $key : '"' . $key . '"') . |
|
42 | + ' => ' . call_user_func($stringify, $item); |
|
43 | + }, $value, array_keys($value))) . ']'; |
|
44 | 44 | } |
45 | 45 | if (is_resource($value)) { |
46 | - return get_resource_type($value).':'.$value; |
|
46 | + return get_resource_type($value) . ':' . $value; |
|
47 | 47 | } |
48 | 48 | if (is_object($value)) { |
49 | 49 | return $exportObject ? ExportUtil::export($value) : sprintf('%s:%s', get_class($value), spl_object_hash($value)); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $str = sprintf('"%s"', str_replace("\n", '\\n', $value)); |
56 | 56 | |
57 | 57 | if (50 <= strlen($str)) { |
58 | - return substr($str, 0, 50).'"...'; |
|
58 | + return substr($str, 0, 50) . '"...'; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | return $str; |
@@ -78,11 +78,11 @@ discard block |
||
78 | 78 | { |
79 | 79 | $self = $this; |
80 | 80 | |
81 | - return implode(PHP_EOL, array_map(function (Call $call) use ($self) { |
|
81 | + return implode(PHP_EOL, array_map(function(Call $call) use ($self) { |
|
82 | 82 | return sprintf(' - %s(%s) @ %s', |
83 | 83 | $call->getMethodName(), |
84 | 84 | implode(', ', array_map(array($self, 'stringify'), $call->getArguments())), |
85 | - str_replace(GETCWD().DIRECTORY_SEPARATOR, '', $call->getCallPlace()) |
|
85 | + str_replace(GETCWD() . DIRECTORY_SEPARATOR, '', $call->getCallPlace()) |
|
86 | 86 | ); |
87 | 87 | }, $calls)); |
88 | 88 | } |
@@ -77,8 +77,8 @@ |
||
77 | 77 | |
78 | 78 | $methodCount = 0; |
79 | 79 | for ($i = $method['startLine']; |
80 | - $i <= $method['endLine']; |
|
81 | - $i++) { |
|
80 | + $i <= $method['endLine']; |
|
81 | + $i++) { |
|
82 | 82 | if (isset($coverage[$i]) && ($coverage[$i] !== null)) { |
83 | 83 | $methodCount = max($methodCount, count($coverage[$i])); |
84 | 84 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $classMethods = 0; |
65 | 65 | |
66 | 66 | foreach ($class['methods'] as $methodName => $method) { |
67 | - if ($method['executableLines'] == 0) { |
|
67 | + if ($method['executableLines'] == 0) { |
|
68 | 68 | continue; |
69 | 69 | } |
70 | 70 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | $methodCount = 0; |
79 | - for ($i = $method['startLine']; |
|
79 | + for ($i = $method['startLine']; |
|
80 | 80 | $i <= $method['endLine']; |
81 | 81 | $i++) { |
82 | 82 | if (isset($coverage[$i]) && ($coverage[$i] !== null)) { |
@@ -207,8 +207,8 @@ |
||
207 | 207 | while (!$done) { |
208 | 208 | for ($i = 0; $i < $max - 1; $i++) { |
209 | 209 | if (!isset($paths[$i][0]) || |
210 | - !isset($paths[$i+1][0]) || |
|
211 | - $paths[$i][0] != $paths[$i+1][0]) { |
|
210 | + !isset($paths[$i + 1][0]) || |
|
211 | + $paths[$i][0] != $paths[$i + 1][0]) { |
|
212 | 212 | $done = true; |
213 | 213 | break; |
214 | 214 | } |