[Console] added hasOption and hasArgument to Input

This commit is contained in:
Fabien Potencier 2010-03-01 11:24:21 +01:00
parent 0c3a4b15ec
commit 165b9832fe
1 changed files with 24 additions and 0 deletions

View File

@ -129,6 +129,18 @@ abstract class Input implements InputInterface
$this->arguments[$name] = $value;
}
/**
* Returns true if an InputArgument object exists by name or position.
*
* @param string|integer $name The InputArgument name or position
*
* @return Boolean true if the InputArgument object exists, false otherwise
*/
public function hasArgument($name)
{
return $this->definition->hasArgument($name);
}
/**
* Returns the options values.
*
@ -171,4 +183,16 @@ abstract class Input implements InputInterface
$this->options[$name] = $value;
}
/**
* Returns true if an InputOption object exists by name.
*
* @param string $name The InputOption name
*
* @return Boolean true if the InputOption object exists, false otherwise
*/
public function hasOption($name)
{
return $this->definition->hasOption($name);
}
}