/** * @covers \DCarbone\PHPClassBuilder\Template\Structure\VariableTemplate::setName * @covers \DCarbone\PHPClassBuilder\Template\Structure\VariableTemplate::getName * @covers \DCarbone\PHPClassBuilder\Utilities\NameUtils::isValidVariableName * @depends testCanConstructWithoutArguments * @param VariableTemplate $variable */ public function testCanSetNamePostConstruct(VariableTemplate $variable) { $variable->setName('vartest'); $this->assertEquals('vartest', $variable->getName()); }
/** * @param VariableTemplate $parameter * @throws \DCarbone\PHPClassBuilder\Exception\MissingNameException */ public function addParameter(VariableTemplate $parameter) { $name = $parameter->getName(); if (null === $name) { throw $this->createMissingNameException('Function parameters must have a name prior to adding them'); } $this->_parameters[$name] = $parameter; }
/** * @param VariableTemplate $property */ public function addProperty(VariableTemplate $property) { $this->_properties[$property->getName()] = $property; }