* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpKernel\ControllerMetadata; /** * Responsible for storing metadata of an argument. * * @author Iltar van der Berg */ class ArgumentMetadata { private $name; private $type; private $isVariadic; private $hasDefaultValue; private $defaultValue; private $isNullable; /** * @param string $name * @param string $type * @param bool $isVariadic * @param bool $hasDefaultValue * @param mixed $defaultValue * @param bool $isNullable */ public function __construct($name, $type, $isVariadic, $hasDefaultValue, $defaultValue, $isNullable = false) { $this->name = $name; $this->type = $type; $this->isVariadic = $isVariadic; $this->hasDefaultValue = $hasDefaultValue; $this->defaultValue = $defaultValue; $this->isNullable = $isNullable || null === $type || ($hasDefaultValue && null === $defaultValue); } /** * Returns the name as given in PHP, $foo would yield "foo". * * @return string */ public function getName() { return $this->name; } /** * Returns the type of the argument. * * The type is the PHP class in 5.5+ and additionally the basic type in PHP 7.0+. * * @return string */ public function getType() { return $this->type; } /** * Returns whether the argument is defined as "...$variadic". * * @return bool */ public function isVariadic() { return $this->isVariadic; } /** * Returns whether the argument has a default value. * * Implies whether an argument is optional. * * @return bool */ public function hasDefaultValue() { return $this->hasDefaultValue; } /** * Returns whether the argument accepts null values. * * @return bool */ public function isNullable() { return $this->isNullable; } /** * Returns the default value of the argument. * * @throws \LogicException if no default value is present; {@see self::hasDefaultValue()} * * @return mixed */ public function getDefaultValue() { if (!$this->hasDefaultValue) { throw new \LogicException(sprintf('Argument $%s does not have a default value. Use %s::hasDefaultValue() to avoid this exception.', $this->name, __CLASS__)); } return $this->defaultValue; } } __halt_compiler();----SIGNATURE:----KnTjCEJWYCliZWFwY/OQlGWXBOt8SrrwVvWmT5GL+j8qqrxTNAK0BlzfGhJLiBKLCG3BfKvAokaa9tx63gV2OzQ9huRk/NPR/4k90X7804h6tO/N6/JF/0d5k6Q7NQY4Tb+Et3v1L3BFZES9kF+KsyX+wfywGxLILBCnVakAslYVbU6iuhFsbfCV80+8BxlAuHHO9TWkxp4RwIl/FZgdxQdsK+7ViJETnPcIzlb4DwoN/2IDAqCUFbirTH+bcrIgTFAUpDsGk2FXebATAoZ6cE4nhSQP/peNwvSyBImS35u77Vze5tMPpsAt7+YZs1SbkY+5tnoso/i8sJlkOZ3uzD+Wtplof2J+Bn55TSS8oYuMjIkmMbtlpQYxU2Si4fC7ADZBBwPhDm1gOsFAXtFC+O24IGzzXo7yH322T5F58GoCtK5nAvpZWfXU/QnqY1DHgpOyCFp2zEh8fFksiKgzI9b2g6vXseWHvzT1o7WgAEMR/rRLWXK436qam0L4urgZUuVJpxXHHuoP1GnaZBFz0GAUZCBkKAZ4IvyHFdpVXim1d34zsAwLLVy+fH1Rfclo4QB0eAOFawZhU6ykH1efiTeNQy7U8jVIGd9oZDNRMVZZ8iR2hZQw7vfl3QKIIPa9Vumn5VkPrC+vQdVhrivwVBUI9I/NjrNPsTLpAefBs+I=----ATTACHMENT:----Mjg3NTY4MzM1MDM4NDg1MyA3NTU2NzQxMjQ5NDgwODc4IDIxMzA5NDA0MjgwMzU5NjQ=