@@ -75,8 +75,7 @@ function it_generates_proper_php_code_for_specific_ClassNode(
75
75
$ method5 ->getCode ()->willReturn ('return; ' );
76
76
77
77
$ argument11 ->getName ()->willReturn ('fullname ' );
78
- $ argument11 ->isOptional ()->willReturn (true );
79
- $ argument11 ->getDefault ()->willReturn (null );
78
+ $ argument11 ->isOptional ()->willReturn (false );
80
79
$ argument11 ->isPassedByReference ()->willReturn (false );
81
80
$ argument11 ->isVariadic ()->willReturn (false );
82
81
$ argument11 ->getTypeNode ()->willReturn (new ArgumentTypeNode ('array ' ));
@@ -116,7 +115,7 @@ class CustomClass extends \RuntimeException implements \Prophecy\Doubler\Generat
116
115
public $name;
117
116
private $email;
118
117
119
- public static function getName(array $fullname = NULL , \ReflectionClass $class, object $instance): ?string {
118
+ public static function getName(array $fullname, \ReflectionClass $class, object $instance): ?string {
120
119
return $this->name;
121
120
}
122
121
protected function getEmail(?string $default = '[email protected] ') {
@@ -265,14 +264,14 @@ function it_overrides_properly_methods_with_args_passed_by_reference(
265
264
$ argument ->getDefault ()->willReturn (null );
266
265
$ argument ->isPassedByReference ()->willReturn (true );
267
266
$ argument ->isVariadic ()->willReturn (false );
268
- $ argument ->getTypeNode ()->willReturn (new ArgumentTypeNode ('array ' ));
267
+ $ argument ->getTypeNode ()->willReturn (new ArgumentTypeNode ('array ' , ' null ' ));
269
268
270
269
$ code = $ this ->generate ('CustomClass ' , $ class );
271
270
$ expected = <<<'PHP'
272
271
namespace {
273
272
class CustomClass extends \RuntimeException implements \Prophecy\Doubler\Generator\MirroredInterface {
274
273
275
- public function getName(array &$fullname = NULL) {
274
+ public function getName(? array &$fullname = NULL) {
276
275
return $this->name;
277
276
}
278
277
0 commit comments