grom358 / pharborist

A PHP library to query and transform source code via tree operations.
GNU General Public License v3.0
44 stars 10 forks source link

SingleInheritanceNode::setImplements() screws up when passed an array of strings #201

Closed phenaproxima closed 9 years ago

phenaproxima commented 9 years ago

Passing an array of strings to this method should produce a CommaListNode like: ExecutableInterface, MyCrazyInterface

Instead, it will produce this: ExecutableInterfaceMyCrazyInterface

I think the culprit is line 135 in SingleInheritanceNode.php. It's currently this:

$implementList->append(NameNode::create($implement));

It needs to be this:

$implementList->appendItem(NameNode::create($implement));