diff --git a/Factory/FormatterFactory.php b/Factory/FormatterFactory.php index 8b9361e..aa6e28c 100644 --- a/Factory/FormatterFactory.php +++ b/Factory/FormatterFactory.php @@ -26,10 +26,10 @@ public static function createClosure($generator, $method, array $parameters = ar return function () use ($generator, $method, $parameters, $optional) { if (null !== $optional && $generator instanceof Generator) { - $generator = $generator->optional((double)$optional); + $generator = $generator->optional((double) $optional); } - return call_user_func_array(array($generator, $method), (array)$parameters); + return call_user_func_array(array($generator, $method), (array) $parameters); }; } } diff --git a/Tests/Factory/FormatterFactoryTest.php b/Tests/Factory/FormatterFactoryTest.php index ea3efe2..50a6f58 100644 --- a/Tests/Factory/FormatterFactoryTest.php +++ b/Tests/Factory/FormatterFactoryTest.php @@ -43,7 +43,7 @@ public function testCreateClosureWithOptional() $generator ->expects($this->once()) ->method('optional') - ->willReturn($generator) + ->will($this->returnValue($generator)) ; $closure = FormatterFactory::createClosure($generator, 'foo', array(), null, 0.1);