@@ -1951,7 +1951,7 @@ |
||
1951 | 1951 | { |
1952 | 1952 | $mock = mock('Foo'); |
1953 | 1953 | $mock->shouldReceive('a')->once()->andReturn('Spam!') |
1954 | - ->shouldNotReceive('b'); |
|
1954 | + ->shouldNotReceive('b'); |
|
1955 | 1955 | $mock->a(); |
1956 | 1956 | } |
1957 | 1957 |
@@ -233,8 +233,8 @@ discard block |
||
233 | 233 | |
234 | 234 | public function testReturnsValueOfClosure() |
235 | 235 | { |
236 | - $this->mock->shouldReceive('foo')->with(5)->andReturnUsing(function ($v) { |
|
237 | - return $v+1; |
|
236 | + $this->mock->shouldReceive('foo')->with(5)->andReturnUsing(function($v) { |
|
237 | + return $v + 1; |
|
238 | 238 | }); |
239 | 239 | $this->assertEquals(6, $this->mock->foo(5)); |
240 | 240 | } |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | |
444 | 444 | public function testExpectsArgumentsArrayAcceptAClosureThatValidatesPassedArguments() |
445 | 445 | { |
446 | - $closure = function ($odd, $even) { |
|
446 | + $closure = function($odd, $even) { |
|
447 | 447 | return ($odd % 2 != 0) && ($even % 2 == 0); |
448 | 448 | }; |
449 | 449 | $this->mock->shouldReceive('foo')->withArgs($closure); |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | |
453 | 453 | public function testExpectsArgumentsArrayThrowsExceptionWhenClosureEvaluatesToFalse() |
454 | 454 | { |
455 | - $closure = function ($odd, $even) { |
|
455 | + $closure = function($odd, $even) { |
|
456 | 456 | return ($odd % 2 != 0) && ($even % 2 == 0); |
457 | 457 | }; |
458 | 458 | $this->mock->shouldReceive('foo')->withArgs($closure); |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | |
464 | 464 | public function testExpectsArgumentsArrayClosureDoesNotThrowExceptionIfOptionalArgumentsAreMissing() |
465 | 465 | { |
466 | - $closure = function ($odd, $even, $sum = null) { |
|
466 | + $closure = function($odd, $even, $sum = null) { |
|
467 | 467 | $result = ($odd % 2 != 0) && ($even % 2 == 0); |
468 | 468 | if (!is_null($sum)) { |
469 | 469 | return $result && ($odd + $even == $sum); |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | |
477 | 477 | public function testExpectsArgumentsArrayClosureDoesNotThrowExceptionIfOptionalArgumentsMathTheExpectation() |
478 | 478 | { |
479 | - $closure = function ($odd, $even, $sum = null) { |
|
479 | + $closure = function($odd, $even, $sum = null) { |
|
480 | 480 | $result = ($odd % 2 != 0) && ($even % 2 == 0); |
481 | 481 | if (!is_null($sum)) { |
482 | 482 | return $result && ($odd + $even == $sum); |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | |
490 | 490 | public function testExpectsArgumentsArrayClosureThrowsExceptionIfOptionalArgumentsDontMatchTheExpectation() |
491 | 491 | { |
492 | - $closure = function ($odd, $even, $sum = null) { |
|
492 | + $closure = function($odd, $even, $sum = null) { |
|
493 | 493 | $result = ($odd % 2 != 0) && ($even % 2 == 0); |
494 | 494 | if (!is_null($sum)) { |
495 | 495 | return $result && ($odd + $even == $sum); |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | $number_of_calls = 0; |
779 | 779 | $this->mock->shouldReceive('foo') |
780 | 780 | ->times(2) |
781 | - ->with(\Mockery::on(function ($argument) use (&$number_of_calls) { |
|
781 | + ->with(\Mockery::on(function($argument) use (&$number_of_calls) { |
|
782 | 782 | $number_of_calls++; |
783 | 783 | return $number_of_calls <= 3; |
784 | 784 | })); |
@@ -1141,7 +1141,7 @@ discard block |
||
1141 | 1141 | public function testCallableConstraintMatchesArgument() |
1142 | 1142 | { |
1143 | 1143 | $this->mock->shouldReceive('foo')->with(Mockery::type('callable'))->once(); |
1144 | - $this->mock->foo(function () { |
|
1144 | + $this->mock->foo(function() { |
|
1145 | 1145 | return 'f'; |
1146 | 1146 | }); |
1147 | 1147 | } |
@@ -1350,7 +1350,7 @@ discard block |
||
1350 | 1350 | public function testResourceConstraintMatchesArgument() |
1351 | 1351 | { |
1352 | 1352 | $this->mock->shouldReceive('foo')->with(Mockery::type('resource'))->once(); |
1353 | - $r = fopen(dirname(__FILE__) . '/_files/file.txt', 'r'); |
|
1353 | + $r = fopen(dirname(__FILE__).'/_files/file.txt', 'r'); |
|
1354 | 1354 | $this->mock->foo($r); |
1355 | 1355 | } |
1356 | 1356 | |
@@ -1576,7 +1576,7 @@ discard block |
||
1576 | 1576 | |
1577 | 1577 | public function testOnConstraintMatchesArgument_ClosureEvaluatesToTrue() |
1578 | 1578 | { |
1579 | - $function = function ($arg) { |
|
1579 | + $function = function($arg) { |
|
1580 | 1580 | return $arg % 2 == 0; |
1581 | 1581 | }; |
1582 | 1582 | $this->mock->shouldReceive('foo')->with(Mockery::on($function))->once(); |
@@ -1585,7 +1585,7 @@ discard block |
||
1585 | 1585 | |
1586 | 1586 | public function testOnConstraintMatchesArgumentOfTypeArray_ClosureEvaluatesToTrue() |
1587 | 1587 | { |
1588 | - $function = function ($arg) { |
|
1588 | + $function = function($arg) { |
|
1589 | 1589 | return is_array($arg); |
1590 | 1590 | }; |
1591 | 1591 | $this->mock->shouldReceive('foo')->with(Mockery::on($function))->once(); |
@@ -1594,7 +1594,7 @@ discard block |
||
1594 | 1594 | |
1595 | 1595 | public function testOnConstraintThrowsExceptionWhenConstraintUnmatched_ClosureEvaluatesToFalse() |
1596 | 1596 | { |
1597 | - $function = function ($arg) { |
|
1597 | + $function = function($arg) { |
|
1598 | 1598 | return $arg % 2 == 0; |
1599 | 1599 | }; |
1600 | 1600 | $this->mock->shouldReceive('foo')->with(Mockery::on($function)); |
@@ -2035,7 +2035,7 @@ discard block |
||
2035 | 2035 | |
2036 | 2036 | $this->expectException( |
2037 | 2037 | '\BadMethodCallException', |
2038 | - 'Method ' . get_class($mock) . |
|
2038 | + 'Method '.get_class($mock). |
|
2039 | 2039 | '::nonExistent() does not exist on this mock object' |
2040 | 2040 | ); |
2041 | 2041 | |
@@ -2049,8 +2049,8 @@ discard block |
||
2049 | 2049 | |
2050 | 2050 | $this->expectException( |
2051 | 2051 | '\BadMethodCallException', |
2052 | - 'Received ' . get_class($mock) . |
|
2053 | - '::quack(), ' . 'but no expectations were specified' |
|
2052 | + 'Received '.get_class($mock). |
|
2053 | + '::quack(), '.'but no expectations were specified' |
|
2054 | 2054 | ); |
2055 | 2055 | |
2056 | 2056 | $mock->quack(); |
@@ -2079,7 +2079,7 @@ discard block |
||
2079 | 2079 | { |
2080 | 2080 | $this->expectException(InvalidCountException::class); |
2081 | 2081 | $this->expectExceptionMessageRegexp( |
2082 | - '/Method foo\(<Any Arguments>\) from Mockery_[\d]+ should be called' . PHP_EOL . ' ' . |
|
2082 | + '/Method foo\(<Any Arguments>\) from Mockery_[\d]+ should be called'.PHP_EOL.' '. |
|
2083 | 2083 | 'exactly 1 times but called 0 times. Because We like foo/' |
2084 | 2084 | ); |
2085 | 2085 |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | /** @test */ |
181 | 181 | public function it_allows_returning_null_for_nullable_object_return_types() |
182 | 182 | { |
183 | - $double= \Mockery::mock(MethodWithNullableReturnType::class); |
|
183 | + $double = \Mockery::mock(MethodWithNullableReturnType::class); |
|
184 | 184 | |
185 | 185 | $double->shouldReceive("nullableClass")->andReturnNull(); |
186 | 186 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | /** @test */ |
191 | 191 | public function it_allows_returning_null_for_nullable_string_return_types() |
192 | 192 | { |
193 | - $double= \Mockery::mock(MethodWithNullableReturnType::class); |
|
193 | + $double = \Mockery::mock(MethodWithNullableReturnType::class); |
|
194 | 194 | |
195 | 195 | $double->shouldReceive("nullableString")->andReturnNull(); |
196 | 196 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | /** @test */ |
201 | 201 | public function it_allows_returning_null_for_nullable_int_return_types() |
202 | 202 | { |
203 | - $double= \Mockery::mock(MethodWithNullableReturnType::class); |
|
203 | + $double = \Mockery::mock(MethodWithNullableReturnType::class); |
|
204 | 204 | |
205 | 205 | $double->shouldReceive("nullableInt")->andReturnNull(); |
206 | 206 |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | |
236 | 236 | public function testPassingClosureAsFinalParameterUsedToDefineExpectations() |
237 | 237 | { |
238 | - $m = mock('foo', function ($m) { |
|
238 | + $m = mock('foo', function($m) { |
|
239 | 239 | $m->shouldReceive('foo')->once()->andReturn('bar'); |
240 | 240 | }); |
241 | 241 | $this->assertEquals('bar', $m->foo()); |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | { |
810 | 810 | $m = mock('MockeryTestRef1'); |
811 | 811 | $m->shouldReceive('foo')->with( |
812 | - Mockery::on(function (&$a) { |
|
812 | + Mockery::on(function(&$a) { |
|
813 | 813 | $a += 1; |
814 | 814 | return true; |
815 | 815 | }), |
@@ -825,7 +825,7 @@ discard block |
||
825 | 825 | public function testMethodParamsPassedByReferenceThroughWithArgsHaveReferencePreserved() |
826 | 826 | { |
827 | 827 | $m = mock('MockeryTestRef1'); |
828 | - $m->shouldReceive('foo')->withArgs(function (&$a, $b) { |
|
828 | + $m->shouldReceive('foo')->withArgs(function(&$a, $b) { |
|
829 | 829 | $a += 1; |
830 | 830 | $b += 1; |
831 | 831 | return true; |
@@ -853,12 +853,12 @@ discard block |
||
853 | 853 | @$m = mock('DateTime'); |
854 | 854 | $this->assertInstanceOf("Mockery\MockInterface", $m, "Mocking failed, remove @ error suppresion to debug"); |
855 | 855 | $m->shouldReceive('modify')->with( |
856 | - Mockery::on(function (&$string) { |
|
856 | + Mockery::on(function(&$string) { |
|
857 | 857 | $string = 'foo'; |
858 | 858 | return true; |
859 | 859 | }) |
860 | 860 | ); |
861 | - $data ='bar'; |
|
861 | + $data = 'bar'; |
|
862 | 862 | $m->modify($data); |
863 | 863 | $this->assertEquals('foo', $data); |
864 | 864 | Mockery::getConfiguration()->resetInternalClassMethodParamMaps(); |
@@ -880,13 +880,13 @@ discard block |
||
880 | 880 | @$m = mock('MongoCollection'); |
881 | 881 | $this->assertInstanceOf("Mockery\MockInterface", $m, "Mocking failed, remove @ error suppresion to debug"); |
882 | 882 | $m->shouldReceive('insert')->with( |
883 | - Mockery::on(function (&$data) { |
|
883 | + Mockery::on(function(&$data) { |
|
884 | 884 | $data['_id'] = 123; |
885 | 885 | return true; |
886 | 886 | }), |
887 | 887 | Mockery::type('array') |
888 | 888 | ); |
889 | - $data = array('a'=>1,'b'=>2); |
|
889 | + $data = array('a'=>1, 'b'=>2); |
|
890 | 890 | $m->insert($data, array()); |
891 | 891 | $this->assertArrayHasKey('_id', $data); |
892 | 892 | $this->assertEquals(123, $data['_id']); |
@@ -1246,7 +1246,7 @@ discard block |
||
1246 | 1246 | public function testHandlesMethodWithArgumentExpectationWhenCalledWithCircularArray() |
1247 | 1247 | { |
1248 | 1248 | $testArray = array(); |
1249 | - $testArray['myself'] =& $testArray; |
|
1249 | + $testArray['myself'] = & $testArray; |
|
1250 | 1250 | |
1251 | 1251 | $mock = mock('MyTestClass'); |
1252 | 1252 | $mock->shouldReceive('foo')->with(array('yourself' => 21)); |
@@ -1288,7 +1288,7 @@ discard block |
||
1288 | 1288 | { |
1289 | 1289 | $testArray = array(); |
1290 | 1290 | $testArray['a_scalar'] = 2; |
1291 | - $testArray['a_closure'] = function () { |
|
1291 | + $testArray['a_closure'] = function() { |
|
1292 | 1292 | }; |
1293 | 1293 | |
1294 | 1294 | $mock = mock('MyTestClass'); |
@@ -1371,8 +1371,8 @@ discard block |
||
1371 | 1371 | array(false, ' '), // just a space |
1372 | 1372 | array(false, 'ClassName.WithDot'), |
1373 | 1373 | array(false, '\\\\TooManyBackSlashes'), |
1374 | - array(true, 'Foo'), |
|
1375 | - array(true, '\\Foo\\Bar'), |
|
1374 | + array(true, 'Foo'), |
|
1375 | + array(true, '\\Foo\\Bar'), |
|
1376 | 1376 | ); |
1377 | 1377 | } |
1378 | 1378 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | public function loadLoadsTheCode() |
34 | 34 | { |
35 | - $className = 'Mock_' . uniqid(); |
|
35 | + $className = 'Mock_'.uniqid(); |
|
36 | 36 | $config = new MockConfiguration(array(), array(), array(), $className); |
37 | 37 | $code = "<?php class $className { } "; |
38 | 38 |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | /** @test */ |
71 | 71 | public function it_verifies_the_closure_was_not_called() |
72 | 72 | { |
73 | - $spy = spy(function () {}); |
|
73 | + $spy = spy(function() {}); |
|
74 | 74 | |
75 | 75 | $spy->shouldNotHaveBeenCalled(); |
76 | 76 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | /** @test */ |
79 | 79 | public function it_throws_if_it_was_called_when_we_expected_it_to_not_have_been_called() |
80 | 80 | { |
81 | - $spy = spy(function () {}); |
|
81 | + $spy = spy(function() {}); |
|
82 | 82 | |
83 | 83 | $spy(); |
84 | 84 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | /** @test */ |
90 | 90 | public function it_verifies_it_was_not_called_with_some_particular_arguments_when_called_with_no_args() |
91 | 91 | { |
92 | - $spy = spy(function () {}); |
|
92 | + $spy = spy(function() {}); |
|
93 | 93 | |
94 | 94 | $spy(); |
95 | 95 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | /** @test */ |
100 | 100 | public function it_verifies_it_was_not_called_with_some_particular_arguments_when_called_with_different_args() |
101 | 101 | { |
102 | - $spy = spy(function () {}); |
|
102 | + $spy = spy(function() {}); |
|
103 | 103 | |
104 | 104 | $spy(456); |
105 | 105 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | /** @test */ |
110 | 110 | public function it_throws_if_it_was_called_with_the_args_we_were_not_expecting() |
111 | 111 | { |
112 | - $spy = spy(function () {}); |
|
112 | + $spy = spy(function() {}); |
|
113 | 113 | |
114 | 114 | $spy(123); |
115 | 115 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | /** @test */ |
121 | 121 | public function it_can_verify_it_was_called_a_number_of_times() |
122 | 122 | { |
123 | - $spy = spy(function () {}); |
|
123 | + $spy = spy(function() {}); |
|
124 | 124 | |
125 | 125 | $spy(); |
126 | 126 | $spy(); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | /** @test */ |
132 | 132 | public function it_can_verify_it_was_called_a_number_of_times_with_particular_arguments() |
133 | 133 | { |
134 | - $spy = spy(function () {}); |
|
134 | + $spy = spy(function() {}); |
|
135 | 135 | |
136 | 136 | $spy(123); |
137 | 137 | $spy(123); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | /** @test */ |
143 | 143 | public function it_throws_if_it_was_called_less_than_the_number_of_times_we_expected() |
144 | 144 | { |
145 | - $spy = spy(function () {}); |
|
145 | + $spy = spy(function() {}); |
|
146 | 146 | |
147 | 147 | $spy(); |
148 | 148 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | /** @test */ |
154 | 154 | public function it_throws_if_it_was_called_less_than_the_number_of_times_we_expected_with_particular_arguments() |
155 | 155 | { |
156 | - $spy = spy(function () {}); |
|
156 | + $spy = spy(function() {}); |
|
157 | 157 | |
158 | 158 | $spy(); |
159 | 159 | $spy(123); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | /** @test */ |
166 | 166 | public function it_throws_if_it_was_called_more_than_the_number_of_times_we_expected() |
167 | 167 | { |
168 | - $spy = spy(function () {}); |
|
168 | + $spy = spy(function() {}); |
|
169 | 169 | |
170 | 170 | $spy(); |
171 | 171 | $spy(); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | /** @test */ |
179 | 179 | public function it_throws_if_it_was_called_more_than_the_number_of_times_we_expected_with_particular_arguments() |
180 | 180 | { |
181 | - $spy = spy(function () {}); |
|
181 | + $spy = spy(function() {}); |
|
182 | 182 | |
183 | 183 | $spy(123); |
184 | 184 | $spy(123); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | /** @test */ |
192 | 192 | public function it_acts_as_partial() |
193 | 193 | { |
194 | - $spy = spy(function ($number) { return $number + 1;}); |
|
194 | + $spy = spy(function($number) { return $number + 1; }); |
|
195 | 195 | |
196 | 196 | $this->assertEquals(124, $spy(123)); |
197 | 197 | $spy->shouldHaveBeenCalled(); |
@@ -30,17 +30,17 @@ discard block |
||
30 | 30 | return ($path[0] === DIRECTORY_SEPARATOR) || (preg_match($windowsPattern, $path) === 1); |
31 | 31 | } |
32 | 32 | |
33 | -$root = realpath(dirname(dirname(__FILE__))); |
|
33 | +$root = realpath(dirname(dirname(__FILE__))); |
|
34 | 34 | $composerVendorDirectory = getenv("COMPOSER_VENDOR_DIR") ?: "vendor"; |
35 | 35 | |
36 | 36 | if (!isAbsolutePath($composerVendorDirectory)) { |
37 | - $composerVendorDirectory = $root . DIRECTORY_SEPARATOR . $composerVendorDirectory; |
|
37 | + $composerVendorDirectory = $root.DIRECTORY_SEPARATOR.$composerVendorDirectory; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
41 | 41 | * Check that composer installation was done |
42 | 42 | */ |
43 | -$autoloadPath = $composerVendorDirectory . DIRECTORY_SEPARATOR . 'autoload.php'; |
|
43 | +$autoloadPath = $composerVendorDirectory.DIRECTORY_SEPARATOR.'autoload.php'; |
|
44 | 44 | if (!file_exists($autoloadPath)) { |
45 | 45 | throw new Exception( |
46 | 46 | 'Please run "php composer.phar install" in root directory ' |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | if (DIRECTORY_SEPARATOR !== '/') { |
55 | 55 | $hamcrestRelativePath = str_replace('/', DIRECTORY_SEPARATOR, $hamcrestRelativePath); |
56 | 56 | } |
57 | -$hamcrestPath = $composerVendorDirectory . DIRECTORY_SEPARATOR . $hamcrestRelativePath; |
|
57 | +$hamcrestPath = $composerVendorDirectory.DIRECTORY_SEPARATOR.$hamcrestRelativePath; |
|
58 | 58 | |
59 | 59 | require_once $hamcrestPath; |
60 | 60 |
@@ -108,7 +108,7 @@ |
||
108 | 108 | $this->assertSame('', $mock->returnString()); |
109 | 109 | $this->assertSame(0, $mock->returnInteger()); |
110 | 110 | $this->assertSame(0.0, $mock->returnFloat()); |
111 | - $this->assertFalse( $mock->returnBoolean()); |
|
111 | + $this->assertFalse($mock->returnBoolean()); |
|
112 | 112 | $this->assertSame([], $mock->returnArray()); |
113 | 113 | $this->assertTrue(is_callable($mock->returnCallable())); |
114 | 114 | $this->assertInstanceOf("\Generator", $mock->returnGenerator()); |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | */ |
442 | 442 | public static function capture(&$reference) |
443 | 443 | { |
444 | - $closure = function ($argument) use (&$reference) { |
|
444 | + $closure = function($argument) use (&$reference) { |
|
445 | 445 | $reference = $argument; |
446 | 446 | return true; |
447 | 447 | }; |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | public static function formatArgs($method, array $arguments = null) |
548 | 548 | { |
549 | 549 | if (is_null($arguments)) { |
550 | - return $method . '()'; |
|
550 | + return $method.'()'; |
|
551 | 551 | } |
552 | 552 | |
553 | 553 | $formattedArguments = array(); |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | $formattedArguments[] = self::formatArgument($argument); |
556 | 556 | } |
557 | 557 | |
558 | - return $method . '(' . implode(', ', $formattedArguments) . ')'; |
|
558 | + return $method.'('.implode(', ', $formattedArguments).')'; |
|
559 | 559 | } |
560 | 560 | |
561 | 561 | /** |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | } |
575 | 575 | |
576 | 576 | if (is_object($argument)) { |
577 | - return 'object(' . get_class($argument) . ')'; |
|
577 | + return 'object('.get_class($argument).')'; |
|
578 | 578 | } |
579 | 579 | |
580 | 580 | if (is_int($argument) || is_float($argument)) { |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | |
647 | 647 | $formatting = false; |
648 | 648 | |
649 | - return 'Objects: ( ' . var_export($parts, true) . ')'; |
|
649 | + return 'Objects: ( '.var_export($parts, true).')'; |
|
650 | 650 | } |
651 | 651 | |
652 | 652 | /** |
@@ -796,7 +796,7 @@ discard block |
||
796 | 796 | ) { |
797 | 797 | throw new \Mockery\Exception( |
798 | 798 | 'Mockery\'s configuration currently forbids mocking the method ' |
799 | - . current($methodNames) . ' as it does not exist on the class or object ' |
|
799 | + . current($methodNames).' as it does not exist on the class or object ' |
|
800 | 800 | . 'being mocked' |
801 | 801 | ); |
802 | 802 | } |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | $expectations = null; |
806 | 806 | |
807 | 807 | /** @var Callable $nextExp */ |
808 | - $nextExp = function ($method) use ($add) { |
|
808 | + $nextExp = function($method) use ($add) { |
|
809 | 809 | return $add($method); |
810 | 810 | }; |
811 | 811 | |
@@ -829,9 +829,9 @@ discard block |
||
829 | 829 | } |
830 | 830 | } |
831 | 831 | |
832 | - $parent .= '->' . $method; |
|
832 | + $parent .= '->'.$method; |
|
833 | 833 | |
834 | - $nextExp = function ($n) use ($mock) { |
|
834 | + $nextExp = function($n) use ($mock) { |
|
835 | 835 | return $mock->shouldReceive($n); |
836 | 836 | }; |
837 | 837 | } |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | $method, |
857 | 857 | Mockery\ExpectationInterface $exp |
858 | 858 | ) { |
859 | - $newMockName = 'demeter_' . md5($parent) . '_' . $method; |
|
859 | + $newMockName = 'demeter_'.md5($parent).'_'.$method; |
|
860 | 860 | |
861 | 861 | if (version_compare(PHP_VERSION, '7.0.0') >= 0) { |
862 | 862 | $parRef = null; |
@@ -874,8 +874,8 @@ discard block |
||
874 | 874 | |
875 | 875 | if ($parRefMethodRetType !== null) { |
876 | 876 | $nameBuilder = new MockNameBuilder(); |
877 | - $nameBuilder->addPart('\\' . $newMockName); |
|
878 | - $type = PHP_VERSION_ID >= 70100 ? $parRefMethodRetType->getName() : (string)$parRefMethodRetType; |
|
877 | + $nameBuilder->addPart('\\'.$newMockName); |
|
878 | + $type = PHP_VERSION_ID >= 70100 ? $parRefMethodRetType->getName() : (string) $parRefMethodRetType; |
|
879 | 879 | $mock = self::namedMock($nameBuilder->build(), $type); |
880 | 880 | $exp->andReturn($mock); |
881 | 881 | |
@@ -943,10 +943,10 @@ discard block |
||
943 | 943 | $shortName = trim(array_pop($parts)); |
944 | 944 | $namespace = implode("\\", $parts); |
945 | 945 | |
946 | - $targetCode.= "namespace $namespace;\n"; |
|
946 | + $targetCode .= "namespace $namespace;\n"; |
|
947 | 947 | } |
948 | 948 | |
949 | - $targetCode.= "$type $shortName {} "; |
|
949 | + $targetCode .= "$type $shortName {} "; |
|
950 | 950 | |
951 | 951 | /* |
952 | 952 | * We could eval here, but it doesn't play well with the way |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $reflectionClass = $this->getReflectionClass($className); |
70 | 70 | |
71 | 71 | if ($this->isInstantiableViaReflection($reflectionClass)) { |
72 | - return function () use ($reflectionClass) { |
|
72 | + return function() use ($reflectionClass) { |
|
73 | 73 | return $reflectionClass->newInstanceWithoutConstructor(); |
74 | 74 | }; |
75 | 75 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | $this->attemptInstantiationViaUnSerialization($reflectionClass, $serializedString); |
85 | 85 | |
86 | - return function () use ($serializedString) { |
|
86 | + return function() use ($serializedString) { |
|
87 | 87 | return unserialize($serializedString); |
88 | 88 | }; |
89 | 89 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | private function getReflectionClass($className) |
99 | 99 | { |
100 | - if (! class_exists($className)) { |
|
100 | + if (!class_exists($className)) { |
|
101 | 101 | throw new InvalidArgumentException("Class:$className does not exist"); |
102 | 102 | } |
103 | 103 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | private function attemptInstantiationViaUnSerialization(ReflectionClass $reflectionClass, $serializedString) |
122 | 122 | { |
123 | - set_error_handler(function ($code, $message, $file, $line) use ($reflectionClass, & $error) { |
|
123 | + set_error_handler(function($code, $message, $file, $line) use ($reflectionClass, & $error) { |
|
124 | 124 | $msg = sprintf( |
125 | 125 | 'Could not produce an instance of "%s" via un-serialization, since an error was triggered in file "%s" at line "%d"', |
126 | 126 | $reflectionClass->getName(), |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | */ |
154 | 154 | private function isInstantiableViaReflection(ReflectionClass $reflectionClass) |
155 | 155 | { |
156 | - return ! ($reflectionClass->isInternal() && $reflectionClass->isFinal()); |
|
156 | + return !($reflectionClass->isInternal() && $reflectionClass->isFinal()); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |