1 | <?php |
||
16 | class BundleMetadata |
||
17 | { |
||
18 | /** |
||
19 | * @var BundleInterface |
||
20 | */ |
||
21 | protected $bundle; |
||
22 | |||
23 | /** |
||
24 | * @var string|bool |
||
25 | */ |
||
26 | protected $vendor = false; |
||
27 | |||
28 | /** |
||
29 | * @var bool |
||
30 | */ |
||
31 | protected $valid = false; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $namespace; |
||
37 | |||
38 | /** |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $name; |
||
42 | |||
43 | /** |
||
44 | * @var bool |
||
45 | */ |
||
46 | protected $extendedDirectory = false; |
||
47 | |||
48 | /** |
||
49 | * @var bool |
||
50 | */ |
||
51 | protected $extendedNamespace = false; |
||
52 | |||
53 | /** |
||
54 | * @var array |
||
55 | */ |
||
56 | protected $configuration = []; |
||
57 | |||
58 | /** |
||
59 | * @var OrmMetadata |
||
60 | */ |
||
61 | protected $ormMetadata = null; |
||
62 | |||
63 | /** |
||
64 | * @var OdmMetadata |
||
65 | */ |
||
66 | protected $odmMetadata = null; |
||
67 | |||
68 | /** |
||
69 | * @var PhpcrMetadata |
||
70 | */ |
||
71 | protected $phpcrMetadata = null; |
||
72 | |||
73 | /** |
||
74 | * @var string |
||
75 | */ |
||
76 | private $application; |
||
77 | |||
78 | /** |
||
79 | * @param BundleInterface $bundle |
||
80 | * @param array $configuration |
||
81 | */ |
||
82 | public function __construct(BundleInterface $bundle, array $configuration = []) |
||
89 | |||
90 | /** |
||
91 | * @return bool |
||
92 | */ |
||
93 | public function isExtendable() |
||
101 | |||
102 | /** |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getClass() |
||
109 | |||
110 | /** |
||
111 | * @return bool |
||
112 | */ |
||
113 | public function isValid() |
||
117 | |||
118 | /** |
||
119 | * @return string |
||
120 | */ |
||
121 | public function getExtendedDirectory() |
||
125 | |||
126 | /** |
||
127 | * @return string |
||
128 | */ |
||
129 | public function getVendor() |
||
133 | |||
134 | /** |
||
135 | * @return string |
||
136 | */ |
||
137 | public function getExtendedNamespace() |
||
141 | |||
142 | /** |
||
143 | * @return string |
||
144 | */ |
||
145 | public function getNamespace() |
||
149 | |||
150 | /** |
||
151 | * return the bundle name. |
||
152 | * |
||
153 | * @return string return the bundle name |
||
154 | */ |
||
155 | public function getName() |
||
159 | |||
160 | /** |
||
161 | * @return string |
||
162 | */ |
||
163 | public function getApplication() |
||
167 | |||
168 | /** |
||
169 | * @return BundleInterface |
||
170 | */ |
||
171 | public function getBundle() |
||
175 | |||
176 | /** |
||
177 | * @return OdmMetadata |
||
178 | */ |
||
179 | public function getOdmMetadata() |
||
183 | |||
184 | /** |
||
185 | * @return OrmMetadata |
||
186 | */ |
||
187 | public function getOrmMetadata() |
||
191 | |||
192 | /** |
||
193 | * @return PhpcrMetadata |
||
194 | */ |
||
195 | public function getPhpcrMetadata() |
||
199 | |||
200 | /** |
||
201 | * build basic information and check if the bundle respect the following convention |
||
202 | * Vendor/BundleNameBundle/VendorBundleNameBundle. |
||
203 | * |
||
204 | * if the bundle does not respect this convention then the easy extends command will ignore |
||
205 | * this bundle |
||
206 | */ |
||
207 | protected function buildInformation() |
||
249 | } |
||
250 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.