Passed
Push — master ( 29baaf...069627 )
by Mihail
06:51
created

FormUpdate   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 29
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A before() 0 9 2
A make() 0 4 1
1
<?php
2
3
namespace Apps\Model\Admin\Application;
4
5
use Ffcms\Core\Arch\Model;
6
use Ffcms\Core\Exception\NotFoundException;
7
8
class FormUpdate extends Model
9
{
10
    private $_controller;
11
    private $_object;
12
13
    public function __construct($controller)
14
    {
15
        $this->_controller = $controller;
16
        parent::__construct();
17
    }
18
19
    /**
20
    * Magic method before example
21
    */
22
    public function before()
23
    {
24
        $class = 'Apps\Controller\Admin\\' . $this->_controller;
25
        if (class_exists($class)) {
26
            $this->_object = new $class;
27
        } else {
28
            throw new NotFoundException('Admin controller is not founded - %c%', ['c' => $this->_controller]);
29
        }
30
    }
31
32
    public function make()
33
    {
34
35
    }
36
}