model   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 8
dl 0
loc 22
c 0
b 0
f 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A get_services() 0 2 1
A get_component() 0 2 1
A __construct() 0 3 1
A get_service() 0 2 2
1
<?php
2
3
/**
4
 * © 2018 - Phoponent
5
 * Author: Nicolas Choquet
6
 * Email: [email protected]
7
 * LICENSE GPL ( GNU General Public License )
8
 */
9
10
namespace phoponent\framework\traits;
11
12
trait model {
13
	private $services = [];
14
	private $component = '';
15
    public function __construct($services, string $component) {
16
        $this->services = $services;
17
		$this->component = $component;
18
    }
19
20
    protected function get_services() {
21
    	return $this->services;
22
	}
23
24
	/**
25
	 * @param $name
26
	 * @return service|null
27
	 */
28
	protected function get_service($name) {
29
    	return isset($this->services[$name]) ? $this->services[$name] : null;
30
	}
31
32
	public function get_component() {
33
		return $this->component;
34
	}
35
}