Completed
Push — master ( 460020...c44764 )
by Mauro
02:34
created

BaseUser::getUserService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 6
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace App\Controller\User;
4
5
use App\Controller\BaseController;
6
use App\Service\UserService;
7
8
/**
9
 * Base User Controller.
10
 */
11 View Code Duplication
abstract class BaseUser extends BaseController
1 ignored issue
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
{
13
    /**
14
     * @param \Slim\Container $container
15
     */
16
    public function __construct(\Slim\Container $container)
17
    {
18
        $this->logger = $container->get('logger');
19
        $this->database = $container->get('db');
20
    }
21
22
    /**
23
     * @return UserService
24
     */
25
    protected function getUserService()
26
    {
27
        $service = new UserService($this->database);
28
29
        return $service;
30
    }
31
}
32