for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PhpUnitGen\Parser\NodeParser;
use PhpParser\Node;
use PhpUnitGen\Model\ModelInterface\PhpFileModelInterface;
use PhpUnitGen\Parser\NodeParser\NodeParserInterface\UseNodeParserInterface;
/**
* Class UseNodeParser.
*
* @author Paul Thébaud <[email protected]>.
* @copyright 2017-2018 Paul Thébaud <[email protected]>.
* @license https://opensource.org/licenses/MIT The MIT license.
* @link https://github.com/paul-thebaud/phpunit-generator
* @since Class available since Release 2.0.0.
*/
class UseNodeParser extends AbstractNodeParser implements UseNodeParserInterface
{
* {@inheritdoc}
public function invoke(Node\Stmt\Use_ $node, PhpFileModelInterface $parent): PhpFileModelInterface
foreach ($node->uses as $use) {
$parent->addUse($use->alias, $use->name->toString());
}
return $parent;