Skip to content

Commit

Permalink
[Console] added hasOption and hasArgument to Input
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Mar 1, 2010
1 parent 0c3a4b1 commit 165b983
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/Symfony/Components/Console/Input/Input.php
Expand Up @@ -129,6 +129,18 @@ public function setArgument($name, $value)
$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.
*
Expand Down Expand Up @@ -171,4 +183,16 @@ public function setOption($name, $value)

$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);
}
}

0 comments on commit 165b983

Please sign in to comment.