@@ -45,7 +45,7 @@ |
||
45 | 45 | */ |
46 | 46 | public function toString() |
47 | 47 | { |
48 | - return 'invoked at sequence index ' . $this->sequenceIndex; |
|
48 | + return 'invoked at sequence index '.$this->sequenceIndex; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function toString() |
36 | 36 | { |
37 | - return 'invoked at least ' . $this->requiredInvocations . ' times'; |
|
37 | + return 'invoked at least '.$this->requiredInvocations.' times'; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | |
50 | 50 | if ($count < $this->requiredInvocations) { |
51 | 51 | throw new ExpectationFailedException( |
52 | - 'Expected invocation at least ' . $this->requiredInvocations . |
|
53 | - ' times but it occurred ' . $count . ' time(s).' |
|
52 | + 'Expected invocation at least '.$this->requiredInvocations. |
|
53 | + ' times but it occurred '.$count.' time(s).' |
|
54 | 54 | ); |
55 | 55 | } |
56 | 56 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $text .= ' and'; |
66 | 66 | } |
67 | 67 | |
68 | - $text .= ' ' . $index . ' ' . $parameter->toString(); |
|
68 | + $text .= ' '.$index.' '.$parameter->toString(); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | return $text; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $parameter->evaluate( |
135 | 135 | $this->invocation->parameters[$i], |
136 | 136 | sprintf( |
137 | - 'Parameter %s for invocation %s does not match expected ' . |
|
137 | + 'Parameter %s for invocation %s does not match expected '. |
|
138 | 138 | 'value.', |
139 | 139 | $i, |
140 | 140 | $this->invocation->toString() |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function toString() |
48 | 48 | { |
49 | - return 'invoked ' . $this->expectedCount . ' time(s)'; |
|
49 | + return 'invoked '.$this->expectedCount.' time(s)'; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $count = $this->getInvocationCount(); |
62 | 62 | |
63 | 63 | if ($count > $this->expectedCount) { |
64 | - $message = $invocation->toString() . ' '; |
|
64 | + $message = $invocation->toString().' '; |
|
65 | 65 | |
66 | 66 | switch ($this->expectedCount) { |
67 | 67 | case 0: { |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | if ($count !== $this->expectedCount) { |
100 | 100 | throw new ExpectationFailedException( |
101 | 101 | sprintf( |
102 | - 'Method was expected to be called %d times, ' . |
|
102 | + 'Method was expected to be called %d times, '. |
|
103 | 103 | 'actually called %d times.', |
104 | 104 | $this->expectedCount, |
105 | 105 | $count |
@@ -55,7 +55,7 @@ |
||
55 | 55 | */ |
56 | 56 | public function toString() |
57 | 57 | { |
58 | - return 'method name ' . $this->constraint->toString(); |
|
58 | + return 'method name '.$this->constraint->toString(); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -118,7 +118,7 @@ |
||
118 | 118 | $parameter->evaluate( |
119 | 119 | $invocation->parameters[$i], |
120 | 120 | sprintf( |
121 | - 'Parameter %s for invocation #%d %s does not match expected ' . |
|
121 | + 'Parameter %s for invocation #%d %s does not match expected '. |
|
122 | 122 | 'value.', |
123 | 123 | $i, |
124 | 124 | $callIndex, |
@@ -83,7 +83,7 @@ |
||
83 | 83 | { |
84 | 84 | if (isset($this->builderMap[$id])) { |
85 | 85 | throw new PHPUnit_Framework_MockObject_RuntimeException( |
86 | - 'Match builder with id <' . $id . '> is already registered.' |
|
86 | + 'Match builder with id <'.$id.'> is already registered.' |
|
87 | 87 | ); |
88 | 88 | } |
89 | 89 |
@@ -72,19 +72,19 @@ |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | if ($this->methodNameMatcher !== null) { |
75 | - $list[] = 'where ' . $this->methodNameMatcher->toString(); |
|
75 | + $list[] = 'where '.$this->methodNameMatcher->toString(); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | if ($this->parametersMatcher !== null) { |
79 | - $list[] = 'and ' . $this->parametersMatcher->toString(); |
|
79 | + $list[] = 'and '.$this->parametersMatcher->toString(); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | if ($this->afterMatchBuilderId !== null) { |
83 | - $list[] = 'after ' . $this->afterMatchBuilderId; |
|
83 | + $list[] = 'after '.$this->afterMatchBuilderId; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | if ($this->stub !== null) { |
87 | - $list[] = 'will ' . $this->stub->toString(); |
|
87 | + $list[] = 'will '.$this->stub->toString(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | return implode(' ', $list); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | if (is_array($type)) { |
87 | 87 | $type = array_unique( |
88 | 88 | array_map( |
89 | - function ($type) { |
|
89 | + function($type) { |
|
90 | 90 | if ($type === 'Traversable' || |
91 | 91 | $type === '\\Traversable' || |
92 | 92 | $type === '\\Iterator') { |
@@ -462,10 +462,10 @@ discard block |
||
462 | 462 | |
463 | 463 | if ($mockClassName == '') { |
464 | 464 | $key = md5( |
465 | - is_array($type) ? implode('_', $type) : $type . |
|
466 | - serialize($methods) . |
|
467 | - serialize($callOriginalClone) . |
|
468 | - serialize($cloneArguments) . |
|
465 | + is_array($type) ? implode('_', $type) : $type. |
|
466 | + serialize($methods). |
|
467 | + serialize($callOriginalClone). |
|
468 | + serialize($cloneArguments). |
|
469 | 469 | serialize($callOriginalMethods) |
470 | 470 | ); |
471 | 471 | |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | $name = substr($method, $nameStart, $nameEnd - $nameStart); |
526 | 526 | |
527 | 527 | if (empty($methods) || in_array($name, $methods)) { |
528 | - $args = explode( |
|
528 | + $args = explode( |
|
529 | 529 | ',', |
530 | 530 | substr( |
531 | 531 | $method, |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | $optionsBuffer = 'array('; |
553 | 553 | |
554 | 554 | foreach ($options as $key => $value) { |
555 | - $optionsBuffer .= $key . ' => ' . $value; |
|
555 | + $optionsBuffer .= $key.' => '.$value; |
|
556 | 556 | } |
557 | 557 | |
558 | 558 | $optionsBuffer .= ')'; |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | if (strpos($className, '\\') !== false) { |
564 | 564 | $parts = explode('\\', $className); |
565 | 565 | $className = array_pop($parts); |
566 | - $namespace = 'namespace ' . implode('\\', $parts) . ';' . "\n\n"; |
|
566 | + $namespace = 'namespace '.implode('\\', $parts).';'."\n\n"; |
|
567 | 567 | } |
568 | 568 | |
569 | 569 | $classTemplate->setVar( |
@@ -653,11 +653,11 @@ discard block |
||
653 | 653 | } |
654 | 654 | |
655 | 655 | if (!$isClass && !$isInterface) { |
656 | - $prologue = 'class ' . $mockClassName['originalClassName'] . "\n{\n}\n\n"; |
|
656 | + $prologue = 'class '.$mockClassName['originalClassName']."\n{\n}\n\n"; |
|
657 | 657 | |
658 | 658 | if (!empty($mockClassName['namespaceName'])) { |
659 | - $prologue = 'namespace ' . $mockClassName['namespaceName'] . |
|
660 | - " {\n\n" . $prologue . "}\n\n" . |
|
659 | + $prologue = 'namespace '.$mockClassName['namespaceName']. |
|
660 | + " {\n\n".$prologue."}\n\n". |
|
661 | 661 | "namespace {\n\n"; |
662 | 662 | |
663 | 663 | $epilogue = "\n\n}"; |
@@ -782,9 +782,9 @@ discard block |
||
782 | 782 | 'mock_class_name' => $mockClassName['className'], |
783 | 783 | 'mocked_methods' => $mockedMethods, |
784 | 784 | 'method' => $method, |
785 | - 'configurable' => '[' . implode(', ', array_map(function ($m) { |
|
786 | - return '\'' . $m . '\''; |
|
787 | - }, $configurable)) . ']' |
|
785 | + 'configurable' => '['.implode(', ', array_map(function($m) { |
|
786 | + return '\''.$m.'\''; |
|
787 | + }, $configurable)).']' |
|
788 | 788 | ] |
789 | 789 | ); |
790 | 790 | |
@@ -816,7 +816,7 @@ discard block |
||
816 | 816 | if (count($classNameParts) > 1) { |
817 | 817 | $type = array_pop($classNameParts); |
818 | 818 | $namespaceName = implode('\\', $classNameParts); |
819 | - $fullClassName = $namespaceName . '\\' . $type; |
|
819 | + $fullClassName = $namespaceName.'\\'.$type; |
|
820 | 820 | } else { |
821 | 821 | $namespaceName = ''; |
822 | 822 | $fullClassName = $type; |
@@ -824,7 +824,7 @@ discard block |
||
824 | 824 | |
825 | 825 | if ($className == '') { |
826 | 826 | do { |
827 | - $className = $prefix . $type . '_' . |
|
827 | + $className = $prefix.$type.'_'. |
|
828 | 828 | substr(md5(mt_rand()), 0, 8); |
829 | 829 | } while (class_exists($className, false)); |
830 | 830 | } |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | $buffer .= ', '; |
863 | 863 | |
864 | 864 | if (!empty($mockClassName['namespaceName'])) { |
865 | - $buffer .= $mockClassName['namespaceName'] . '\\'; |
|
865 | + $buffer .= $mockClassName['namespaceName'].'\\'; |
|
866 | 866 | } |
867 | 867 | |
868 | 868 | $buffer .= $mockClassName['originalClassName']; |
@@ -871,7 +871,7 @@ discard block |
||
871 | 871 | $buffer .= sprintf( |
872 | 872 | '%s extends %s%s implements %s', |
873 | 873 | $mockClassName['className'], |
874 | - !empty($mockClassName['namespaceName']) ? $mockClassName['namespaceName'] . '\\' : '', |
|
874 | + !empty($mockClassName['namespaceName']) ? $mockClassName['namespaceName'].'\\' : '', |
|
875 | 875 | $mockClassName['originalClassName'], |
876 | 876 | $interfaces |
877 | 877 | ); |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | 'arguments_decl' => $argumentsForDeclaration, |
997 | 997 | 'arguments_call' => $argumentsForCall, |
998 | 998 | 'return_delim' => $returnType ? ': ' : '', |
999 | - 'return_type' => $allowsReturnNull ? '?' . $returnType : $returnType, |
|
999 | + 'return_type' => $allowsReturnNull ? '?'.$returnType : $returnType, |
|
1000 | 1000 | 'arguments_count' => !empty($argumentsForCall) ? count(explode(',', $argumentsForCall)) : 0, |
1001 | 1001 | 'class_name' => $className, |
1002 | 1002 | 'method_name' => $methodName, |
@@ -1054,13 +1054,13 @@ discard block |
||
1054 | 1054 | $parameters = []; |
1055 | 1055 | |
1056 | 1056 | foreach ($method->getParameters() as $i => $parameter) { |
1057 | - $name = '$' . $parameter->getName(); |
|
1057 | + $name = '$'.$parameter->getName(); |
|
1058 | 1058 | |
1059 | 1059 | /* Note: PHP extensions may use empty names for reference arguments |
1060 | 1060 | * or "..." for methods taking a variable number of arguments. |
1061 | 1061 | */ |
1062 | 1062 | if ($name === '$' || $name === '$...') { |
1063 | - $name = '$arg' . $i; |
|
1063 | + $name = '$arg'.$i; |
|
1064 | 1064 | } |
1065 | 1065 | |
1066 | 1066 | if ($parameter->isVariadic()) { |
@@ -1068,7 +1068,7 @@ discard block |
||
1068 | 1068 | continue; |
1069 | 1069 | } |
1070 | 1070 | |
1071 | - $name = '...' . $name; |
|
1071 | + $name = '...'.$name; |
|
1072 | 1072 | } |
1073 | 1073 | |
1074 | 1074 | $nullable = ''; |
@@ -1082,7 +1082,7 @@ discard block |
||
1082 | 1082 | $nullable = '?'; |
1083 | 1083 | } |
1084 | 1084 | |
1085 | - $typeDeclaration = (string) $parameter->getType() . ' '; |
|
1085 | + $typeDeclaration = (string) $parameter->getType().' '; |
|
1086 | 1086 | } elseif ($parameter->isArray()) { |
1087 | 1087 | $typeDeclaration = 'array '; |
1088 | 1088 | } elseif ($parameter->isCallable()) { |
@@ -1093,7 +1093,7 @@ discard block |
||
1093 | 1093 | } catch (ReflectionException $e) { |
1094 | 1094 | throw new PHPUnit_Framework_MockObject_RuntimeException( |
1095 | 1095 | sprintf( |
1096 | - 'Cannot mock %s::%s() because a class or ' . |
|
1096 | + 'Cannot mock %s::%s() because a class or '. |
|
1097 | 1097 | 'interface used in the signature is not loaded', |
1098 | 1098 | $method->getDeclaringClass()->getName(), |
1099 | 1099 | $method->getName() |
@@ -1104,14 +1104,14 @@ discard block |
||
1104 | 1104 | } |
1105 | 1105 | |
1106 | 1106 | if ($class !== null) { |
1107 | - $typeDeclaration = $class->getName() . ' '; |
|
1107 | + $typeDeclaration = $class->getName().' '; |
|
1108 | 1108 | } |
1109 | 1109 | } |
1110 | 1110 | |
1111 | 1111 | if (!$parameter->isVariadic()) { |
1112 | 1112 | if ($parameter->isDefaultValueAvailable()) { |
1113 | 1113 | $value = $parameter->getDefaultValue(); |
1114 | - $default = ' = ' . var_export($value, true); |
|
1114 | + $default = ' = '.var_export($value, true); |
|
1115 | 1115 | } elseif ($parameter->isOptional()) { |
1116 | 1116 | $default = ' = null'; |
1117 | 1117 | } |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | $reference = '&'; |
1123 | 1123 | } |
1124 | 1124 | |
1125 | - $parameters[] = $nullable . $typeDeclaration . $reference . $name . $default; |
|
1125 | + $parameters[] = $nullable.$typeDeclaration.$reference.$name.$default; |
|
1126 | 1126 | } |
1127 | 1127 | |
1128 | 1128 | return implode(', ', $parameters); |
@@ -1154,7 +1154,7 @@ discard block |
||
1154 | 1154 | */ |
1155 | 1155 | private function getTemplate($template) |
1156 | 1156 | { |
1157 | - $filename = __DIR__ . DIRECTORY_SEPARATOR . 'Generator' . DIRECTORY_SEPARATOR . $template; |
|
1157 | + $filename = __DIR__.DIRECTORY_SEPARATOR.'Generator'.DIRECTORY_SEPARATOR.$template; |
|
1158 | 1158 | |
1159 | 1159 | if (!isset(self::$templates[$filename])) { |
1160 | 1160 | self::$templates[$filename] = new Text_Template($filename); |