for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the FOSRestBundle package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace FOS\RestBundle\Controller\Annotations;
use Symfony\Component\Validator\Constraints;
/**
* {@inheritdoc}
* @author Jordi Boggiano <[email protected]>
* @author Boris Guéry <[email protected]>
* @author Ener-Getick <[email protected]>
abstract class AbstractParam implements ParamInterface
{
/** @var string */
public $name;
public $key;
/** @var mixed */
public $default;
public $description;
/** @var bool */
public $strict = false;
public $nullable = false;
/** @var array */
public $incompatibles = array();
/** {@inheritdoc} */
public function getName()
return $this->name;
}
public function getDefault()
return $this->default;
public function getDescription()
return $this->description;
public function getIncompatibilities()
return $this->incompatibles;
public function getConstraints()
$constraints = array();
if (!$this->nullable) {
$constraints[] = new Constraints\NotNull();
return $constraints;
public function isStrict()
return $this->strict;
* @return string
protected function getKey()
return $this->key ?: $this->name;