@@ -31,6 +31,9 @@ discard block |
||
| 31 | 31 | return apply_filters( 'wpinv_get_ip', $ip ); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | +/** |
|
| 35 | + * @return string |
|
| 36 | + */ |
|
| 34 | 37 | function wpinv_get_user_agent() { |
| 35 | 38 | if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) { |
| 36 | 39 | $user_agent = sanitize_text_field( $_SERVER['HTTP_USER_AGENT'] ); |
@@ -41,6 +44,9 @@ discard block |
||
| 41 | 44 | return apply_filters( 'wpinv_get_user_agent', $user_agent ); |
| 42 | 45 | } |
| 43 | 46 | |
| 47 | +/** |
|
| 48 | + * @param integer $decimals |
|
| 49 | + */ |
|
| 44 | 50 | function wpinv_sanitize_amount( $amount, $decimals = NULL ) { |
| 45 | 51 | $is_negative = false; |
| 46 | 52 | $thousands_sep = wpinv_thousands_separator(); |
@@ -79,6 +85,9 @@ discard block |
||
| 79 | 85 | } |
| 80 | 86 | add_filter( 'wpinv_sanitize_amount_decimals', 'wpinv_currency_decimal_filter', 10, 1 ); |
| 81 | 87 | |
| 88 | +/** |
|
| 89 | + * @param integer $decimals |
|
| 90 | + */ |
|
| 82 | 91 | function wpinv_round_amount( $amount, $decimals = NULL ) { |
| 83 | 92 | if ( $decimals === NULL ) { |
| 84 | 93 | $decimals = wpinv_decimals(); |
@@ -298,6 +307,9 @@ discard block |
||
| 298 | 307 | return apply_filters( 'wpinv_currency_symbol', $currency_symbol, $currency ); |
| 299 | 308 | } |
| 300 | 309 | |
| 310 | +/** |
|
| 311 | + * @return string |
|
| 312 | + */ |
|
| 301 | 313 | function wpinv_currency_position() { |
| 302 | 314 | $position = wpinv_get_option( 'currency_position', 'left' ); |
| 303 | 315 | |
@@ -556,6 +568,9 @@ discard block |
||
| 556 | 568 | return $price; |
| 557 | 569 | } |
| 558 | 570 | |
| 571 | +/** |
|
| 572 | + * @return string |
|
| 573 | + */ |
|
| 559 | 574 | function wpinv_format_amount( $amount, $decimals = NULL, $calculate = false ) { |
| 560 | 575 | $thousands_sep = wpinv_thousands_separator(); |
| 561 | 576 | $decimal_sep = wpinv_decimal_separator(); |
@@ -606,6 +621,9 @@ discard block |
||
| 606 | 621 | return apply_filters( 'wpinv_sanitize_key', $key, $raw_key ); |
| 607 | 622 | } |
| 608 | 623 | |
| 624 | +/** |
|
| 625 | + * @return string |
|
| 626 | + */ |
|
| 609 | 627 | function wpinv_get_file_extension( $str ) { |
| 610 | 628 | $parts = explode( '.', $str ); |
| 611 | 629 | return end( $parts ); |
@@ -810,6 +828,9 @@ discard block |
||
| 810 | 828 | return strlen( $str ); |
| 811 | 829 | } |
| 812 | 830 | |
| 831 | +/** |
|
| 832 | + * @param string $str |
|
| 833 | + */ |
|
| 813 | 834 | function wpinv_utf8_strtolower( $str, $encoding = 'UTF-8' ) { |
| 814 | 835 | if ( function_exists( 'mb_strtolower' ) ) { |
| 815 | 836 | return mb_strtolower( $str, $encoding ); |
@@ -818,6 +839,9 @@ discard block |
||
| 818 | 839 | return strtolower( $str ); |
| 819 | 840 | } |
| 820 | 841 | |
| 842 | +/** |
|
| 843 | + * @param string $str |
|
| 844 | + */ |
|
| 821 | 845 | function wpinv_utf8_strtoupper( $str, $encoding = 'UTF-8' ) { |
| 822 | 846 | if ( function_exists( 'mb_strtoupper' ) ) { |
| 823 | 847 | return mb_strtoupper( $str, $encoding ); |
@@ -895,7 +919,7 @@ discard block |
||
| 895 | 919 | * |
| 896 | 920 | * @param string $str The string being decoded. |
| 897 | 921 | * @param string $encoding The encoding parameter is the character encoding. Default "UTF-8". |
| 898 | - * @return string The width of string. |
|
| 922 | + * @return integer The width of string. |
|
| 899 | 923 | */ |
| 900 | 924 | function wpinv_utf8_strwidth( $str, $encoding = 'UTF-8' ) { |
| 901 | 925 | if ( function_exists( 'mb_strwidth' ) ) { |
@@ -946,6 +970,11 @@ discard block |
||
| 946 | 970 | return $period; |
| 947 | 971 | } |
| 948 | 972 | |
| 973 | +/** |
|
| 974 | + * @param integer $calendar |
|
| 975 | + * @param string $month |
|
| 976 | + * @param string $year |
|
| 977 | + */ |
|
| 949 | 978 | function wpinv_cal_days_in_month( $calendar, $month, $year ) { |
| 950 | 979 | if ( function_exists( 'cal_days_in_month' ) ) { |
| 951 | 980 | return cal_days_in_month( $calendar, $month, $year ); |
@@ -488,6 +488,9 @@ discard block |
||
| 488 | 488 | return $invoice->get_description(); |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | +/** |
|
| 492 | + * @return string |
|
| 493 | + */ |
|
| 491 | 494 | function wpinv_get_invoice_currency_code( $invoice_id = 0 ) { |
| 492 | 495 | $invoice = new WPInv_Invoice( $invoice_id ); |
| 493 | 496 | return $invoice->get_currency(); |
@@ -521,6 +524,9 @@ discard block |
||
| 521 | 524 | return $invoice->get_gateway_title(); |
| 522 | 525 | } |
| 523 | 526 | |
| 527 | +/** |
|
| 528 | + * @return string |
|
| 529 | + */ |
|
| 524 | 530 | function wpinv_get_payment_transaction_id( $invoice_id ) { |
| 525 | 531 | $invoice = new WPInv_Invoice( $invoice_id ); |
| 526 | 532 | |
@@ -616,6 +622,9 @@ discard block |
||
| 616 | 622 | return $invoice->get_total( $currency ); |
| 617 | 623 | } |
| 618 | 624 | |
| 625 | +/** |
|
| 626 | + * @return string |
|
| 627 | + */ |
|
| 619 | 628 | function wpinv_get_date_created( $invoice_id = 0, $format = '' ) { |
| 620 | 629 | $invoice = new WPInv_Invoice( $invoice_id ); |
| 621 | 630 | |
@@ -626,6 +635,9 @@ discard block |
||
| 626 | 635 | return $date_created; |
| 627 | 636 | } |
| 628 | 637 | |
| 638 | +/** |
|
| 639 | + * @return string |
|
| 640 | + */ |
|
| 629 | 641 | function wpinv_get_invoice_date( $invoice_id = 0, $format = '', $default = true ) { |
| 630 | 642 | $invoice = new WPInv_Invoice( $invoice_id ); |
| 631 | 643 | |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | * Retrieves the transaction ID from the subscription |
| 371 | 371 | * |
| 372 | 372 | * @since 1.0.0 |
| 373 | - * @return bool |
|
| 373 | + * @return string |
|
| 374 | 374 | */ |
| 375 | 375 | public function get_transaction_id() { |
| 376 | 376 | |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | * Stores the transaction ID for the subscription purchase |
| 393 | 393 | * |
| 394 | 394 | * @since 1.0.0.4 |
| 395 | - * @return bool |
|
| 395 | + * @return boolean|null |
|
| 396 | 396 | */ |
| 397 | 397 | public function set_transaction_id( $txn_id = '' ) { |
| 398 | 398 | $this->update( array( 'transaction_id' => $txn_id ) ); |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | * Renews a subscription |
| 404 | 404 | * |
| 405 | 405 | * @since 1.0.0 |
| 406 | - * @return bool |
|
| 406 | + * @return boolean|null |
|
| 407 | 407 | */ |
| 408 | 408 | public function renew() { |
| 409 | 409 | |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | * |
| 493 | 493 | * @since 1.0.0 |
| 494 | 494 | * @param $check_expiration bool True if expiration date should be checked with merchant processor before expiring |
| 495 | - * @return void |
|
| 495 | + * @return false|null |
|
| 496 | 496 | */ |
| 497 | 497 | public function expire( $check_expiration = false ) { |
| 498 | 498 | |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | * Retrieves the subscription status |
| 745 | 745 | * |
| 746 | 746 | * @since 1.0.0 |
| 747 | - * @return int |
|
| 747 | + * @return string |
|
| 748 | 748 | */ |
| 749 | 749 | public function get_status() { |
| 750 | 750 | |