mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-23 16:13:50 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -36,17 +36,10 @@ class CRUDRoutesLoader extends Loader
|
||||
Request::METHOD_DELETE,
|
||||
];
|
||||
|
||||
protected array $apiCrudConfig = [];
|
||||
|
||||
protected array $crudConfig = [];
|
||||
|
||||
private bool $isLoaded = false;
|
||||
|
||||
public function __construct(array $crudConfig, array $apiCrudConfig)
|
||||
public function __construct(protected array $crudConfig, protected array $apiCrudConfig)
|
||||
{
|
||||
$this->crudConfig = $crudConfig;
|
||||
$this->apiCrudConfig = $apiCrudConfig;
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
@@ -104,23 +97,11 @@ class CRUDRoutesLoader extends Loader
|
||||
// continue;
|
||||
}
|
||||
|
||||
// compute default action
|
||||
switch ($name) {
|
||||
case '_entity':
|
||||
$controllerAction = 'entityApi';
|
||||
|
||||
break;
|
||||
|
||||
case '_index':
|
||||
$controllerAction = 'indexApi';
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
$controllerAction = $name . 'Api';
|
||||
|
||||
break;
|
||||
}
|
||||
$controllerAction = match ($name) {
|
||||
'_entity' => 'entityApi',
|
||||
'_index' => 'indexApi',
|
||||
default => $name . 'Api',
|
||||
};
|
||||
|
||||
$defaults = [
|
||||
'_controller' => $controller . ':' . ($action['controller_action'] ?? $controllerAction),
|
||||
|
Reference in New Issue
Block a user