CreateEditRoutes   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 1
1
<?php
2
3
namespace Jidaikobo\Kontiki\Controllers\Routes;
4
5
use Slim\Routing\RouteCollectorProxy;
6
7
class CreateEditRoutes
8
{
9
    public static function register(
10
        RouteCollectorProxy $app,
11
        string $basePath,
12
        string $controllerClass
13
    ): void {
14
        $app->get("/{$basePath}/create", [$controllerClass, 'handleRenderCreateForm'])
15
            ->setName("{$basePath}|x_create|dashboard,sidebar,createButton");
16
        $app->post("/{$basePath}/create", [$controllerClass, 'handleCreate']);
17
        $app->get("/{$basePath}/edit/{id}", [$controllerClass, 'handleRenderEditForm']);
18
        $app->post("/{$basePath}/edit/{id}", [$controllerClass, 'handleEdit']);
19
    }
20
}
21