1 | <?php |
||
57 | class HasClassProperties implements Check, ListCheck |
||
58 | { |
||
59 | // save us having to implement it ourselves |
||
60 | use ListCheckHelper; |
||
61 | |||
62 | /** |
||
63 | * which types of property do we want to check for? |
||
64 | * @var int |
||
65 | */ |
||
66 | protected $propTypes; |
||
67 | |||
68 | /** |
||
69 | * create a customised HasClassProperties checker, ready to use |
||
70 | * |
||
71 | * @param int $propTypes |
||
72 | * the kind of properties to look for |
||
73 | * default is to look for public properties only |
||
74 | * @return HasClassProperties |
||
|
|||
75 | * a customised Check, ready to use |
||
76 | */ |
||
77 | public function __construct($propTypes = ReflectionProperty::IS_PUBLIC) |
||
81 | |||
82 | /** |
||
83 | * create a customised HasClassProperties checker, ready to use |
||
84 | * |
||
85 | * @param int $propTypes |
||
86 | * the kind of properties to look for |
||
87 | * default is to look for public properties only |
||
88 | * @return HasClassProperties |
||
89 | * a customised Check, ready to use |
||
90 | */ |
||
91 | public static function using($propTypes = ReflectionProperty::IS_PUBLIC) |
||
95 | |||
96 | /** |
||
97 | * does a class have static properties? |
||
98 | * |
||
99 | * @param string $target |
||
100 | * the class to examine |
||
101 | * @return boolean |
||
102 | * TRUE if the class has static properties |
||
103 | * FALSE otherwise |
||
104 | * @throws InvalidArgumentException |
||
105 | * if $target is not a valid class name |
||
106 | */ |
||
107 | public function inspect($target) |
||
111 | |||
112 | /** |
||
113 | * does a class have static properties? |
||
114 | * |
||
115 | * @param string $target |
||
116 | * the class to examine |
||
117 | * @param int $propTypes |
||
118 | * the kind of properties to look for |
||
119 | * default is to look for public properties only |
||
120 | * @return boolean |
||
121 | * TRUE if the class has static properties |
||
122 | * FALSE otherwise |
||
123 | * @throws InvalidArgumentException |
||
124 | * if $target is not a valid class name |
||
125 | */ |
||
126 | public static function check($target, $propTypes = ReflectionProperty::IS_PUBLIC) |
||
143 | |||
144 | /** |
||
145 | * does a list of classes have static properties? |
||
146 | * |
||
147 | * @param mixed $list |
||
148 | * the list of classes to examine |
||
149 | * @param int $propTypes |
||
150 | * the kind of properties to look for |
||
151 | * default is to look for public properties only |
||
152 | * @return boolean |
||
153 | * TRUE if the class has static properties |
||
154 | * FALSE otherwise |
||
155 | * @throws InvalidArgumentException |
||
156 | * if $target is not a valid class name |
||
157 | */ |
||
158 | public static function checkList($list, $propTypes = ReflectionProperty::IS_PUBLIC) |
||
163 | } |
||
164 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.