-
-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null objects do not extend their original class #300
Comments
Also, the same seems to be the case with scalar type hints in method declarations. |
@trickleup ProxyManager v2 fully supports return type hints: can you check what version you have installed? |
@Ocramius I'm having (what I think is) the same issue, only with the
The generated code looks like this: namespace ProxyManagerGeneratedProxy\__PM__\Foo;
class Generatede07f73e523c2fb4772e096fa7615d794 implements \ProxyManager\Proxy\NullObjectInterface
{
private static $signaturee07f73e523c2fb4772e096fa7615d794 = 'YTozOntzOjk6ImNsYXNzTmFtZSI7czozOiJGb28iO3M6NzoiZmFjdG9yeSI7czozODoiUHJveHlNYW5hZ2VyXEZhY3RvcnlcTnVsbE9iamVjdEZhY3RvcnkiO3M6MTk6InByb3h5TWFuYWdlclZlcnNpb24iO3M6NDY6IjIuMC4xQDZjODliN2JkNjAzOWQ4MDQ3YjE0NzNlMjA3NGNiNTZiYWE0YmMxNWQiO30=';
/**
* Constructor for null object initialization
*/
public static function staticProxyConstructor()
{
static $reflection;
$reflection = $reflection ?: $reflection = new \ReflectionClass(__CLASS__);
$instance = (new \ReflectionClass(get_class()))->newInstanceWithoutConstructor();
return $instance;
}
} Since If I add this: Am I on the right track at all? Or does the above give you enough information to resolve this fairly quickly? I'm not terribly familiar with ProxyManager's internals, so I'd rather check with you before digging any deeper. |
I suggest writing a functional test case first: see Also, please remember to use absolute references for files, as the branches keep moving, and the diffs change (and your links become invalid) EDIT: I updated your links |
Corrected via #301. Rewording title though, as the return types were actually respected, but the inheritance wasn't. |
It seems to me that classes with PHP7 return types fail.
Is there a workaround/fix for this issue?
The text was updated successfully, but these errors were encountered: