You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.
Is it right behavior that TypeGenerator does not think self type is an internal type?
Because of that my code generation causes wrong return type in resulting file. public function foo(): self
turns on public function foo(): \self
It thinks self is a class.
Zend\Code\Generator\TypeGenerator:36 private static $internalPhpTypes = ['void', 'int', 'float', 'string', 'bool', 'array', 'callable', 'iterable'];
The text was updated successfully, but these errors were encountered:
@mastiuhin-olexandr self is an alias for "this class". Passing self to the TypeGenerator is incorrect, as self has no meaning without its surrounding context.
I'd rather say that it should be rejected completely, and an exception should be thrown.
Is it right behavior that TypeGenerator does not think self type is an internal type?
Because of that my code generation causes wrong return type in resulting file.
public function foo(): self
turns on
public function foo(): \self
It thinks self is a class.
Zend\Code\Generator\TypeGenerator:36
private static $internalPhpTypes = ['void', 'int', 'float', 'string', 'bool', 'array', 'callable', 'iterable'];
The text was updated successfully, but these errors were encountered: