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 was archived by the owner on Jan 29, 2020. It is now read-only.
via $foo = ClassGenerator::fromReflection(ClassReflection(new \Sample\ReflectionIssue\SampleClass())); it will generate the following (invalid) output:
I've bumped into the same issue on PHP 7.0.1 (cli).
On top of this I noticed while using the FileGenerator::fromReflectedFileName() method, that it also changes Interface names that are included with a use statement into the FQN.
For example:
Source
<?phpnamespaceTesting;
usePhpro\SoapClient\Type\ResultInterface;
class ArrayOfForecast implements ResultInterface
{
// OLD BODY
}
Destination:
<?phpnamespaceTesting;
usePhpro\SoapClient\Type\ResultInterface;
class ArrayOfForecast implementsPhpro\SoapClient\Type\ResultInterface
{
// NEW BODY
}
As you can see the trailing slash is missing and it should rather use the short name of the interface like in the source file.
In the ClassGenerator, you do have access to the use statements as far as I can tell from the code. Is this something that is possible?
It is not possible to load a class that that extends or implements other classes without breaking the fully qualified names of the classes.
For example, if you load a reflection of this class
via
$foo = ClassGenerator::fromReflection(ClassReflection(new \Sample\ReflectionIssue\SampleClass()));
it will generate the following (invalid) output:It's missing the leading backslash in front of the fully qualified class name.
The text was updated successfully, but these errors were encountered: