4 * This file is part of the Prophecy.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
6 * Marcello Duarte <marcello.duarte@gmail.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Prophecy\Doubler\Generator\Node;
17 * @author Konstantin Kudryashov <ever.zet@gmail.com>
24 private $optional = false;
25 private $byReference = false;
26 private $isVariadic = false;
27 private $isNullable = false;
32 public function __construct($name)
37 public function getName()
42 public function getTypeHint()
44 return $this->typeHint;
47 public function setTypeHint($typeHint = null)
49 $this->typeHint = $typeHint;
52 public function hasDefault()
54 return $this->isOptional() && !$this->isVariadic();
57 public function getDefault()
59 return $this->default;
62 public function setDefault($default = null)
64 $this->optional = true;
65 $this->default = $default;
68 public function isOptional()
70 return $this->optional;
73 public function setAsPassedByReference($byReference = true)
75 $this->byReference = $byReference;
78 public function isPassedByReference()
80 return $this->byReference;
83 public function setAsVariadic($isVariadic = true)
85 $this->isVariadic = $isVariadic;
88 public function isVariadic()
90 return $this->isVariadic;
93 public function isNullable()
95 return $this->isNullable;
98 public function setAsNullable($isNullable = true)
100 $this->isNullable = $isNullable;