Issues (55)

src/User/UserController.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Seb\User;
4
5
use Anax\Commons\ContainerInjectableInterface;
6
use Anax\Commons\ContainerInjectableTrait;
7
use Seb\User\HTMLForm\UserLoginForm;
8
use Seb\User\HTMLForm\CreateUserForm;
9
10
/**
11
 * A sample controller to show how a controller class can be implemented.
12
 */
13
class UserController implements ContainerInjectableInterface
14
{
15
    use ContainerInjectableTrait;
16
17
    /**
18
     * @var $data description
19
     */
20
21
22
    /**
23
     * Description.
24
     *
25
     * @param datatype $variable Description
0 ignored issues
show
The type Seb\User\datatype was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
26
     *
27
     * @throws Exception
28
     *
29
     * @return object as a response object
30
     */
31 1
    public function indexActionGet() : object
32
    {
33 1
        $page = $this->di->get("page");
34
35 1
        $page->add("anax/v2/article/default", [
36 1
            "content" => "An index page",
37
        ]);
38
39 1
        return $page->render([
40 1
            "title" => "A index page",
41
        ]);
42
    }
43
44
    /**
45
     * Description.
46
     *
47
     * @param datatype $variable Description
48
     *
49
     * @throws Exception
50
     *
51
     * @return object as a response object
52
     */
53 1
    public function loginAction() : object
54
    {
55 1
        $page = $this->di->get("page");
56 1
        $form = new UserLoginForm($this->di);
57 1
        $form->check();
58
59 1
        $page->add("anax/v2/article/default", [
60 1
            "content" => $form->getHTML(),
61
        ]);
62
63 1
        return $page->render([
64 1
            "title" => "A login page",
65
        ]);
66
    }
67
68
    /**
69
     * Description.
70
     *
71
     * @param datatype $variable Description
72
     *
73
     * @throws Exception
74
     *
75
     * @return object as a response object
76
     */
77 1
    public function createAction() : object
78
    {
79 1
        $page = $this->di->get("page");
80 1
        $form = new CreateUserForm($this->di);
81 1
        $form->check();
82
83 1
        $page->add("anax/v2/article/default", [
84 1
            "content" => $form->getHTML(),
85
        ]);
86
87 1
        return $page->render([
88 1
            "title" => "A create user page",
89
        ]);
90
    }
91
}
92