private $description;
/**
- * @param string $name The argument name
- * @param int $mode The argument mode: self::REQUIRED or self::OPTIONAL
- * @param string $description A description text
- * @param mixed $default The default value (for self::OPTIONAL mode only)
+ * @param string $name The argument name
+ * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL
+ * @param string $description A description text
+ * @param string|string[]|null $default The default value (for self::OPTIONAL mode only)
*
* @throws InvalidArgumentException When argument mode is not valid
*/
{
if (null === $mode) {
$mode = self::OPTIONAL;
- } elseif (!is_int($mode) || $mode > 7 || $mode < 1) {
+ } elseif (!\is_int($mode) || $mode > 7 || $mode < 1) {
throw new InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode));
}
/**
* Sets the default value.
*
- * @param mixed $default The default value
+ * @param string|string[]|null $default The default value
*
* @throws LogicException When incorrect default value is given
*/
if ($this->isArray()) {
if (null === $default) {
$default = array();
- } elseif (!is_array($default)) {
+ } elseif (!\is_array($default)) {
throw new LogicException('A default value for an array argument must be an array.');
}
}
/**
* Returns the default value.
*
- * @return mixed The default value
+ * @return string|string[]|null The default value
*/
public function getDefault()
{