ManganelMeta::method()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
/**
4
 * This software package is licensed under `AGPL-3.0-only, proprietary` license[s].
5
 *
6
 * @package maslosoft/manganel
7
 * @license AGPL-3.0-only, proprietary
8
 *
9
 * @copyright Copyright (c) Peter Maselkowski <[email protected]>
10
 * @link https://maslosoft.com/manganel/
11
 */
12
13
namespace Maslosoft\Manganel\Meta;
14
15
use Maslosoft\Addendum\Collections\Meta;
16
use Maslosoft\Addendum\Interfaces\AnnotatedInterface;
17
use Maslosoft\Addendum\Options\MetaOptions;
18
use Maslosoft\Manganel\Options\ManganelMetaOptions;
19
20
/**
21
 * Manganel metadata container class
22
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
23
 */
24
class ManganelMeta extends Meta
25
{
26
27
	/**
28
	 * Create instance of Metadata specifically designed for Manganel
29
	 * @param string|object|AnnotatedInterface $model
30
	 * @param MetaOptions $options
31
	 * @return ManganelMeta
32
	 */
33 59
	public static function create($model, MetaOptions $options = null)
34
	{
35 59
		if (null === $options)
36
		{
37 59
			$options = new ManganelMetaOptions();
38
		}
39 59
		return parent::create($model, $options);
40
	}
41
42
	/**
43
	 * Get field by name
44
	 * @param string $name
45
	 * @return DocumentPropertyMeta
46
	 */
47 54
	public function field($name)
48
	{
49 54
		return parent::field($name);
50
	}
51
52
	/**
53
	 * Get document type meta
54
	 * @return DocumentTypeMeta
55
	 */
56 58
	public function type()
57
	{
58 58
		return parent::type();
59
	}
60
61
	/**
62
	 * Get method meta data
63
	 * @param type $name
64
	 * @return DocumentMethodMeta
65
	 */
66
	public function method($name)
67
	{
68
		return parent::method($name);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The expression parent::method($name); of type false|Maslosoft\Addendum\Collections\MetaMethod adds false to the return on line 68 which is incompatible with the return type documented by Maslosoft\Manganel\Meta\ManganelMeta::method of type Maslosoft\Manganel\Meta\DocumentMethodMeta. It seems like you forgot to handle an error condition.
Loading history...
69
	}
70
71
}
72