Skip to content

Commit ad0d93b

Browse files
Artiomfabpot
authored andcommitted
simplify hasScheme method
... and correct the mistake in docblock
1 parent 2ecf45c commit ad0d93b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/Symfony/Component/Routing/Route.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,23 @@ public function setSchemes($schemes)
251251
return $this;
252252
}
253253

254+
/**
255+
* Checks if a scheme requirement has been set.
256+
*
257+
* @param string $scheme
258+
*
259+
* @return bool true if the scheme requirement exists, otherwise false
260+
*/
261+
public function hasScheme($scheme)
262+
{
263+
return in_array(strtolower($scheme), $this->schemes, true);
264+
}
265+
254266
/**
255267
* Returns the uppercased HTTP methods this route is restricted to.
256268
* So an empty array means that any method is allowed.
257269
*
258-
* @return array The schemes
270+
* @return array The methods
259271
*/
260272
public function getMethods()
261273
{

0 commit comments

Comments
 (0)