1 | <?php |
||
14 | abstract class WC_Legacy_Customer extends WC_Data { |
||
15 | |||
16 | /** |
||
17 | * __isset legacy. |
||
18 | * @param mixed $key |
||
19 | * @return bool |
||
20 | */ |
||
21 | public function __isset( $key ) { |
||
29 | |||
30 | /** |
||
31 | * __get function. |
||
32 | * @todo use get_* methods |
||
33 | * @param string $key |
||
34 | * @return string |
||
35 | */ |
||
36 | public function __get( $key ) { |
||
44 | |||
45 | /** |
||
46 | * __set function. |
||
47 | * @todo use set_* methods |
||
48 | * @param mixed $property |
||
|
|||
49 | * @param mixed $key |
||
50 | */ |
||
51 | public function __set( $key, $value ) { |
||
57 | |||
58 | /** |
||
59 | * Address and shipping_address are aliased, so we want to get the 'real' key name. |
||
60 | * For all other keys, we can just return it. |
||
61 | * @since 2.7.0 |
||
62 | * @param string $key |
||
63 | * @return string |
||
64 | */ |
||
65 | private function filter_legacy_key( $key ) { |
||
76 | |||
77 | /** |
||
78 | * Is customer VAT exempt? |
||
79 | * @return bool |
||
80 | */ |
||
81 | public function is_vat_exempt() { |
||
85 | |||
86 | /** |
||
87 | * Has calculated shipping? |
||
88 | * @return bool |
||
89 | */ |
||
90 | public function has_calculated_shipping() { |
||
94 | |||
95 | /** |
||
96 | * Get default country for a customer. |
||
97 | * @return string |
||
98 | */ |
||
99 | public function get_default_country() { |
||
104 | |||
105 | /** |
||
106 | * Get default state for a customer. |
||
107 | * @return string |
||
108 | */ |
||
109 | public function get_default_state() { |
||
114 | |||
115 | /** |
||
116 | * Set customer address to match shop base address. |
||
117 | */ |
||
118 | public function set_to_base() { |
||
122 | |||
123 | /** |
||
124 | * Set customer shipping address to base address. |
||
125 | */ |
||
126 | public function set_shipping_to_base() { |
||
130 | |||
131 | /** |
||
132 | * Calculated shipping. |
||
133 | * @param boolean $calculated |
||
134 | */ |
||
135 | public function calculated_shipping( $calculated = true ) { |
||
139 | |||
140 | /** |
||
141 | * Set default data for a customer. |
||
142 | */ |
||
143 | public function set_default_data() { |
||
146 | |||
147 | /** |
||
148 | * Is the user a paying customer? |
||
149 | * @todo should this be moved to a get_ readonly? |
||
150 | * @return bool |
||
151 | */ |
||
152 | function is_paying_customer( $user_id = '' ) { |
||
159 | |||
160 | /** |
||
161 | * Legacy get country. |
||
162 | */ |
||
163 | function get_country() { |
||
167 | |||
168 | /** |
||
169 | * Legacy get state. |
||
170 | */ |
||
171 | function get_state() { |
||
175 | |||
176 | /** |
||
177 | * Legacy get postcode. |
||
178 | */ |
||
179 | function get_postcode() { |
||
183 | |||
184 | /** |
||
185 | * Legacy get city. |
||
186 | */ |
||
187 | function get_city() { |
||
191 | |||
192 | /** |
||
193 | * Legacy set country. |
||
194 | */ |
||
195 | function set_country( $country ) { |
||
199 | |||
200 | /** |
||
201 | * Legacy set state. |
||
202 | */ |
||
203 | function set_state( $state ) { |
||
207 | |||
208 | /** |
||
209 | * Legacy set postcode. |
||
210 | */ |
||
211 | function set_postcode( $postcode ) { |
||
215 | |||
216 | /** |
||
217 | * Legacy set city. |
||
218 | */ |
||
219 | function set_city( $city ) { |
||
223 | |||
224 | /** |
||
225 | * Legacy set address. |
||
226 | */ |
||
227 | function set_address( $address ) { |
||
231 | |||
232 | /** |
||
233 | * Legacy set address. |
||
234 | */ |
||
235 | function set_address_2( $address ) { |
||
239 | |||
240 | } |
||
241 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.