@@ -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(), |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $reflectedMethod = new \ReflectionMethod($double, $methodName); |
| 59 | 59 | if ($reflectedMethod->isFinal()) { |
| 60 | 60 | throw new MethodProphecyException(sprintf( |
| 61 | - "Can not add prophecy for a method `%s::%s()`\n". |
|
| 61 | + "Can not add prophecy for a method `%s::%s()`\n" . |
|
| 62 | 62 | "as it is a final method.", |
| 63 | 63 | get_class($double), |
| 64 | 64 | $methodName |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | if (version_compare(PHP_VERSION, '7.0', '>=') && true === $reflectedMethod->hasReturnType()) { |
| 73 | 73 | $type = (string) $reflectedMethod->getReturnType(); |
| 74 | - $this->will(function () use ($type) { |
|
| 74 | + $this->will(function() use ($type) { |
|
| 75 | 75 | switch ($type) { |
| 76 | 76 | case 'string': return ''; |
| 77 | 77 | case 'float': return 0.0; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | case 'callable': |
| 83 | 83 | case 'Closure': |
| 84 | - return function () {}; |
|
| 84 | + return function() {}; |
|
| 85 | 85 | |
| 86 | 86 | case 'Traversable': |
| 87 | 87 | case 'Generator': |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | if (!$arguments instanceof Argument\ArgumentsWildcard) { |
| 116 | 116 | throw new InvalidArgumentException(sprintf( |
| 117 | - "Either an array or an instance of ArgumentsWildcard expected as\n". |
|
| 117 | + "Either an array or an instance of ArgumentsWildcard expected as\n" . |
|
| 118 | 118 | 'a `MethodProphecy::withArguments()` argument, but got %s.', |
| 119 | 119 | gettype($arguments) |
| 120 | 120 | )); |
@@ -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 | } |
@@ -726,7 +726,7 @@ |
||
| 726 | 726 | |
| 727 | 727 | // A DOC_COMMENT token or a COMMENT token starting with "/*" |
| 728 | 728 | // does not contain the final \n character in its text |
| 729 | - if (isset($lines[$i-1]) && 0 === strpos($_token, '/*') && '*/' === substr(trim($lines[$i-1]), -2)) { |
|
| 729 | + if (isset($lines[$i - 1]) && 0 === strpos($_token, '/*') && '*/' === substr(trim($lines[$i - 1]), -2)) { |
|
| 730 | 730 | $this->ignoredLines[$filename][] = $i; |
| 731 | 731 | } |
| 732 | 732 | } |
@@ -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 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | protected function renderItemTemplate(Text_Template $template, array $data) |
| 77 | 77 | { |
| 78 | - $numSeparator = ' / '; |
|
| 78 | + $numSeparator = ' / '; |
|
| 79 | 79 | |
| 80 | 80 | if (isset($data['numClasses']) && $data['numClasses'] > 0) { |
| 81 | 81 | $classesLevel = $this->getColorLevel($data['testedClassesPercent']); |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | if ($percent <= $this->lowUpperBound) { |
| 263 | 263 | return 'danger'; |
| 264 | 264 | } elseif ($percent > $this->lowUpperBound && |
| 265 | - $percent < $this->highLowerBound) { |
|
| 265 | + $percent < $this->highLowerBound) { |
|
| 266 | 266 | return 'warning'; |
| 267 | 267 | } else { |
| 268 | 268 | return 'success'; |