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

ManganelMetaOptions::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
crap 1
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\Options;
10
11
use Maslosoft\Addendum\Options\MetaOptions;
12
use Maslosoft\Mangan\Options\ManganMetaOptions;
13
use Maslosoft\Manganel\Annotations\SearchIndexAnnotation;
14
use Maslosoft\Manganel\Meta\DocumentMethodMeta;
15
use Maslosoft\Manganel\Meta\DocumentPropertyMeta;
16
use Maslosoft\Manganel\Meta\DocumentTypeMeta;
17
18
/**
19
 * MetaOptions
20
 *
21
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
22
 */
23
class ManganelMetaOptions extends MetaOptions
24
{
25
26
	/**
27
	 * Meta container class name for type (class)
28
	 * @var string
29
	 */
30
	public $typeClass = DocumentTypeMeta::class;
31
32
	/**
33
	 * Meta container class name for method
34
	 * @var string
35
	 */
36
	public $methodClass = DocumentMethodMeta::class;
37
38
	/**
39
	 * Meta container class name for property
40
	 * @var string
41
	 */
42
	public $propertyClass = DocumentPropertyMeta::class;
43
44
	/**
45
	 * Namespaces for annotations
46
	 * @var string
47
	 */
48
	public $namespaces = [
49
		SearchIndexAnnotation::Ns
50
	];
51
52 5
	public function __construct()
53
	{
54
		// Include Mangan annotations namespaces too
55 5
		$manganOptions = new ManganMetaOptions;
56 5
		$this->namespaces = array_merge($manganOptions->namespaces, $this->namespaces);
0 ignored issues
show
Documentation Bug introduced by
It seems like array_merge($manganOptio...ces, $this->namespaces) of type array<integer,string> is incompatible with the declared type string of property $namespaces.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
57 5
	}
58
59
}
60