1 | <?php |
||
38 | abstract class adLDAPCollection |
||
39 | { |
||
40 | /** |
||
41 | * The current adLDAP connection via dependency injection |
||
42 | * |
||
43 | * @var adLDAP |
||
44 | */ |
||
45 | protected $adldap; |
||
46 | |||
47 | /** |
||
48 | * The current object being modifed / called |
||
49 | * |
||
50 | * @var mixed |
||
51 | */ |
||
52 | protected $currentObject; |
||
53 | |||
54 | /** |
||
55 | * The raw info array from Active Directory |
||
56 | * |
||
57 | * @var array |
||
58 | */ |
||
59 | protected $info; |
||
60 | |||
61 | public function __construct($info, adLDAP $adldap) { |
||
65 | |||
66 | /** |
||
67 | * Set the raw info array from Active Directory |
||
68 | * |
||
69 | * @param array $info |
||
70 | */ |
||
71 | public function setInfo(array $info) { |
||
77 | |||
78 | /** |
||
79 | * Magic get method to retrieve data from the raw array in a formatted way |
||
80 | * |
||
81 | * @param string $attribute |
||
82 | * @return mixed |
||
83 | */ |
||
84 | public function __get($attribute) { |
||
105 | |||
106 | /** |
||
107 | * Magic set method to update an attribute |
||
108 | * |
||
109 | * @param string $attribute |
||
110 | * @param string $value |
||
111 | * @return bool |
||
112 | */ |
||
113 | abstract public function __set($attribute, $value); |
||
114 | |||
115 | /** |
||
116 | * Magic isset method to check for the existence of an attribute |
||
117 | * |
||
118 | * @param string $attribute |
||
119 | * @return bool |
||
120 | */ |
||
121 | public function __isset($attribute) { |
||
131 | } |
||
132 | ?> |
||
133 |
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.