package and depencies

This commit is contained in:
RafficMohammed
2023-01-08 02:57:24 +05:30
parent d5332eb421
commit 1d54b8bc7f
4309 changed files with 193331 additions and 172289 deletions

View File

@@ -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;