Gère davantage de cas dans le routeur
This commit is contained in:
17
src/Silex/Router/PathHelper.php
Normal file
17
src/Silex/Router/PathHelper.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Silex\Router;
|
||||
|
||||
final class PathHelper
|
||||
{
|
||||
public static function removeEverythingAfter(string $str, string $char): string
|
||||
{
|
||||
$pos = strpos($str, $char);
|
||||
if ($pos !== false) {
|
||||
return substr($str, 0, $pos);
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user