AbstractController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 10
c 2
b 0
f 0
dl 0
loc 22
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A pushEntrypoint() 0 7 1
1
<?php
2
3
namespace SlimX\Controllers;
4
5
abstract class AbstractController
6
{
7
    private $entrypoints;
8
9
    protected $app;
10
    protected $container;
11
12
    public function __construct(\Slim\App $app)
13
    {
14
        $this->app = $app;
15
        $this->container = $app->getContainer();
16
    }
17
18
    abstract public function loadActions();
19
20
    public function pushEntrypoint(Action $action)
21
    {
22
        $app = $this->app;
23
        $this->entrypoints[] = $action;
24
25
        $method = $action->getMethod();
26
        $app->$method($action->getPattern(), $action->getCallable());
27
    }
28
}
29