AbstractController::pushEntrypoint()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
rs 10
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