Closed andaniel05 closed 6 years ago
Does this solve your problem?
diff --git a/src/Invocation/Static.php b/src/Invocation/Static.php
index b3734b5..9406e23 100644
--- a/src/Invocation/Static.php
+++ b/src/Invocation/Static.php
@@ -124,7 +124,7 @@ public function toString()
*/
public function generateReturnValue()
{
- switch ($this->returnType) {
+ switch (strtolower($this->returnType)) {
case '': return;
case 'string': return $this->returnTypeNullable ? null : '';
case 'float': return $this->returnTypeNullable ? null : 0.0;
@@ -134,12 +134,13 @@ public function generateReturnValue()
case 'void': return;
case 'callable':
- case 'Closure':
+ case 'closure':
return function () {
};
- case 'Traversable':
- case 'Generator':
+ case 'traversable':
+ case 'generator':
+ case 'iterable':
$generator = function () {
yield;
};
Hi Sebastian. Sorry for my delayed response. Now this solve my issue. Thanks.
PHP Fatal error: Cannot use 'iterable' as class name as it is reserved in phar://xxxxxxxx/phpunit-6.4.3.phar/phpunit-mock-objects/Generator.php(263) : eval()'d code on line 1