SourceMagic::_call()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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