This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Description
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'];
Activity
Ocramius commentedon Oct 15, 2018
@mastiuhin-olexandr
selfis an alias for "this class". Passingselfto theTypeGeneratoris incorrect, asselfhas no meaning without its surrounding context.I'd rather say that it should be rejected completely, and an exception should be thrown.
weierophinney commentedon Dec 31, 2019
This repository has been closed and moved to laminas/laminas-code; a new issue has been opened at laminas/laminas-code#4.