1 | <?php |
||
9 | class ElggPluginManifestParser18 extends \ElggPluginManifestParser { |
||
10 | /** |
||
11 | * The valid top level attributes and defaults for a 1.8 manifest array. |
||
12 | * |
||
13 | * @var array |
||
14 | */ |
||
15 | protected $validAttributes = array( |
||
16 | 'name', |
||
17 | 'author', |
||
18 | 'version', |
||
19 | 'blurb', |
||
20 | 'description', |
||
21 | 'id', |
||
22 | 'website', |
||
23 | 'copyright', |
||
24 | 'license', |
||
25 | 'requires', |
||
26 | 'suggests', |
||
27 | 'screenshot', |
||
28 | 'contributor', |
||
29 | 'category', |
||
30 | 'conflicts', |
||
31 | 'provides', |
||
32 | 'activate_on_install', |
||
33 | 'repository', |
||
34 | 'bugtracker', |
||
35 | 'donations', |
||
36 | ); |
||
37 | |||
38 | /** |
||
39 | * Required attributes for a valid 1.8 manifest |
||
40 | * |
||
41 | * @var array |
||
42 | */ |
||
43 | protected $requiredAttributes = array( |
||
44 | 'name', 'author', 'version', 'description', 'requires' |
||
45 | ); |
||
46 | |||
47 | /** |
||
48 | * Parse a manifest object from 1.8 and later |
||
49 | * |
||
50 | * @return bool |
||
51 | * |
||
52 | * @throws PluginException |
||
53 | */ |
||
54 | public function parse() { |
||
117 | } |
||
118 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.