simplify hasScheme method

... and correct the mistake in docblock
This commit is contained in:
Artiom 2015-01-03 00:54:17 +02:00 committed by Fabien Potencier
parent 2ecf45c0f2
commit ad0d93baf4

View File

@ -251,11 +251,23 @@ class Route implements \Serializable
return $this;
}
/**
* Checks if a scheme requirement has been set.
*
* @param string $scheme
*
* @return bool true if the scheme requirement exists, otherwise false
*/
public function hasScheme($scheme)
{
return in_array(strtolower($scheme), $this->schemes, true);
}
/**
* Returns the uppercased HTTP methods this route is restricted to.
* So an empty array means that any method is allowed.
*
* @return array The schemes
* @return array The methods
*/
public function getMethods()
{