Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Router;
|
||||
|
||||
use App\Framework\Core\Route;
|
||||
@@ -16,21 +18,26 @@ final readonly class RouteCollection implements Countable
|
||||
public function __construct(
|
||||
private array $routes,
|
||||
private array $namedRoutes = []
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
public function getStatic(Method $method): array {
|
||||
public function getStatic(Method $method): array
|
||||
{
|
||||
return $this->routes[$method->value]['static'] ?? [];
|
||||
}
|
||||
|
||||
public function getDynamic(Method $method): array {
|
||||
public function getDynamic(Method $method): array
|
||||
{
|
||||
return $this->routes[$method->value]['dynamic'] ?? [];
|
||||
}
|
||||
|
||||
public function has(Method $method): bool {
|
||||
public function has(Method $method): bool
|
||||
{
|
||||
return isset($this->routes[$method->value]);
|
||||
}
|
||||
|
||||
public function getByMethod(Method $method): array {
|
||||
public function getByMethod(Method $method): array
|
||||
{
|
||||
|
||||
return ($this->routes[$method->value]['dynamic'] + $this->routes[$method->value]['static']) ?? [];
|
||||
}
|
||||
@@ -52,8 +59,8 @@ final readonly class RouteCollection implements Countable
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function hasName(string $name): bool {
|
||||
public function hasName(string $name): bool
|
||||
{
|
||||
return isset($this->namedRoutes[$name]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user