@@ -23,14 +23,14 @@ |
||
| 23 | 23 | |
| 24 | 24 | function it_scores_7_if_argument_matches_callback() |
| 25 | 25 | { |
| 26 | - $this->beConstructedWith(function ($argument) { return 2 === $argument; }); |
|
| 26 | + $this->beConstructedWith(function($argument) { return 2 === $argument; }); |
|
| 27 | 27 | |
| 28 | 28 | $this->scoreArgument(2)->shouldReturn(7); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | function it_does_not_scores_if_argument_does_not_match_callback() |
| 32 | 32 | { |
| 33 | - $this->beConstructedWith(function ($argument) { return 2 === $argument; }); |
|
| 33 | + $this->beConstructedWith(function($argument) { return 2 === $argument; }); |
|
| 34 | 34 | |
| 35 | 35 | $this->scoreArgument(5)->shouldReturn(false); |
| 36 | 36 | } |
@@ -120,7 +120,7 @@ |
||
| 120 | 120 | { |
| 121 | 121 | $resource = fopen(__FILE__, 'r'); |
| 122 | 122 | $this->beConstructedWith($resource); |
| 123 | - $this->__toString()->shouldReturn('exact(stream:'.$resource.')'); |
|
| 123 | + $this->__toString()->shouldReturn('exact(stream:' . $resource . ')'); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -312,6 +312,9 @@ |
||
| 312 | 312 | public $errors; |
| 313 | 313 | public $value = null; |
| 314 | 314 | |
| 315 | + /** |
|
| 316 | + * @param string $value |
|
| 317 | + */ |
|
| 315 | 318 | public function __construct($value) |
| 316 | 319 | { |
| 317 | 320 | $this->value = $value; |
@@ -136,7 +136,7 @@ |
||
| 136 | 136 | { |
| 137 | 137 | $resource = fopen(__FILE__, 'r'); |
| 138 | 138 | $this->beConstructedWith($resource); |
| 139 | - $this->__toString()->shouldReturn('identical(stream:'.$resource.')'); |
|
| 139 | + $this->__toString()->shouldReturn('identical(stream:' . $resource . ')'); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | function it_generates_proper_string_representation_for_object($object) |
@@ -18,21 +18,21 @@ |
||
| 18 | 18 | $this->accepts('string', 'string')->shouldReturn(false); |
| 19 | 19 | $this->accepts(false, true)->shouldReturn(false); |
| 20 | 20 | $this->accepts(true, false)->shouldReturn(false); |
| 21 | - $this->accepts((object)array(), (object)array())->shouldReturn(false); |
|
| 22 | - $this->accepts(function(){}, (object)array())->shouldReturn(false); |
|
| 23 | - $this->accepts(function(){}, (object)array())->shouldReturn(false); |
|
| 21 | + $this->accepts((object) array(), (object) array())->shouldReturn(false); |
|
| 22 | + $this->accepts(function() {}, (object) array())->shouldReturn(false); |
|
| 23 | + $this->accepts(function() {}, (object) array())->shouldReturn(false); |
|
| 24 | 24 | |
| 25 | - $this->accepts(function(){}, function(){})->shouldReturn(true); |
|
| 25 | + $this->accepts(function() {}, function() {})->shouldReturn(true); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | function it_asserts_that_all_closures_are_different() |
| 29 | 29 | { |
| 30 | - $this->shouldThrow()->duringAssertEquals(function(){}, function(){}); |
|
| 30 | + $this->shouldThrow()->duringAssertEquals(function() {}, function() {}); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | function it_asserts_that_all_closures_are_different_even_if_its_the_same_closure() |
| 34 | 34 | { |
| 35 | - $closure = function(){}; |
|
| 35 | + $closure = function() {}; |
|
| 36 | 36 | |
| 37 | 37 | $this->shouldThrow()->duringAssertEquals($closure, $closure); |
| 38 | 38 | } |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace spec\Prophecy\Doubler; |
| 4 | 4 | |
| 5 | 5 | use PhpSpec\ObjectBehavior; |
| 6 | -use Prophecy\Argument; |
|
| 7 | 6 | |
| 8 | 7 | class DoublerSpec extends ObjectBehavior |
| 9 | 8 | { |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | function it_should_have_ClosureComparator_registered() |
| 16 | 16 | { |
| 17 | - $comparator = $this->getInstance()->getComparatorFor(function(){}, function(){}); |
|
| 17 | + $comparator = $this->getInstance()->getComparatorFor(function() {}, function() {}); |
|
| 18 | 18 | $comparator->shouldHaveType('Prophecy\Comparator\ClosureComparator'); |
| 19 | 19 | } |
| 20 | 20 | } |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace spec\Prophecy\Doubler; |
| 4 | 4 | |
| 5 | 5 | use PhpSpec\ObjectBehavior; |
| 6 | -use Prophecy\Argument; |
|
| 7 | 6 | |
| 8 | 7 | class DoublerSpec extends ObjectBehavior |
| 9 | 8 | { |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | $argument->isPassedByReference()->willReturn(true); |
| 129 | 129 | |
| 130 | 130 | $code = $this->generate('CustomClass', $class); |
| 131 | - $expected =<<<'PHP' |
|
| 131 | + $expected = <<<'PHP' |
|
| 132 | 132 | namespace { |
| 133 | 133 | class CustomClass extends \RuntimeException implements \Prophecy\Doubler\Generator\MirroredInterface { |
| 134 | 134 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $class->getMethods()->willReturn(array()); |
| 155 | 155 | |
| 156 | 156 | $code = $this->generate('CustomClass', $class); |
| 157 | - $expected =<<<'PHP' |
|
| 157 | + $expected = <<<'PHP' |
|
| 158 | 158 | namespace { |
| 159 | 159 | class CustomClass extends \stdClass implements \Prophecy\Doubler\Generator\MirroredInterface { |
| 160 | 160 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $class->getMethods()->willReturn(array()); |
| 178 | 178 | |
| 179 | 179 | $code = $this->generate('My\Awesome\CustomClass', $class); |
| 180 | - $expected =<<<'PHP' |
|
| 180 | + $expected = <<<'PHP' |
|
| 181 | 181 | namespace My\Awesome { |
| 182 | 182 | class CustomClass extends \stdClass implements \Prophecy\Doubler\Generator\MirroredInterface { |
| 183 | 183 | |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | $class->getName()->willReturn('Custom\ClassName'); |
| 389 | 389 | |
| 390 | 390 | $this->shouldThrow('Prophecy\Exception\Doubler\ClassMirrorException') |
| 391 | - ->duringReflect($class, array()); |
|
| 391 | + ->duringReflect($class, array()); |
|
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | /** |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | $interface->getName()->willReturn('Custom\ClassName'); |
| 420 | 420 | |
| 421 | 421 | $this->shouldThrow('Prophecy\Exception\InvalidArgumentException') |
| 422 | - ->duringReflect($interface, array()); |
|
| 422 | + ->duringReflect($interface, array()); |
|
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | /** |
@@ -562,13 +562,13 @@ discard block |
||
| 562 | 562 | $class->isInterface()->willReturn(false); |
| 563 | 563 | |
| 564 | 564 | $this->shouldThrow('InvalidArgumentException') |
| 565 | - ->duringReflect(null, array($class)); |
|
| 565 | + ->duringReflect(null, array($class)); |
|
| 566 | 566 | } |
| 567 | 567 | |
| 568 | 568 | function it_throws_an_exception_if_not_reflection_provided_as_interface() |
| 569 | 569 | { |
| 570 | 570 | $this->shouldThrow('InvalidArgumentException') |
| 571 | - ->duringReflect(null, array(null)); |
|
| 571 | + ->duringReflect(null, array(null)); |
|
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | function it_doesnt_fail_to_typehint_nonexistent_FQCN() |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $method3->hasReturnType()->willReturn(false); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - $classNode = $this->reflect($class, array()); |
|
| 62 | + $classNode = $this->reflect($class, array()); |
|
| 63 | 63 | $classNode->shouldBeAnInstanceOf('Prophecy\Doubler\Generator\Node\ClassNode'); |
| 64 | 64 | $classNode->getParentClass()->shouldReturn('Custom\ClassName'); |
| 65 | 65 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $method->hasReturnType()->willReturn(false); |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - $classNode = $this->reflect($class, array()); |
|
| 137 | + $classNode = $this->reflect($class, array()); |
|
| 138 | 138 | $classNode->shouldBeAnInstanceOf('Prophecy\Doubler\Generator\Node\ClassNode'); |
| 139 | 139 | $classNode->getParentClass()->shouldReturn('Custom\ClassName'); |
| 140 | 140 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $method->hasReturnType()->willReturn(false); |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | - $classNode = $this->reflect($class, array()); |
|
| 169 | + $classNode = $this->reflect($class, array()); |
|
| 170 | 170 | $classNode->shouldBeAnInstanceOf('Prophecy\Doubler\Generator\Node\ClassNode'); |
| 171 | 171 | $classNode->getParentClass()->shouldReturn('Custom\ClassName'); |
| 172 | 172 | |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace spec\Prophecy\Prediction; |
| 4 | 4 | |
| 5 | 5 | use PhpSpec\ObjectBehavior; |
| 6 | - |
|
| 7 | 6 | use RuntimeException; |
| 8 | 7 | |
| 9 | 8 | class CallbackPredictionSpec extends ObjectBehavior |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | public function getMatchers() |
| 65 | 65 | { |
| 66 | 66 | return array( |
| 67 | - 'startWith' => function ($subject, $string) { |
|
| 67 | + 'startWith' => function($subject, $string) { |
|
| 68 | 68 | return 0 === strpos($subject, $string); |
| 69 | 69 | }, |
| 70 | 70 | ); |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | function it_should_execute_closure_callback($object, $method) |
| 24 | 24 | { |
| 25 | - $firstArgumentCallback = function ($args) { |
|
| 25 | + $firstArgumentCallback = function($args) { |
|
| 26 | 26 | return $args[0]; |
| 27 | 27 | }; |
| 28 | 28 | |