Closed iggyvolz closed 3 years ago
Version: 3.5.4 (also reproduced on master)
When performing a ClassType::from on an interface which extends another interface, the relation is marked as an implements relationship rather than an extends relationship.
<?php require_once __DIR__ . "/vendor/autoload.php"; interface a{} interface b extends a{} echo \Nette\PhpGenerator\ClassType::from(b::class);
Gives:
interface b implements a { }
interface b extends a { }
The check here https://github.com/nette/php-generator/blob/a375837e177728f8f85e0ae1dda1d57e0d7cb02d/src/PhpGenerator/Factory.php#L44 may need to split based on whether the class is an interface or not - from my understanding interfaces can only extend other interfaces.
fixed
Version: 3.5.4 (also reproduced on master)
Bug Description
When performing a ClassType::from on an interface which extends another interface, the relation is marked as an implements relationship rather than an extends relationship.
Steps To Reproduce
Gives:
Expected Behavior
Possible Solution
The check here https://github.com/nette/php-generator/blob/a375837e177728f8f85e0ae1dda1d57e0d7cb02d/src/PhpGenerator/Factory.php#L44 may need to split based on whether the class is an interface or not - from my understanding interfaces can only extend other interfaces.