@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | // Sort matches by their score value |
86 | - @usort($matches, function ($match1, $match2) { return $match2[0] - $match1[0]; }); |
|
86 | + @usort($matches, function($match1, $match2) { return $match2[0] - $match1[0]; }); |
|
87 | 87 | |
88 | 88 | // If Highest rated method prophecy has a promise - execute it or return null instead |
89 | 89 | $returnValue = null; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | public function findCalls($methodName, ArgumentsWildcard $wildcard) |
119 | 119 | { |
120 | 120 | return array_values( |
121 | - array_filter($this->recordedCalls, function (Call $call) use ($methodName, $wildcard) { |
|
121 | + array_filter($this->recordedCalls, function(Call $call) use ($methodName, $wildcard) { |
|
122 | 122 | return $methodName === $call->getMethodName() |
123 | 123 | && 0 < $wildcard->scoreArguments($call->getArguments()) |
124 | 124 | ; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | { |
132 | 132 | $classname = get_class($prophecy->reveal()); |
133 | 133 | $argstring = implode(', ', array_map(array($this->util, 'stringify'), $arguments)); |
134 | - $expected = implode("\n", array_map(function (MethodProphecy $methodProphecy) { |
|
134 | + $expected = implode("\n", array_map(function(MethodProphecy $methodProphecy) { |
|
135 | 135 | return sprintf(' - %s(%s)', |
136 | 136 | $methodProphecy->getMethodName(), |
137 | 137 | $methodProphecy->getArgumentsWildcard() |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | |
141 | 141 | return new UnexpectedCallException( |
142 | 142 | sprintf( |
143 | - "Method call:\n". |
|
144 | - " - %s(%s)\n". |
|
143 | + "Method call:\n" . |
|
144 | + " - %s(%s)\n" . |
|
145 | 145 | "on %s was not expected, expected calls were:\n%s", |
146 | 146 | |
147 | 147 | $methodName, $argstring, $classname, $expected |
@@ -48,7 +48,7 @@ |
||
48 | 48 | |
49 | 49 | $tagList = $phpdoc->getTagsByName('method'); |
50 | 50 | |
51 | - foreach($tagList as $tag) { |
|
51 | + foreach ($tagList as $tag) { |
|
52 | 52 | $methodName = $tag->getMethodName(); |
53 | 53 | |
54 | 54 | if (!$reflectionClass->hasMethod($methodName)) { |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | public function __construct(ClassMirror $mirror = null, ClassCreator $creator = null, |
51 | 51 | NameGenerator $namer = null) |
52 | 52 | { |
53 | - $this->mirror = $mirror ?: new ClassMirror; |
|
53 | + $this->mirror = $mirror ?: new ClassMirror; |
|
54 | 54 | $this->creator = $creator ?: new ClassCreator; |
55 | - $this->namer = $namer ?: new NameGenerator; |
|
55 | + $this->namer = $namer ?: new NameGenerator; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | $this->patches[] = $patch; |
76 | 76 | |
77 | - @usort($this->patches, function (ClassPatchInterface $patch1, ClassPatchInterface $patch2) { |
|
77 | + @usort($this->patches, function(ClassPatchInterface $patch1, ClassPatchInterface $patch2) { |
|
78 | 78 | return $patch2->getPriority() - $patch1->getPriority(); |
79 | 79 | }); |
80 | 80 | } |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | foreach ($interfaces as $interface) { |
96 | 96 | if (!$interface instanceof ReflectionClass) { |
97 | 97 | throw new InvalidArgumentException(sprintf( |
98 | - "[ReflectionClass \$interface1 [, ReflectionClass \$interface2]] array expected as\n". |
|
98 | + "[ReflectionClass \$interface1 [, ReflectionClass \$interface2]] array expected as\n" . |
|
99 | 99 | "a second argument to `Doubler::double(...)`, but got %s.", |
100 | - is_object($interface) ? get_class($interface).' class' : gettype($interface) |
|
100 | + is_object($interface) ? get_class($interface) . ' class' : gettype($interface) |
|
101 | 101 | )); |
102 | 102 | } |
103 | 103 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | $code = sprintf("class %s extends \%s implements %s {\n", |
37 | 37 | $classname, $class->getParentClass(), implode(', ', |
38 | - array_map(function ($interface) {return '\\'.$interface;}, $class->getInterfaces()) |
|
38 | + array_map(function($interface) {return '\\' . $interface; }, $class->getInterfaces()) |
|
39 | 39 | ) |
40 | 40 | ); |
41 | 41 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $code .= "\n"; |
46 | 46 | |
47 | 47 | foreach ($class->getMethods() as $method) { |
48 | - $code .= $this->generateMethod($method)."\n"; |
|
48 | + $code .= $this->generateMethod($method) . "\n"; |
|
49 | 49 | } |
50 | 50 | $code .= "\n}"; |
51 | 51 | |
@@ -57,33 +57,33 @@ discard block |
||
57 | 57 | $php = sprintf("%s %s function %s%s(%s)%s {\n", |
58 | 58 | $method->getVisibility(), |
59 | 59 | $method->isStatic() ? 'static' : '', |
60 | - $method->returnsReference() ? '&':'', |
|
60 | + $method->returnsReference() ? '&' : '', |
|
61 | 61 | $method->getName(), |
62 | 62 | implode(', ', $this->generateArguments($method->getArguments())), |
63 | 63 | $method->hasReturnType() ? sprintf(': %s', $method->getReturnType()) : '' |
64 | 64 | ); |
65 | - $php .= $method->getCode()."\n"; |
|
65 | + $php .= $method->getCode() . "\n"; |
|
66 | 66 | |
67 | - return $php.'}'; |
|
67 | + return $php . '}'; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | private function generateArguments(array $arguments) |
71 | 71 | { |
72 | - return array_map(function (Node\ArgumentNode $argument) { |
|
72 | + return array_map(function(Node\ArgumentNode $argument) { |
|
73 | 73 | $php = ''; |
74 | 74 | |
75 | 75 | if ($hint = $argument->getTypeHint()) { |
76 | 76 | if ('array' === $hint || 'callable' === $hint) { |
77 | 77 | $php .= $hint; |
78 | 78 | } else { |
79 | - $php .= '\\'.$hint; |
|
79 | + $php .= '\\' . $hint; |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | - $php .= ' '.($argument->isPassedByReference() ? '&' : '').'$'.$argument->getName(); |
|
83 | + $php .= ' ' . ($argument->isPassedByReference() ? '&' : '') . '$' . $argument->getName(); |
|
84 | 84 | |
85 | 85 | if ($argument->isOptional()) { |
86 | - $php .= ' = '.var_export($argument->getDefault(), true); |
|
86 | + $php .= ' = ' . var_export($argument->getDefault(), true); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | return $php; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | if (null !== $class) { |
52 | 52 | if (true === $class->isInterface()) { |
53 | 53 | throw new InvalidArgumentException(sprintf( |
54 | - "Could not reflect %s as a class, because it\n". |
|
54 | + "Could not reflect %s as a class, because it\n" . |
|
55 | 55 | "is interface - use the second argument instead.", |
56 | 56 | $class->getName() |
57 | 57 | )); |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | foreach ($interfaces as $interface) { |
64 | 64 | if (!$interface instanceof ReflectionClass) { |
65 | 65 | throw new InvalidArgumentException(sprintf( |
66 | - "[ReflectionClass \$interface1 [, ReflectionClass \$interface2]] array expected as\n". |
|
66 | + "[ReflectionClass \$interface1 [, ReflectionClass \$interface2]] array expected as\n" . |
|
67 | 67 | "a second argument to `ClassMirror::reflect(...)`, but got %s.", |
68 | - is_object($interface) ? get_class($interface).' class' : gettype($interface) |
|
68 | + is_object($interface) ? get_class($interface) . ' class' : gettype($interface) |
|
69 | 69 | )); |
70 | 70 | } |
71 | 71 | if (false === $interface->isInterface()) { |
72 | 72 | throw new InvalidArgumentException(sprintf( |
73 | - "Could not reflect %s as an interface, because it\n". |
|
73 | + "Could not reflect %s as an interface, because it\n" . |
|
74 | 74 | "is class - use the first argument instead.", |
75 | 75 | $interface->getName() |
76 | 76 | )); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | /** |
28 | 28 | * @var MethodNode[] |
29 | 29 | */ |
30 | - private $methods = array(); |
|
30 | + private $methods = array(); |
|
31 | 31 | |
32 | 32 | public function getParentClass() |
33 | 33 | { |
@@ -170,7 +170,7 @@ |
||
170 | 170 | { |
171 | 171 | $this->code = sprintf( |
172 | 172 | 'return parent::%s(%s);', $this->getName(), implode(', ', |
173 | - array_map(function (ArgumentNode $arg) { return '$'.$arg->getName(); }, $this->arguments) |
|
173 | + array_map(function(ArgumentNode $arg) { return '$' . $arg->getName(); }, $this->arguments) |
|
174 | 174 | ) |
175 | 175 | ); |
176 | 176 | } |
@@ -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()), |