Completed
Push — master ( d917c4...8e6dfe )
by Peter
02:04
created

ShortNamer::_property()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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 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
 *
11
 */
12
13
namespace Maslosoft\Zamm;
14
15
use Maslosoft\Zamm\Helpers\InlineWrapper;
16
17
/**
18
 * This simply return names of methods and properties, without class name or short class name.
19
 * This is helper for IDE's.
20
 * Use this together with @var type hint.
21
 *
22
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
23
 */
24
class ShortNamer extends Namer
25
{
26
27
	use Traits\SourceMagic;
28
29
	protected function _method($name)
30
	{
31
		return sprintf('%s()', $name);
32
	}
33
34
	public function _property($name)
35
	{
36
		return sprintf('$%s', $name);
37
	}
38
39
	protected function _type()
40
	{
41
		return $this->info->getShortName();
42
	}
43
44
}
45