minor #13210 simplify hasScheme method (tjomamokrenko)

This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #13210).

Discussion
----------

simplify hasScheme method

... and correct the mistake in docblock

Commits
-------

ad0d93b simplify hasScheme method
This commit is contained in:
Fabien Potencier 2015-01-03 11:51:47 +01:00
commit cb79d91059

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()
{