for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the ClassGeneration package.
*
* (c) Antonio Spinelli <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace ClassGeneration\Composition;
use ClassGeneration\Element\ElementAbstract;
use ClassGeneration\Element\ElementInterface;
use ClassGeneration\PhpClass;
/**
* Composition Method ClassGeneration
* @author Antonio Spinelli <[email protected]>
abstract class Method extends ElementAbstract implements MethodInterface
{
* The class name.
* @var string
protected $name;
protected $traitName;
* @inheritdoc
public function init()
}
* @return Method
public function setParent(ElementInterface $parent)
if (!$parent instanceof PhpClass) {
throw new \InvalidArgumentException('Only accept instances from ClassGeneration\PhpClass');
return parent::setParent($parent);
* @return PhpClass
public function getParent()
return parent::getParent();
public function setName($name)
$this->name = (string)$name;
return $this;
public function getName()
return $this->name;
public function getTraitName()
return $this->traitName;
public function setTraitName($traitName)
$this->traitName = $traitName;