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 8, 2020. It is now read-only.
When a class generator is told the output class should implement an interface that exists in a separate namespace to the one the class is in, the implements interface is missing a slash.
<?php
require_once __DIR__ . '/./library/Zend/Loader/ClassMapAutoloader.php';
$loader = new Zend\Loader\ClassMapAutoloader();
//$loader->registerAutoloadMap(__DIR__ . '/./library/Zend/.classmap.php');
$loader->registerAutoloadMap(__DIR__ . '/./library/autoload_classmap.php');
$loader->register();
use Zend\Code\Reflection\ClassReflection;
use Zend\Code\Generator\ClassGenerator;
$classGenerator = new ClassGenerator();
$classGenerator->setName('OutputClass');
$classGenerator->setNamespaceName('SecondNamespace');
$classGenerator->setImplementedInterfaces(['FirstNamespace\SomeInterface']);
$text = $classGenerator->generate();
echo $text;
Expected output:
namespace Third;
class OutputClass implements \First\SomeInterface
{
}
Actual output:
namespace Third;
class OutputClass implements First\SomeInterface
{
}
The text was updated successfully, but these errors were encountered:
When a class generator is told the output class should implement an interface that exists in a separate namespace to the one the class is in, the
implements interface
is missing a slash.Expected output:
Actual output:
The text was updated successfully, but these errors were encountered: