Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ad0d93b

Browse filesBrowse files
Artiomfabpot
Artiom
authored andcommitted
simplify hasScheme method
... and correct the mistake in docblock
1 parent 2ecf45c commit ad0d93b
Copy full SHA for ad0d93b

File tree

1 file changed

+13
-1
lines changed
Filter options

1 file changed

+13
-1
lines changed

‎src/Symfony/Component/Routing/Route.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/Route.php
+13-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.