Completed
Push — master ( f70e9b...d917c4 )
by Peter
02:25
created

ApiLink::__callStatic()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 1
nc 1
nop 2
1
<?php
2
3
/*
4
 * To change this license header, choose License Headers in Project Properties.
5
 * To change this template file, choose Tools | Templates
6
 * and open the template in the editor.
7
 */
8
9
namespace Maslosoft\Zamm;
10
11
/**
12
 * ApiLink
13
 *
14
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
15
 */
16
class ApiLink implements Interfaces\SourceAccessorInterface
17
{
18
19
	use Traits\SourceMagic;
20
21
	private static $source = '';
22
	private $dotName = '';
23
24
	public function __construct($className = null, $text = '')
25
	{
26
		$this->dotName = str_replace('\\', '.', $className);
27
	}
28
29
	public function method($name, $text = '')
30
	{
31
		// https://df.home/zamm/api/class-Maslosoft.Zamm.Decorators.AbstractDecorator.html#_decorate
32
		$href = sprintf('%s/class-%s.html#_%s', self::$source, $this->dotName, $name);
33
		return sprintf('<a href="%s">%s</a>', $href, $name);
34
	}
35
36
	public function property($name, $text = '')
37
	{
38
		// https://df.home/zamm/api/class-Maslosoft.Zamm.Zamm.html#$decorators
39
		$href = sprintf('%s/class-%s.html#$%s', self::$source, $this->dotName, $name);
40
		return sprintf('<a href="%s">%s</a>', $href, $name);
41
	}
42
43
	public static function __callStatic($name, $arguments)
44
	{
45
		
46
	}
47
48
}
49