Passed
Push — master ( 46cb80...c9437b )
by Mauro
02:03
created

BaseTask::getInput()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace App\Controller\Task;
4
5
use App\Controller\BaseController;
6
use App\Service\TaskService;
7
use Slim\Container;
8
9
/**
10
 * Base Task Controller.
11
 */
12 View Code Duplication
abstract class BaseTask extends BaseController
13
{
14
    /**
15
     * @param Container $container
16
     */
17
    public function __construct(Container $container)
18
    {
19
        $this->logger = $container->get('logger');
20
        $this->database = $container->get('db');
21
    }
22
23
    /**
24
     * @return TaskService
25
     */
26
    protected function getTaskService()
27
    {
28
        $service = new TaskService($this->database);
29
30
        return $service;
31
    }
32
33
    /**
34
     * @return array
35
     */
36
    protected function getInput()
37
    {
38
        return $this->request->getParsedBody();
39
    }
40
}
41