@@ -4,8 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use PhpSpec\ObjectBehavior; |
| 6 | 6 | use PhpSpec\Wrapper\Subject; |
| 7 | -use Prophecy\Argument; |
|
| 8 | - |
|
| 9 | 7 | use PhpSpec\Matcher\MatcherInterface; |
| 10 | 8 | |
| 11 | 9 | class NegativeSpec extends ObjectBehavior |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use PhpSpec\Matcher\MatcherInterface; |
| 6 | 6 | use PhpSpec\ObjectBehavior; |
| 7 | -use Prophecy\Argument; |
|
| 8 | 7 | |
| 9 | 8 | class PositiveSpec extends ObjectBehavior |
| 10 | 9 | { |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | use PhpSpec\ObjectBehavior; |
| 7 | 7 | use PhpSpec\Wrapper\Subject; |
| 8 | 8 | use Prophecy\Argument; |
| 9 | - |
|
| 10 | 9 | use PhpSpec\Loader\Node\ExampleNode; |
| 11 | 10 | use Symfony\Component\EventDispatcher\EventDispatcherInterface; |
| 12 | 11 | use PhpSpec\Runner\MatcherManager; |
@@ -4,8 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use PhpSpec\Exception\Fracture\FactoryDoesNotReturnObjectException; |
| 6 | 6 | use PhpSpec\ObjectBehavior; |
| 7 | -use Prophecy\Argument; |
|
| 8 | - |
|
| 9 | 7 | use PhpSpec\Formatter\Presenter\PresenterInterface; |
| 10 | 8 | |
| 11 | 9 | class WrappedObjectSpec extends ObjectBehavior |
@@ -74,10 +74,10 @@ discard block |
||
| 74 | 74 | { |
| 75 | 75 | $this->callOnWrappedObject('beAnInstanceOf', array('\DateTime')); |
| 76 | 76 | |
| 77 | - $this->callOnWrappedObject('beConstructedThrough', array('createFromFormat',array('d-m-Y', '01-01-1980'))); |
|
| 77 | + $this->callOnWrappedObject('beConstructedThrough', array('createFromFormat', array('d-m-Y', '01-01-1980'))); |
|
| 78 | 78 | $this->callOnWrappedObject('instantiate', array()); |
| 79 | 79 | $this->shouldThrow('PhpSpec\Exception\Wrapper\SubjectException') |
| 80 | - ->duringBeConstructedThrough(array('createFromFormat',array('d-m-Y', '01-01-1970'))); |
|
| 80 | + ->duringBeConstructedThrough(array('createFromFormat', array('d-m-Y', '01-01-1970'))); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | function it_throws_an_exception_when_trying_to_change_from_constructor_to_factory_method_after_instantiation() |
@@ -87,14 +87,14 @@ discard block |
||
| 87 | 87 | $this->callOnWrappedObject('beConstructedWith', array(array('now'))); |
| 88 | 88 | $this->callOnWrappedObject('instantiate', array()); |
| 89 | 89 | $this->shouldThrow('PhpSpec\Exception\Wrapper\SubjectException') |
| 90 | - ->duringBeConstructedThrough(array('createFromFormat',array('d-m-Y', '01-01-1970'))); |
|
| 90 | + ->duringBeConstructedThrough(array('createFromFormat', array('d-m-Y', '01-01-1970'))); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | function it_throws_an_exception_when_trying_to_change_from_factory_method_to_constructor_after_instantiation() |
| 94 | 94 | { |
| 95 | 95 | $this->callOnWrappedObject('beAnInstanceOf', array('\DateTime')); |
| 96 | 96 | |
| 97 | - $this->callOnWrappedObject('beConstructedThrough', array('createFromFormat',array('d-m-Y', '01-01-1980'))); |
|
| 97 | + $this->callOnWrappedObject('beConstructedThrough', array('createFromFormat', array('d-m-Y', '01-01-1980'))); |
|
| 98 | 98 | $this->callOnWrappedObject('instantiate', array()); |
| 99 | 99 | $this->shouldThrow('PhpSpec\Exception\Wrapper\SubjectException')->duringBeConstructedWith('tomorrow'); |
| 100 | 100 | } |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Phpspec\CodeAnalysis\AccessInspectorInterface; |
| 6 | 6 | use PhpSpec\ObjectBehavior; |
| 7 | 7 | use Prophecy\Argument; |
| 8 | - |
|
| 9 | 8 | use PhpSpec\Wrapper\Wrapper; |
| 10 | 9 | use PhpSpec\Wrapper\Subject\WrappedObject; |
| 11 | 10 | use PhpSpec\Wrapper\Subject\Caller; |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | class SubjectSpec extends ObjectBehavior |
| 17 | 17 | { |
| 18 | 18 | function let(Wrapper $wrapper, WrappedObject $wrappedObject, Caller $caller, SubjectWithArrayAccess $arrayAccess, |
| 19 | - ExpectationFactory $expectationFactory, AccessInspectorInterface $accessInspector) |
|
| 19 | + ExpectationFactory $expectationFactory, AccessInspectorInterface $accessInspector) |
|
| 20 | 20 | { |
| 21 | 21 | $this->beConstructedWith( |
| 22 | 22 | null, |
@@ -38,6 +38,9 @@ |
||
| 38 | 38 | static::$specTransformers[] = $specTransformer; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | + /** |
|
| 42 | + * @return string |
|
| 43 | + */ |
|
| 41 | 44 | public static function wrapPath($path) |
| 42 | 45 | { |
| 43 | 46 | if (!defined('HHVM_VERSION')) |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | { |
| 43 | 43 | if (!defined('HHVM_VERSION')) |
| 44 | 44 | { |
| 45 | - return 'phpspec://' . $path; |
|
| 45 | + return 'phpspec://'.$path; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | return $path; |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * @param array $arguments |
| 56 | 56 | * |
| 57 | 57 | * @throws \PhpSpec\Exception\Example\FailureException |
| 58 | - * @return boolean |
|
| 58 | + * @return boolean|null |
|
| 59 | 59 | */ |
| 60 | 60 | public function positiveMatch($name, $subject, array $arguments) |
| 61 | 61 | { |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | * @param array $arguments |
| 83 | 83 | * |
| 84 | 84 | * @throws \PhpSpec\Exception\Example\FailureException |
| 85 | - * @return boolean |
|
| 85 | + * @return boolean|null |
|
| 86 | 86 | */ |
| 87 | 87 | public function negativeMatch($name, $subject, array $arguments) |
| 88 | 88 | { |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | /** |
| 115 | 115 | * @param string $name |
| 116 | 116 | * |
| 117 | - * @return string|boolean |
|
| 117 | + * @return false|string |
|
| 118 | 118 | */ |
| 119 | 119 | private function getCheckerName($name) |
| 120 | 120 | { |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | /** |
| 73 | 73 | * Gets the unwrapped proxied object from PhpSpec subject |
| 74 | 74 | * |
| 75 | - * @return object |
|
| 75 | + * @return \Prophecy\Prophecy\ObjectProphecy |
|
| 76 | 76 | */ |
| 77 | 77 | public function getWrappedObject() |
| 78 | 78 | { |
@@ -15,7 +15,6 @@ |
||
| 15 | 15 | |
| 16 | 16 | use PhpSpec\CodeAnalysis\DisallowedScalarTypehintException; |
| 17 | 17 | use PhpSpec\Exception\Fracture\CollaboratorNotFoundException; |
| 18 | -use PhpSpec\Exception\Wrapper\CollaboratorException; |
|
| 19 | 18 | use PhpSpec\Exception\Wrapper\InvalidCollaboratorTypeException; |
| 20 | 19 | use PhpSpec\Loader\Node\ExampleNode; |
| 21 | 20 | use PhpSpec\Loader\Transformer\InMemoryTypeHintIndex; |
@@ -143,11 +143,9 @@ discard block |
||
| 143 | 143 | || ($indexedClass = $this->getParameterTypeFromReflection($parameter))) { |
| 144 | 144 | $collaborator->beADoubleOf($indexedClass); |
| 145 | 145 | } |
| 146 | - } |
|
| 147 | - catch (ClassNotFoundException $e) { |
|
| 146 | + } catch (ClassNotFoundException $e) { |
|
| 148 | 147 | $this->throwCollaboratorNotFound($e, null, $e->getClassname()); |
| 149 | - } |
|
| 150 | - catch (DisallowedScalarTypehintException $e) { |
|
| 148 | + } catch (DisallowedScalarTypehintException $e) { |
|
| 151 | 149 | throw new InvalidCollaboratorTypeException($parameter, $function); |
| 152 | 150 | } |
| 153 | 151 | } |
@@ -218,8 +216,7 @@ discard block |
||
| 218 | 216 | } |
| 219 | 217 | |
| 220 | 218 | return $class->getName(); |
| 221 | - } |
|
| 222 | - catch (ReflectionException $e) { |
|
| 219 | + } catch (ReflectionException $e) { |
|
| 223 | 220 | $this->throwCollaboratorNotFound($e, $parameter); |
| 224 | 221 | } |
| 225 | 222 | } |
@@ -201,7 +201,7 @@ |
||
| 201 | 201 | return $this->typeHintIndex->lookup( |
| 202 | 202 | $classRefl->getName(), |
| 203 | 203 | $parameter->getDeclaringFunction()->getName(), |
| 204 | - '$' . $parameter->getName() |
|
| 204 | + '$'.$parameter->getName() |
|
| 205 | 205 | ); |
| 206 | 206 | } |
| 207 | 207 | |