Skip to content

Generated proxies don't respect magic methods' inherited signatures #346

@Ocramius

Description

@Ocramius

ProxyManager will raise multiple notices due to class signature incompatibility when proxying a class like following one:

class ClassWithTypedMagicMethods
{
    public function __get(string $name) : string { return 'foo'; }
    public function __set(string $name, string $value) : string { return 'foo'; }
    public function __unset(string $name) : bool { return true; }
    public function __isset(string $name) : bool { return true; }
}

A class generation/evaluation test is sufficient for this scenario. The issue is simple: class signature should be copied, when available, instead of being constructed from scratch.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions