SourceMagic   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __get() 0 4 1
A _get() 0 4 1
A __call() 0 4 1
A _call() 0 4 1
method() 0 1 ?
property() 0 1 ?
1
<?php
2
3
/**
4
 * This software package is licensed under `AGPL, Commercial` license[s].
5
 *
6
 * @package maslosoft/zamm
7
 * @license AGPL, Commercial
8
 *
9
 * @copyright Copyright (c) Peter Maselkowski <[email protected]>
10
 * @link https://maslosoft.com/zamm/
11
 */
12
13
namespace Maslosoft\Zamm\Traits;
14
15
use Maslosoft\Zamm\Interfaces\SourceAccessorInterface;
16
17
/**
18
 * GetSet
19
 * @see SourceAccessorInterface
20
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
21
 */
22
trait SourceMagic
23
{
24
25
	public function __get($name)
26
	{
27
		return $this->_get($name);
28
	}
29
30
	// To allow override of __get
31
	protected function _get($name)
32
	{
33
		return $this->property($name);
34
	}
35
36
	public function __call($name, $arguments)
37
	{
38
		return $this->_call($name);
39
	}
40
41
	// To allow override of __call
42
	public function _call($name)
43
	{
44
		return $this->method($name);
45
	}
46
47
	abstract public function method($name);
48
49
	abstract public function property($name);
50
}
51