for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PhpUnitGen\Model;
use PhpUnitGen\Model\ModelInterface\FunctionModelInterface;
use PhpUnitGen\Model\ModelInterface\ParameterModelInterface;
use PhpUnitGen\Model\PropertyInterface\ParentInterface;
use PhpUnitGen\Model\PropertyTrait\AbstractTrait;
use PhpUnitGen\Model\PropertyTrait\FinalTrait;
use PhpUnitGen\Model\PropertyTrait\NamespaceTrait;
use PhpUnitGen\Model\PropertyTrait\NameTrait;
use PhpUnitGen\Model\PropertyTrait\StaticTrait;
use PhpUnitGen\Model\PropertyTrait\VisibilityTrait;
/**
* Class FunctionModel.
*
* @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 FunctionModel implements FunctionModelInterface
{
use NamespaceTrait;
use NameTrait;
use VisibilityTrait;
use StaticTrait;
use FinalTrait;
use AbstractTrait;
* @var ParentInterface|null $parent The parent which contains this function.
private $parent;
* @var ParameterModel[] $parameters The function methods.
private $parameters = [];
* @var ReturnModel $return The function return.
private $return;
$return
* {@inheritdoc}
public function setParent(?ParentInterface $parent): void
$this->parent = $parent;
}
public function getParent(): ?ParentInterface
return $this->parent;
public function addParameter(ParameterModelInterface $parameter): void
$this->parameters[] = $parameter;
public function getParameters(): array
return $this->parameters;