@@ -28,6 +28,9 @@ |
||
28 | 28 | 'WP_Super_Duper' => __DIR__ . '/..' . '/ayecode/wp-super-duper/wp-super-duper.php', |
29 | 29 | ); |
30 | 30 | |
31 | + /** |
|
32 | + * @return callable |
|
33 | + */ |
|
31 | 34 | public static function getInitializer(ClassLoader $loader) |
32 | 35 | { |
33 | 36 | return \Closure::bind(function () use ($loader) { |
@@ -367,6 +367,10 @@ |
||
367 | 367 | return $file; |
368 | 368 | } |
369 | 369 | |
370 | + /** |
|
371 | + * @param string $class |
|
372 | + * @param string $ext |
|
373 | + */ |
|
370 | 374 | private function findFileWithExtension($class, $ext) |
371 | 375 | { |
372 | 376 | // PSR-4 lookup |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | * @param string $id |
269 | 269 | * @param string $search_for_id |
270 | 270 | * |
271 | - * @return mixed |
|
271 | + * @return string |
|
272 | 272 | */ |
273 | 273 | public static function shortcode_button( $id = '', $search_for_id = '' ) { |
274 | 274 | ob_start(); |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | * Makes SD work with the siteOrigin page builder. |
299 | 299 | * |
300 | 300 | * @since 1.0.6 |
301 | - * @return mixed |
|
301 | + * @return string |
|
302 | 302 | */ |
303 | 303 | public static function siteorigin_js() { |
304 | 304 | ob_start(); |
@@ -857,7 +857,7 @@ discard block |
||
857 | 857 | /** |
858 | 858 | * Gets some CSS for the widgets screen. |
859 | 859 | * |
860 | - * @return mixed |
|
860 | + * @return string |
|
861 | 861 | */ |
862 | 862 | public function widget_css() { |
863 | 863 | ob_start(); |
@@ -897,7 +897,7 @@ discard block |
||
897 | 897 | /** |
898 | 898 | * Gets some JS for the widgets screen. |
899 | 899 | * |
900 | - * @return mixed |
|
900 | + * @return string |
|
901 | 901 | */ |
902 | 902 | public function widget_js() { |
903 | 903 | ob_start(); |
@@ -1347,7 +1347,7 @@ discard block |
||
1347 | 1347 | * |
1348 | 1348 | * @since 1.0.4 Added block_wrap property which will set the block wrapping output element ie: div, span, p or empty for no wrap. |
1349 | 1349 | * @since 1.0.9 Save numbers as numbers and not strings. |
1350 | - * @return mixed |
|
1350 | + * @return string |
|
1351 | 1351 | */ |
1352 | 1352 | public function block() { |
1353 | 1353 | ob_start(); |
@@ -73,10 +73,6 @@ |
||
73 | 73 | /** |
74 | 74 | * Outputs a button. |
75 | 75 | *ccc |
76 | - * @param string $url |
|
77 | - * @param string $text |
|
78 | - * @param string $theme |
|
79 | - * @param string $plugin |
|
80 | 76 | */ |
81 | 77 | public function output_button( $addon ) { |
82 | 78 | $current_tab = empty( $_GET['tab'] ) ? 'addons' : sanitize_title( $_GET['tab'] ); |
@@ -51,8 +51,8 @@ |
||
51 | 51 | /** |
52 | 52 | * Get section for the addons screen. |
53 | 53 | * |
54 | - * @param string $section_id |
|
55 | 54 | * |
55 | + * @param string $tab_id |
|
56 | 56 | * @return object|bool |
57 | 57 | */ |
58 | 58 | public function get_tab($tab_id) |
@@ -253,6 +253,9 @@ discard block |
||
253 | 253 | WPINV_VERSION, true); |
254 | 254 | } |
255 | 255 | |
256 | + /** |
|
257 | + * @param string $source |
|
258 | + */ |
|
256 | 259 | private static function base64_encode_urlsafe($source) { |
257 | 260 | $rv = base64_encode($source); |
258 | 261 | $rv = str_replace('=', '', $rv); |
@@ -286,6 +289,9 @@ discard block |
||
286 | 289 | return $header . '.' . $body . '.' . $signature; |
287 | 290 | } |
288 | 291 | |
292 | + /** |
|
293 | + * @param WPInv_Invoice $invoice |
|
294 | + */ |
|
289 | 295 | private function generate_cruise_jwt($invoice = null) { |
290 | 296 | $iat = time(); |
291 | 297 | $data = array( |
@@ -317,6 +323,9 @@ discard block |
||
317 | 323 | return $payload; |
318 | 324 | } |
319 | 325 | |
326 | + /** |
|
327 | + * @param string $id |
|
328 | + */ |
|
320 | 329 | public function hidden_input($id, $value = '') { |
321 | 330 | echo "<input type='hidden' id='{$id}' value='{$value}' />"; |
322 | 331 | } |
@@ -333,6 +342,10 @@ discard block |
||
333 | 342 | echo "<input type='hidden' autocomplete='off' id='{$id}' name='$id' /><div id='merchant-content-wrapper' style='display: none'><div id='actual-merchant-content'>{$merchant_content}</div></div>"; |
334 | 343 | } |
335 | 344 | |
345 | + /** |
|
346 | + * @param string $type |
|
347 | + * @param string $amount |
|
348 | + */ |
|
336 | 349 | public function pm_message($type, $orderid, $amount, $currency, $fields=array()) { |
337 | 350 | $timestamp = time() * 1000; |
338 | 351 | $plaintext = $timestamp . '9b11d472-91c9-4c5d-aadf-c32e710db171'; |
@@ -427,6 +440,9 @@ discard block |
||
427 | 440 | wpinv_send_back_to_checkout( '?payment-mode=paypalpro' ); |
428 | 441 | } |
429 | 442 | |
443 | + /** |
|
444 | + * @param WPInv_Invoice|null $invoice |
|
445 | + */ |
|
430 | 446 | public function order_add($invoice, $key, $value) { |
431 | 447 | update_post_meta($invoice->ID, "_{$this->id}_{$key}", $value); |
432 | 448 | } |
@@ -436,6 +452,10 @@ discard block |
||
436 | 452 | return isset($meta[0]) ? $meta[0] : null; |
437 | 453 | } |
438 | 454 | |
455 | + /** |
|
456 | + * @param WPInv_Invoice|null $invoice |
|
457 | + * @param string $message |
|
458 | + */ |
|
439 | 459 | public function status_message($invoice, $message, $amount = null, |
440 | 460 | $error = null) { |
441 | 461 | if (!$amount) { |
@@ -130,6 +130,10 @@ discard block |
||
130 | 130 | } |
131 | 131 | } |
132 | 132 | |
133 | + /** |
|
134 | + * @param string $name |
|
135 | + * @param string $value |
|
136 | + */ |
|
133 | 137 | public function setcookie($name, $value, $expire = 0, $secure = false, $httponly = false){ |
134 | 138 | if ( ! headers_sent() ) { |
135 | 139 | setcookie( $name, $value, $expire, COOKIEPATH ? COOKIEPATH : '/', COOKIE_DOMAIN, $secure, apply_filters( 'wpinv_cookie_httponly', $httponly, $name, $value, $expire, $secure ) ); |
@@ -274,7 +278,7 @@ discard block |
||
274 | 278 | * When a user is logged out, ensure they have a unique nonce by using the customer/session ID. |
275 | 279 | * |
276 | 280 | * @param int $uid User ID. |
277 | - * @return string |
|
281 | + * @return integer |
|
278 | 282 | */ |
279 | 283 | public function nonce_user_logged_out( $uid ) { |
280 | 284 | return $this->has_session() && $this->_customer_id ? $this->_customer_id : $uid; |
@@ -321,12 +321,18 @@ discard block |
||
321 | 321 | return apply_filters( 'wpinv_get_discount_code', $code, $code_id ); |
322 | 322 | } |
323 | 323 | |
324 | +/** |
|
325 | + * @return string |
|
326 | + */ |
|
324 | 327 | function wpinv_get_discount_start_date( $code_id = null ) { |
325 | 328 | $start_date = get_post_meta( $code_id, '_wpi_discount_start', true ); |
326 | 329 | |
327 | 330 | return apply_filters( 'wpinv_get_discount_start_date', $start_date, $code_id ); |
328 | 331 | } |
329 | 332 | |
333 | +/** |
|
334 | + * @return string |
|
335 | + */ |
|
330 | 336 | function wpinv_get_discount_expiration( $code_id = null ) { |
331 | 337 | $expiration = get_post_meta( $code_id, '_wpi_discount_expiration', true ); |
332 | 338 | |
@@ -649,6 +655,9 @@ discard block |
||
649 | 655 | return (bool) apply_filters( 'wpinv_is_discount_item_req_met', $ret, $code_id, $condition ); |
650 | 656 | } |
651 | 657 | |
658 | +/** |
|
659 | + * @param string $code |
|
660 | + */ |
|
652 | 661 | function wpinv_is_discount_used( $code = null, $user = '', $code_id = 0 ) { |
653 | 662 | global $wpi_checkout_id; |
654 | 663 | |
@@ -816,6 +825,9 @@ discard block |
||
816 | 825 | |
817 | 826 | } |
818 | 827 | |
828 | +/** |
|
829 | + * @param double $amount |
|
830 | + */ |
|
819 | 831 | function wpinv_format_discount_rate( $type, $amount ) { |
820 | 832 | if ( $type == 'flat' ) { |
821 | 833 | return wpinv_price( wpinv_format_amount( $amount ) ); |
@@ -860,6 +872,9 @@ discard block |
||
860 | 872 | return $discounts; |
861 | 873 | } |
862 | 874 | |
875 | +/** |
|
876 | + * @return boolean |
|
877 | + */ |
|
863 | 878 | function wpinv_unset_cart_discount( $code = '' ) { |
864 | 879 | $discounts = wpinv_get_cart_discounts(); |
865 | 880 | |
@@ -1140,6 +1155,9 @@ discard block |
||
1140 | 1155 | return (bool) apply_filters( 'wpinv_multiple_discounts_allowed', $ret ); |
1141 | 1156 | } |
1142 | 1157 | |
1158 | +/** |
|
1159 | + * @param integer $code |
|
1160 | + */ |
|
1143 | 1161 | function wpinv_get_discount_label( $code, $echo = true ) { |
1144 | 1162 | $label = wp_sprintf( __( 'Discount%1$s', 'invoicing' ), ( $code != '' && $code != 'none' ? ' (<code>' . $code . '</code>)': '' ) ); |
1145 | 1163 | $label = apply_filters( 'wpinv_get_discount_label', $label, $code ); |