From ad0d93baf40d6abe2cb9e5aa6a95b48fd55c7ccf Mon Sep 17 00:00:00 2001 From: Artiom Date: Sat, 3 Jan 2015 00:54:17 +0200 Subject: [PATCH] simplify hasScheme method ... and correct the mistake in docblock --- src/Symfony/Component/Routing/Route.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Routing/Route.php b/src/Symfony/Component/Routing/Route.php index d224d79108..c362f17e46 100644 --- a/src/Symfony/Component/Routing/Route.php +++ b/src/Symfony/Component/Routing/Route.php @@ -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() {