/** * Removes tags by name. * * @param string|array|Argument $argumentName * * @return \ClassGeneration\ArgumentCollection */ public function removeByName($argumentName) { $removedList = new self(); $list = $this->getIterator(); foreach ($list as $index => $argument) { if ($argumentName instanceof Argument && $argumentName->getName() != $argument->getName() || is_string($argumentName) && $argument->getName() !== $argumentName) { continue; } $removedList->add(clone $argument); $this->remove($index); } return $removedList; }
public function testSetAndGetNameFormatted() { $argument = new Argument(array('name' => 'arg')); $this->assertEquals('arg', $argument->getName()); $this->assertEquals('$arg', $argument->getNameFormatted()); }