Passed
Push — master ( 4a4466...1554de )
by Mauro
03:16
created

src/Controller/User/BaseUser.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace App\Controller\User;
4
5
use App\Controller\BaseController;
6
use App\Service\UserService;
7
use Slim\Container;
8
9
/**
10
 * Base User Controller.
11
 */
12
abstract class BaseUser extends BaseController
13
{
14
    /**
15
     * @var UserService
16
     */
17
    protected $userService;
18
19
    /**
20
     * @param Container $container
21
     */
22
    public function __construct(Container $container)
23
    {
24
        $this->container = $container;
0 ignored issues
show
The property container does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
25
        $this->logger = $container->get('logger');
26
    }
27
28
    /**
29
     * @return UserService
30
     */
31
    protected function getUserService()
32
    {
33
        return $this->container->get('user_service');
34
    }
35
36
    /**
37
     * @return array
38
     */
39
    protected function getInput()
40
    {
41
        return $this->request->getParsedBody();
42
    }
43
}
44