Completed
Push — master ( ba4d39...b910d2 )
by Peter
04:58
created

ManganelMeta::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 8
ccs 7
cts 7
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 2
crap 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\Manganel\Meta;
10
11
use Maslosoft\Addendum\Collections\Meta;
12
use Maslosoft\Addendum\Interfaces\AnnotatedInterface;
13
use Maslosoft\Addendum\Options\MetaOptions;
14
use Maslosoft\Manganel\Options\ManganelMetaOptions;
15
16
/**
17
 * Mangan metadata container class
18
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
19
 */
20
class ManganelMeta extends Meta
21
{
22
23
	/**
24
	 * Create instance of Metadata specifically designed for Manganel
25
	 * @param AnnotatedInterface $component
26
	 * @param MetaOptions $options
27
	 * @return ManganelMeta
28
	 */
29 5
	public static function create(AnnotatedInterface $component, MetaOptions $options = null)
30
	{
31 5
		if (null === $options)
32 5
		{
33 5
			$options = new ManganelMetaOptions();
34 5
		}
35 5
		return parent::create($component, $options);
36
	}
37
38
	/**
39
	 * Get field by name
40
	 * @param string $name
41
	 * @return DocumentPropertyMeta
42
	 */
43
	public function field($name)
44
	{
45
		return parent::field($name);
46
	}
47
48
	/**
49
	 * Get document type meta
50
	 * @return DocumentTypeMeta
51
	 */
52 5
	public function type()
53
	{
54 5
		return parent::type();
55 1
	}
56
57
}
58