ManganelMetaOptions::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
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\Options;
14
15
use Maslosoft\Addendum\Options\MetaOptions;
16
use Maslosoft\Mangan\Options\ManganMetaOptions;
17
use Maslosoft\Manganel\Annotations\SearchIndexAnnotation;
18
use Maslosoft\Manganel\Meta\DocumentMethodMeta;
19
use Maslosoft\Manganel\Meta\DocumentPropertyMeta;
20
use Maslosoft\Manganel\Meta\DocumentTypeMeta;
21
22
/**
23
 * MetaOptions
24
 *
25
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
26
 */
27
class ManganelMetaOptions extends MetaOptions
28
{
29
30
	/**
31
	 * Meta container class name for type (class)
32
	 * @var string
33
	 */
34
	public $typeClass = DocumentTypeMeta::class;
35
36
	/**
37
	 * Meta container class name for method
38
	 * @var string
39
	 */
40
	public $methodClass = DocumentMethodMeta::class;
41
42
	/**
43
	 * Meta container class name for property
44
	 * @var string
45
	 */
46
	public $propertyClass = DocumentPropertyMeta::class;
47
48
	/**
49
	 * Namespaces for annotations
50
	 * @var string
51
	 */
52
	public $namespaces = [
53
		SearchIndexAnnotation::Ns
54
	];
55
56 59
	public function __construct()
57
	{
58
		// Include Mangan annotations namespaces too
59 59
		$manganOptions = new ManganMetaOptions;
60 59
		$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...
61 59
	}
62
63
}
64