-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathUsersRouteActionsPresenter.php
73 lines (63 loc) · 1.67 KB
/
UsersRouteActionsPresenter.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
/*
* This file is part of Aplus Framework Routing Library.
*
* (c) Natan Felles <natanfelles@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Tests\Routing\Support;
use Framework\Routing\Attributes\Route;
use Framework\Routing\Attributes\RouteNotFound;
use Framework\Routing\PresenterInterface;
use Framework\Routing\RouteActions;
class UsersRouteActionsPresenter extends RouteActions implements PresenterInterface
{
#[Route('GET', '/users')]
public function index() : string
{
return __METHOD__;
}
#[Route('GET', '/users/new')]
public function new() : string
{
return __METHOD__;
}
#[Route('POST', '/users')]
#[Route('PATCH', '/users', name: 'repeated')]
public function create() : string
{
return __METHOD__;
}
#[Route('GET', '/users/{int}')]
public function show(string $id) : string
{
return __METHOD__ . '/' . $id;
}
#[Route('GET', '/users/{int}/edit')]
public function edit(string $id) : string
{
return __METHOD__ . '/' . $id;
}
#[Route('POST', '/users/{int}/update')]
public function update(string $id) : string
{
return __METHOD__ . '/' . $id;
}
#[Route('GET', '/users/{int}/remove')]
public function remove(string $id) : string
{
return __METHOD__ . '/' . $id;
}
#[Route('POST', '/users/{int}/delete')]
public function delete(string $id) : string
{
return __METHOD__ . '/' . $id;
}
#[RouteNotFound]
public function notFound() : string
{
return __METHOD__;
}
}