Passed
Pull Request — master (#50)
by Ronan
05:05
created

AdminController::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 11
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
namespace App\Controller\User;
4
5
use App\Facades\Router;
6
use App\Facades\Security;
7
use App\Facades\Session;
8
use App\Facades\View;
9
use App\Model\User;
10
use Exception;
11
use Psr\Http\Message\ResponseInterface;
12
use Psr\Http\Message\ServerRequestInterface;
13
use Ronanchilvers\Orm\Orm;
14
use RuntimeException;
15
16
/**
17
 * Controller for administering users
18
 *
19
 * @author Ronan Chilvers <[email protected]>
20
 */
21
class AdminController
22
{
23
    /**
24
     * Login action for users
25
     *
26
     * @author Ronan Chilvers <[email protected]>
27
     */
28
    public function index(
29
        ServerRequestInterface $request,
30
        ResponseInterface $response
31
    ) {
32
        $users = Orm::finder(User::class)->all();
33
34
        return View::render(
35
            $response,
36
            'user/admin/index.html.twig',
37
            [
38
                'users' => $users,
39
            ]
40
        );
41
    }
42
43
    /**
44
     * Invite a user
45
     *
46
     * @author Ronan Chilvers <[email protected]>
47
     */
48
    public function invite(
49
        ServerRequestInterface $request,
50
        ResponseInterface $response,
51
        $args
0 ignored issues
show
Unused Code introduced by
The parameter $args is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

51
        /** @scrutinizer ignore-unused */ $args

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
52
    ) {
53
        return View::render(
54
            $response,
55
            'user/admin/invite.html.twig',
56
        );
57
    }
58
}
59