package and depencies
This commit is contained in:
@@ -23,22 +23,22 @@ use Symfony\Component\Routing\RouteCollection;
|
||||
*/
|
||||
class StaticPrefixCollection
|
||||
{
|
||||
private $prefix;
|
||||
private string $prefix;
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private $staticPrefixes = [];
|
||||
private array $staticPrefixes = [];
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private $prefixes = [];
|
||||
private array $prefixes = [];
|
||||
|
||||
/**
|
||||
* @var array[]|self[]
|
||||
*/
|
||||
private $items = [];
|
||||
private array $items = [];
|
||||
|
||||
public function __construct(string $prefix = '/')
|
||||
{
|
||||
@@ -60,10 +60,8 @@ class StaticPrefixCollection
|
||||
|
||||
/**
|
||||
* Adds a route to a group.
|
||||
*
|
||||
* @param array|self $route
|
||||
*/
|
||||
public function addRoute(string $prefix, $route)
|
||||
public function addRoute(string $prefix, array|StaticPrefixCollection $route)
|
||||
{
|
||||
[$prefix, $staticPrefix] = $this->getCommonPrefix($prefix, $prefix);
|
||||
|
||||
@@ -154,7 +152,7 @@ class StaticPrefixCollection
|
||||
try {
|
||||
for ($i = $baseLength; $i < $end && $prefix[$i] === $anotherPrefix[$i]; ++$i) {
|
||||
if ('(' === $prefix[$i]) {
|
||||
$staticLength = $staticLength ?? $i;
|
||||
$staticLength ??= $i;
|
||||
for ($j = 1 + $i, $n = 1; $j < $end && 0 < $n; ++$j) {
|
||||
if ($prefix[$j] !== $anotherPrefix[$j]) {
|
||||
break 2;
|
||||
|
Reference in New Issue
Block a user