Conditions | 1 |
Paths | 1 |
Total Lines | 838 |
Code Lines | 666 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
375 | public function get_item_schema() { |
||
376 | $schema = array( |
||
377 | '$schema' => 'http://json-schema.org/draft-04/schema#', |
||
378 | 'title' => $this->post_type, |
||
379 | 'type' => 'object', |
||
380 | 'properties' => array( |
||
381 | 'id' => array( |
||
382 | 'description' => __( 'Unique identifier for the resource.', 'woocommerce' ), |
||
383 | 'type' => 'integer', |
||
384 | 'context' => array( 'view', 'edit' ), |
||
385 | 'readonly' => true, |
||
386 | ), |
||
387 | 'parent_id' => array( |
||
388 | 'description' => __( 'Parent order ID.', 'woocommerce' ), |
||
389 | 'type' => 'integer', |
||
390 | 'context' => array( 'view', 'edit' ), |
||
391 | ), |
||
392 | 'number' => array( |
||
393 | 'description' => __( 'Order number.', 'woocommerce' ), |
||
394 | 'type' => 'string', |
||
395 | 'context' => array( 'view', 'edit' ), |
||
396 | 'readonly' => true, |
||
397 | ), |
||
398 | 'order_key' => array( |
||
399 | 'description' => __( 'Order key.', 'woocommerce' ), |
||
400 | 'type' => 'string', |
||
401 | 'context' => array( 'view', 'edit' ), |
||
402 | 'readonly' => true, |
||
403 | ), |
||
404 | 'created_via' => array( |
||
405 | 'description' => __( 'Shows where the order was created.', 'woocommerce' ), |
||
406 | 'type' => 'string', |
||
407 | 'context' => array( 'view', 'edit' ), |
||
408 | 'readonly' => true, |
||
409 | ), |
||
410 | 'version' => array( |
||
411 | 'description' => __( 'Version of WooCommerce which last updated the order.', 'woocommerce' ), |
||
412 | 'type' => 'integer', |
||
413 | 'context' => array( 'view', 'edit' ), |
||
414 | 'readonly' => true, |
||
415 | ), |
||
416 | 'status' => array( |
||
417 | 'description' => __( 'Order status.', 'woocommerce' ), |
||
418 | 'type' => 'string', |
||
419 | 'default' => 'pending', |
||
420 | 'enum' => $this->get_order_statuses(), |
||
421 | 'context' => array( 'view', 'edit' ), |
||
422 | ), |
||
423 | 'currency' => array( |
||
424 | 'description' => __( 'Currency the order was created with, in ISO format.', 'woocommerce' ), |
||
425 | 'type' => 'string', |
||
426 | 'default' => get_woocommerce_currency(), |
||
427 | 'enum' => array_keys( get_woocommerce_currencies() ), |
||
428 | 'context' => array( 'view', 'edit' ), |
||
429 | ), |
||
430 | 'currency_symbol' => array( |
||
431 | 'description' => __( 'Currency symbol.', 'woocommerce' ), |
||
432 | 'type' => 'string', |
||
433 | 'context' => array( 'view', 'edit' ), |
||
434 | 'readonly' => true, |
||
435 | ), |
||
436 | 'date_created' => array( |
||
437 | 'description' => __( "The date the order was created, in the site's timezone.", 'woocommerce' ), |
||
438 | 'type' => 'date-time', |
||
439 | 'context' => array( 'view', 'edit' ), |
||
440 | 'readonly' => true, |
||
441 | ), |
||
442 | 'date_created_gmt' => array( |
||
443 | 'description' => __( 'The date the order was created, as GMT.', 'woocommerce' ), |
||
444 | 'type' => 'date-time', |
||
445 | 'context' => array( 'view', 'edit' ), |
||
446 | 'readonly' => true, |
||
447 | ), |
||
448 | 'date_modified' => array( |
||
449 | 'description' => __( "The date the order was last modified, in the site's timezone.", 'woocommerce' ), |
||
450 | 'type' => 'date-time', |
||
451 | 'context' => array( 'view', 'edit' ), |
||
452 | 'readonly' => true, |
||
453 | ), |
||
454 | 'date_modified_gmt' => array( |
||
455 | 'description' => __( 'The date the order was last modified, as GMT.', 'woocommerce' ), |
||
456 | 'type' => 'date-time', |
||
457 | 'context' => array( 'view', 'edit' ), |
||
458 | 'readonly' => true, |
||
459 | ), |
||
460 | 'discount_total' => array( |
||
461 | 'description' => __( 'Total discount amount for the order.', 'woocommerce' ), |
||
462 | 'type' => 'string', |
||
463 | 'context' => array( 'view', 'edit' ), |
||
464 | 'readonly' => true, |
||
465 | ), |
||
466 | 'discount_tax' => array( |
||
467 | 'description' => __( 'Total discount tax amount for the order.', 'woocommerce' ), |
||
468 | 'type' => 'string', |
||
469 | 'context' => array( 'view', 'edit' ), |
||
470 | 'readonly' => true, |
||
471 | ), |
||
472 | 'shipping_total' => array( |
||
473 | 'description' => __( 'Total shipping amount for the order.', 'woocommerce' ), |
||
474 | 'type' => 'string', |
||
475 | 'context' => array( 'view', 'edit' ), |
||
476 | 'readonly' => true, |
||
477 | ), |
||
478 | 'shipping_tax' => array( |
||
479 | 'description' => __( 'Total shipping tax amount for the order.', 'woocommerce' ), |
||
480 | 'type' => 'string', |
||
481 | 'context' => array( 'view', 'edit' ), |
||
482 | 'readonly' => true, |
||
483 | ), |
||
484 | 'cart_tax' => array( |
||
485 | 'description' => __( 'Sum of line item taxes only.', 'woocommerce' ), |
||
486 | 'type' => 'string', |
||
487 | 'context' => array( 'view', 'edit' ), |
||
488 | 'readonly' => true, |
||
489 | ), |
||
490 | 'total' => array( |
||
491 | 'description' => __( 'Grand total.', 'woocommerce' ), |
||
492 | 'type' => 'string', |
||
493 | 'context' => array( 'view', 'edit' ), |
||
494 | 'readonly' => true, |
||
495 | ), |
||
496 | 'total_tax' => array( |
||
497 | 'description' => __( 'Sum of all taxes.', 'woocommerce' ), |
||
498 | 'type' => 'string', |
||
499 | 'context' => array( 'view', 'edit' ), |
||
500 | 'readonly' => true, |
||
501 | ), |
||
502 | 'prices_include_tax' => array( |
||
503 | 'description' => __( 'True the prices included tax during checkout.', 'woocommerce' ), |
||
504 | 'type' => 'boolean', |
||
505 | 'context' => array( 'view', 'edit' ), |
||
506 | 'readonly' => true, |
||
507 | ), |
||
508 | 'customer_id' => array( |
||
509 | 'description' => __( 'User ID who owns the order. 0 for guests.', 'woocommerce' ), |
||
510 | 'type' => 'integer', |
||
511 | 'default' => 0, |
||
512 | 'context' => array( 'view', 'edit' ), |
||
513 | ), |
||
514 | 'customer_ip_address' => array( |
||
515 | 'description' => __( "Customer's IP address.", 'woocommerce' ), |
||
516 | 'type' => 'string', |
||
517 | 'context' => array( 'view', 'edit' ), |
||
518 | 'readonly' => true, |
||
519 | ), |
||
520 | 'customer_user_agent' => array( |
||
521 | 'description' => __( 'User agent of the customer.', 'woocommerce' ), |
||
522 | 'type' => 'string', |
||
523 | 'context' => array( 'view', 'edit' ), |
||
524 | 'readonly' => true, |
||
525 | ), |
||
526 | 'customer_note' => array( |
||
527 | 'description' => __( 'Note left by customer during checkout.', 'woocommerce' ), |
||
528 | 'type' => 'string', |
||
529 | 'context' => array( 'view', 'edit' ), |
||
530 | ), |
||
531 | 'billing' => array( |
||
532 | 'description' => __( 'Billing address.', 'woocommerce' ), |
||
533 | 'type' => 'object', |
||
534 | 'context' => array( 'view', 'edit' ), |
||
535 | 'properties' => array( |
||
536 | 'first_name' => array( |
||
537 | 'description' => __( 'First name.', 'woocommerce' ), |
||
538 | 'type' => 'string', |
||
539 | 'context' => array( 'view', 'edit' ), |
||
540 | ), |
||
541 | 'last_name' => array( |
||
542 | 'description' => __( 'Last name.', 'woocommerce' ), |
||
543 | 'type' => 'string', |
||
544 | 'context' => array( 'view', 'edit' ), |
||
545 | ), |
||
546 | 'company' => array( |
||
547 | 'description' => __( 'Company name.', 'woocommerce' ), |
||
548 | 'type' => 'string', |
||
549 | 'context' => array( 'view', 'edit' ), |
||
550 | ), |
||
551 | 'address_1' => array( |
||
552 | 'description' => __( 'Address line 1', 'woocommerce' ), |
||
553 | 'type' => 'string', |
||
554 | 'context' => array( 'view', 'edit' ), |
||
555 | ), |
||
556 | 'address_2' => array( |
||
557 | 'description' => __( 'Address line 2', 'woocommerce' ), |
||
558 | 'type' => 'string', |
||
559 | 'context' => array( 'view', 'edit' ), |
||
560 | ), |
||
561 | 'city' => array( |
||
562 | 'description' => __( 'City name.', 'woocommerce' ), |
||
563 | 'type' => 'string', |
||
564 | 'context' => array( 'view', 'edit' ), |
||
565 | ), |
||
566 | 'state' => array( |
||
567 | 'description' => __( 'ISO code or name of the state, province or district.', 'woocommerce' ), |
||
568 | 'type' => 'string', |
||
569 | 'context' => array( 'view', 'edit' ), |
||
570 | ), |
||
571 | 'postcode' => array( |
||
572 | 'description' => __( 'Postal code.', 'woocommerce' ), |
||
573 | 'type' => 'string', |
||
574 | 'context' => array( 'view', 'edit' ), |
||
575 | ), |
||
576 | 'country' => array( |
||
577 | 'description' => __( 'Country code in ISO 3166-1 alpha-2 format.', 'woocommerce' ), |
||
578 | 'type' => 'string', |
||
579 | 'context' => array( 'view', 'edit' ), |
||
580 | ), |
||
581 | 'email' => array( |
||
582 | 'description' => __( 'Email address.', 'woocommerce' ), |
||
583 | 'type' => 'string', |
||
584 | 'format' => 'email', |
||
585 | 'context' => array( 'view', 'edit' ), |
||
586 | ), |
||
587 | 'phone' => array( |
||
588 | 'description' => __( 'Phone number.', 'woocommerce' ), |
||
589 | 'type' => 'string', |
||
590 | 'context' => array( 'view', 'edit' ), |
||
591 | ), |
||
592 | ), |
||
593 | ), |
||
594 | 'shipping' => array( |
||
595 | 'description' => __( 'Shipping address.', 'woocommerce' ), |
||
596 | 'type' => 'object', |
||
597 | 'context' => array( 'view', 'edit' ), |
||
598 | 'properties' => array( |
||
599 | 'first_name' => array( |
||
600 | 'description' => __( 'First name.', 'woocommerce' ), |
||
601 | 'type' => 'string', |
||
602 | 'context' => array( 'view', 'edit' ), |
||
603 | ), |
||
604 | 'last_name' => array( |
||
605 | 'description' => __( 'Last name.', 'woocommerce' ), |
||
606 | 'type' => 'string', |
||
607 | 'context' => array( 'view', 'edit' ), |
||
608 | ), |
||
609 | 'company' => array( |
||
610 | 'description' => __( 'Company name.', 'woocommerce' ), |
||
611 | 'type' => 'string', |
||
612 | 'context' => array( 'view', 'edit' ), |
||
613 | ), |
||
614 | 'address_1' => array( |
||
615 | 'description' => __( 'Address line 1', 'woocommerce' ), |
||
616 | 'type' => 'string', |
||
617 | 'context' => array( 'view', 'edit' ), |
||
618 | ), |
||
619 | 'address_2' => array( |
||
620 | 'description' => __( 'Address line 2', 'woocommerce' ), |
||
621 | 'type' => 'string', |
||
622 | 'context' => array( 'view', 'edit' ), |
||
623 | ), |
||
624 | 'city' => array( |
||
625 | 'description' => __( 'City name.', 'woocommerce' ), |
||
626 | 'type' => 'string', |
||
627 | 'context' => array( 'view', 'edit' ), |
||
628 | ), |
||
629 | 'state' => array( |
||
630 | 'description' => __( 'ISO code or name of the state, province or district.', 'woocommerce' ), |
||
631 | 'type' => 'string', |
||
632 | 'context' => array( 'view', 'edit' ), |
||
633 | ), |
||
634 | 'postcode' => array( |
||
635 | 'description' => __( 'Postal code.', 'woocommerce' ), |
||
636 | 'type' => 'string', |
||
637 | 'context' => array( 'view', 'edit' ), |
||
638 | ), |
||
639 | 'country' => array( |
||
640 | 'description' => __( 'Country code in ISO 3166-1 alpha-2 format.', 'woocommerce' ), |
||
641 | 'type' => 'string', |
||
642 | 'context' => array( 'view', 'edit' ), |
||
643 | ), |
||
644 | ), |
||
645 | ), |
||
646 | 'payment_method' => array( |
||
647 | 'description' => __( 'Payment method ID.', 'woocommerce' ), |
||
648 | 'type' => 'string', |
||
649 | 'context' => array( 'view', 'edit' ), |
||
650 | ), |
||
651 | 'payment_method_title' => array( |
||
652 | 'description' => __( 'Payment method title.', 'woocommerce' ), |
||
653 | 'type' => 'string', |
||
654 | 'context' => array( 'view', 'edit' ), |
||
655 | 'arg_options' => array( |
||
656 | 'sanitize_callback' => 'sanitize_text_field', |
||
657 | ), |
||
658 | ), |
||
659 | 'transaction_id' => array( |
||
660 | 'description' => __( 'Unique transaction ID.', 'woocommerce' ), |
||
661 | 'type' => 'string', |
||
662 | 'context' => array( 'view', 'edit' ), |
||
663 | ), |
||
664 | 'date_paid' => array( |
||
665 | 'description' => __( "The date the order was paid, in the site's timezone.", 'woocommerce' ), |
||
666 | 'type' => 'date-time', |
||
667 | 'context' => array( 'view', 'edit' ), |
||
668 | 'readonly' => true, |
||
669 | ), |
||
670 | 'date_paid_gmt' => array( |
||
671 | 'description' => __( 'The date the order was paid, as GMT.', 'woocommerce' ), |
||
672 | 'type' => 'date-time', |
||
673 | 'context' => array( 'view', 'edit' ), |
||
674 | 'readonly' => true, |
||
675 | ), |
||
676 | 'date_completed' => array( |
||
677 | 'description' => __( "The date the order was completed, in the site's timezone.", 'woocommerce' ), |
||
678 | 'type' => 'date-time', |
||
679 | 'context' => array( 'view', 'edit' ), |
||
680 | 'readonly' => true, |
||
681 | ), |
||
682 | 'date_completed_gmt' => array( |
||
683 | 'description' => __( 'The date the order was completed, as GMT.', 'woocommerce' ), |
||
684 | 'type' => 'date-time', |
||
685 | 'context' => array( 'view', 'edit' ), |
||
686 | 'readonly' => true, |
||
687 | ), |
||
688 | 'cart_hash' => array( |
||
689 | 'description' => __( 'MD5 hash of cart items to ensure orders are not modified.', 'woocommerce' ), |
||
690 | 'type' => 'string', |
||
691 | 'context' => array( 'view', 'edit' ), |
||
692 | 'readonly' => true, |
||
693 | ), |
||
694 | 'meta_data' => array( |
||
695 | 'description' => __( 'Meta data.', 'woocommerce' ), |
||
696 | 'type' => 'array', |
||
697 | 'context' => array( 'view', 'edit' ), |
||
698 | 'items' => array( |
||
699 | 'type' => 'object', |
||
700 | 'properties' => array( |
||
701 | 'id' => array( |
||
702 | 'description' => __( 'Meta ID.', 'woocommerce' ), |
||
703 | 'type' => 'integer', |
||
704 | 'context' => array( 'view', 'edit' ), |
||
705 | 'readonly' => true, |
||
706 | ), |
||
707 | 'key' => array( |
||
708 | 'description' => __( 'Meta key.', 'woocommerce' ), |
||
709 | 'type' => 'string', |
||
710 | 'context' => array( 'view', 'edit' ), |
||
711 | ), |
||
712 | 'value' => array( |
||
713 | 'description' => __( 'Meta value.', 'woocommerce' ), |
||
714 | 'type' => 'mixed', |
||
715 | 'context' => array( 'view', 'edit' ), |
||
716 | ), |
||
717 | ), |
||
718 | ), |
||
719 | ), |
||
720 | 'line_items' => array( |
||
721 | 'description' => __( 'Line items data.', 'woocommerce' ), |
||
722 | 'type' => 'array', |
||
723 | 'context' => array( 'view', 'edit' ), |
||
724 | 'items' => array( |
||
725 | 'type' => 'object', |
||
726 | 'properties' => array( |
||
727 | 'id' => array( |
||
728 | 'description' => __( 'Item ID.', 'woocommerce' ), |
||
729 | 'type' => 'integer', |
||
730 | 'context' => array( 'view', 'edit' ), |
||
731 | 'readonly' => true, |
||
732 | ), |
||
733 | 'name' => array( |
||
734 | 'description' => __( 'Product name.', 'woocommerce' ), |
||
735 | 'type' => 'mixed', |
||
736 | 'context' => array( 'view', 'edit' ), |
||
737 | ), |
||
738 | 'product_id' => array( |
||
739 | 'description' => __( 'Product ID.', 'woocommerce' ), |
||
740 | 'type' => 'mixed', |
||
741 | 'context' => array( 'view', 'edit' ), |
||
742 | ), |
||
743 | 'variation_id' => array( |
||
744 | 'description' => __( 'Variation ID, if applicable.', 'woocommerce' ), |
||
745 | 'type' => 'integer', |
||
746 | 'context' => array( 'view', 'edit' ), |
||
747 | ), |
||
748 | 'quantity' => array( |
||
749 | 'description' => __( 'Quantity ordered.', 'woocommerce' ), |
||
750 | 'type' => 'integer', |
||
751 | 'context' => array( 'view', 'edit' ), |
||
752 | ), |
||
753 | 'tax_class' => array( |
||
754 | 'description' => __( 'Tax class of product.', 'woocommerce' ), |
||
755 | 'type' => 'string', |
||
756 | 'context' => array( 'view', 'edit' ), |
||
757 | ), |
||
758 | 'subtotal' => array( |
||
759 | 'description' => __( 'Line subtotal (before discounts).', 'woocommerce' ), |
||
760 | 'type' => 'string', |
||
761 | 'context' => array( 'view', 'edit' ), |
||
762 | ), |
||
763 | 'subtotal_tax' => array( |
||
764 | 'description' => __( 'Line subtotal tax (before discounts).', 'woocommerce' ), |
||
765 | 'type' => 'string', |
||
766 | 'context' => array( 'view', 'edit' ), |
||
767 | 'readonly' => true, |
||
768 | ), |
||
769 | 'total' => array( |
||
770 | 'description' => __( 'Line total (after discounts).', 'woocommerce' ), |
||
771 | 'type' => 'string', |
||
772 | 'context' => array( 'view', 'edit' ), |
||
773 | ), |
||
774 | 'total_tax' => array( |
||
775 | 'description' => __( 'Line total tax (after discounts).', 'woocommerce' ), |
||
776 | 'type' => 'string', |
||
777 | 'context' => array( 'view', 'edit' ), |
||
778 | 'readonly' => true, |
||
779 | ), |
||
780 | 'taxes' => array( |
||
781 | 'description' => __( 'Line taxes.', 'woocommerce' ), |
||
782 | 'type' => 'array', |
||
783 | 'context' => array( 'view', 'edit' ), |
||
784 | 'readonly' => true, |
||
785 | 'items' => array( |
||
786 | 'type' => 'object', |
||
787 | 'properties' => array( |
||
788 | 'id' => array( |
||
789 | 'description' => __( 'Tax rate ID.', 'woocommerce' ), |
||
790 | 'type' => 'integer', |
||
791 | 'context' => array( 'view', 'edit' ), |
||
792 | ), |
||
793 | 'total' => array( |
||
794 | 'description' => __( 'Tax total.', 'woocommerce' ), |
||
795 | 'type' => 'string', |
||
796 | 'context' => array( 'view', 'edit' ), |
||
797 | ), |
||
798 | 'subtotal' => array( |
||
799 | 'description' => __( 'Tax subtotal.', 'woocommerce' ), |
||
800 | 'type' => 'string', |
||
801 | 'context' => array( 'view', 'edit' ), |
||
802 | ), |
||
803 | ), |
||
804 | ), |
||
805 | ), |
||
806 | 'meta_data' => array( |
||
807 | 'description' => __( 'Meta data.', 'woocommerce' ), |
||
808 | 'type' => 'array', |
||
809 | 'context' => array( 'view', 'edit' ), |
||
810 | 'items' => array( |
||
811 | 'type' => 'object', |
||
812 | 'properties' => array( |
||
813 | 'id' => array( |
||
814 | 'description' => __( 'Meta ID.', 'woocommerce' ), |
||
815 | 'type' => 'integer', |
||
816 | 'context' => array( 'view', 'edit' ), |
||
817 | 'readonly' => true, |
||
818 | ), |
||
819 | 'key' => array( |
||
820 | 'description' => __( 'Meta key.', 'woocommerce' ), |
||
821 | 'type' => 'string', |
||
822 | 'context' => array( 'view', 'edit' ), |
||
823 | ), |
||
824 | 'value' => array( |
||
825 | 'description' => __( 'Meta value.', 'woocommerce' ), |
||
826 | 'type' => 'mixed', |
||
827 | 'context' => array( 'view', 'edit' ), |
||
828 | ), |
||
829 | ), |
||
830 | ), |
||
831 | ), |
||
832 | 'sku' => array( |
||
833 | 'description' => __( 'Product SKU.', 'woocommerce' ), |
||
834 | 'type' => 'string', |
||
835 | 'context' => array( 'view', 'edit' ), |
||
836 | 'readonly' => true, |
||
837 | ), |
||
838 | 'price' => array( |
||
839 | 'description' => __( 'Product price.', 'woocommerce' ), |
||
840 | 'type' => 'number', |
||
841 | 'context' => array( 'view', 'edit' ), |
||
842 | 'readonly' => true, |
||
843 | ), |
||
844 | ), |
||
845 | ), |
||
846 | ), |
||
847 | 'tax_lines' => array( |
||
848 | 'description' => __( 'Tax lines data.', 'woocommerce' ), |
||
849 | 'type' => 'array', |
||
850 | 'context' => array( 'view', 'edit' ), |
||
851 | 'readonly' => true, |
||
852 | 'items' => array( |
||
853 | 'type' => 'object', |
||
854 | 'properties' => array( |
||
855 | 'id' => array( |
||
856 | 'description' => __( 'Item ID.', 'woocommerce' ), |
||
857 | 'type' => 'integer', |
||
858 | 'context' => array( 'view', 'edit' ), |
||
859 | 'readonly' => true, |
||
860 | ), |
||
861 | 'rate_code' => array( |
||
862 | 'description' => __( 'Tax rate code.', 'woocommerce' ), |
||
863 | 'type' => 'string', |
||
864 | 'context' => array( 'view', 'edit' ), |
||
865 | 'readonly' => true, |
||
866 | ), |
||
867 | 'rate_id' => array( |
||
868 | 'description' => __( 'Tax rate ID.', 'woocommerce' ), |
||
869 | 'type' => 'string', |
||
870 | 'context' => array( 'view', 'edit' ), |
||
871 | 'readonly' => true, |
||
872 | ), |
||
873 | 'label' => array( |
||
874 | 'description' => __( 'Tax rate label.', 'woocommerce' ), |
||
875 | 'type' => 'string', |
||
876 | 'context' => array( 'view', 'edit' ), |
||
877 | 'readonly' => true, |
||
878 | ), |
||
879 | 'compound' => array( |
||
880 | 'description' => __( 'Show if is a compound tax rate.', 'woocommerce' ), |
||
881 | 'type' => 'boolean', |
||
882 | 'context' => array( 'view', 'edit' ), |
||
883 | 'readonly' => true, |
||
884 | ), |
||
885 | 'tax_total' => array( |
||
886 | 'description' => __( 'Tax total (not including shipping taxes).', 'woocommerce' ), |
||
887 | 'type' => 'string', |
||
888 | 'context' => array( 'view', 'edit' ), |
||
889 | 'readonly' => true, |
||
890 | ), |
||
891 | 'shipping_tax_total' => array( |
||
892 | 'description' => __( 'Shipping tax total.', 'woocommerce' ), |
||
893 | 'type' => 'string', |
||
894 | 'context' => array( 'view', 'edit' ), |
||
895 | 'readonly' => true, |
||
896 | ), |
||
897 | 'meta_data' => array( |
||
898 | 'description' => __( 'Meta data.', 'woocommerce' ), |
||
899 | 'type' => 'array', |
||
900 | 'context' => array( 'view', 'edit' ), |
||
901 | 'items' => array( |
||
902 | 'type' => 'object', |
||
903 | 'properties' => array( |
||
904 | 'id' => array( |
||
905 | 'description' => __( 'Meta ID.', 'woocommerce' ), |
||
906 | 'type' => 'integer', |
||
907 | 'context' => array( 'view', 'edit' ), |
||
908 | 'readonly' => true, |
||
909 | ), |
||
910 | 'key' => array( |
||
911 | 'description' => __( 'Meta key.', 'woocommerce' ), |
||
912 | 'type' => 'string', |
||
913 | 'context' => array( 'view', 'edit' ), |
||
914 | ), |
||
915 | 'value' => array( |
||
916 | 'description' => __( 'Meta value.', 'woocommerce' ), |
||
917 | 'type' => 'mixed', |
||
918 | 'context' => array( 'view', 'edit' ), |
||
919 | ), |
||
920 | ), |
||
921 | ), |
||
922 | ), |
||
923 | ), |
||
924 | ), |
||
925 | ), |
||
926 | 'shipping_lines' => array( |
||
927 | 'description' => __( 'Shipping lines data.', 'woocommerce' ), |
||
928 | 'type' => 'array', |
||
929 | 'context' => array( 'view', 'edit' ), |
||
930 | 'items' => array( |
||
931 | 'type' => 'object', |
||
932 | 'properties' => array( |
||
933 | 'id' => array( |
||
934 | 'description' => __( 'Item ID.', 'woocommerce' ), |
||
935 | 'type' => 'integer', |
||
936 | 'context' => array( 'view', 'edit' ), |
||
937 | 'readonly' => true, |
||
938 | ), |
||
939 | 'method_title' => array( |
||
940 | 'description' => __( 'Shipping method name.', 'woocommerce' ), |
||
941 | 'type' => 'mixed', |
||
942 | 'context' => array( 'view', 'edit' ), |
||
943 | ), |
||
944 | 'method_id' => array( |
||
945 | 'description' => __( 'Shipping method ID.', 'woocommerce' ), |
||
946 | 'type' => 'mixed', |
||
947 | 'context' => array( 'view', 'edit' ), |
||
948 | ), |
||
949 | 'instance_id' => array( |
||
950 | 'description' => __( 'Shipping instance ID.', 'woocommerce' ), |
||
951 | 'type' => 'string', |
||
952 | 'context' => array( 'view', 'edit' ), |
||
953 | ), |
||
954 | 'total' => array( |
||
955 | 'description' => __( 'Line total (after discounts).', 'woocommerce' ), |
||
956 | 'type' => 'string', |
||
957 | 'context' => array( 'view', 'edit' ), |
||
958 | ), |
||
959 | 'total_tax' => array( |
||
960 | 'description' => __( 'Line total tax (after discounts).', 'woocommerce' ), |
||
961 | 'type' => 'string', |
||
962 | 'context' => array( 'view', 'edit' ), |
||
963 | 'readonly' => true, |
||
964 | ), |
||
965 | 'taxes' => array( |
||
966 | 'description' => __( 'Line taxes.', 'woocommerce' ), |
||
967 | 'type' => 'array', |
||
968 | 'context' => array( 'view', 'edit' ), |
||
969 | 'readonly' => true, |
||
970 | 'items' => array( |
||
971 | 'type' => 'object', |
||
972 | 'properties' => array( |
||
973 | 'id' => array( |
||
974 | 'description' => __( 'Tax rate ID.', 'woocommerce' ), |
||
975 | 'type' => 'integer', |
||
976 | 'context' => array( 'view', 'edit' ), |
||
977 | 'readonly' => true, |
||
978 | ), |
||
979 | 'total' => array( |
||
980 | 'description' => __( 'Tax total.', 'woocommerce' ), |
||
981 | 'type' => 'string', |
||
982 | 'context' => array( 'view', 'edit' ), |
||
983 | 'readonly' => true, |
||
984 | ), |
||
985 | ), |
||
986 | ), |
||
987 | ), |
||
988 | 'meta_data' => array( |
||
989 | 'description' => __( 'Meta data.', 'woocommerce' ), |
||
990 | 'type' => 'array', |
||
991 | 'context' => array( 'view', 'edit' ), |
||
992 | 'items' => array( |
||
993 | 'type' => 'object', |
||
994 | 'properties' => array( |
||
995 | 'id' => array( |
||
996 | 'description' => __( 'Meta ID.', 'woocommerce' ), |
||
997 | 'type' => 'integer', |
||
998 | 'context' => array( 'view', 'edit' ), |
||
999 | 'readonly' => true, |
||
1000 | ), |
||
1001 | 'key' => array( |
||
1002 | 'description' => __( 'Meta key.', 'woocommerce' ), |
||
1003 | 'type' => 'string', |
||
1004 | 'context' => array( 'view', 'edit' ), |
||
1005 | ), |
||
1006 | 'value' => array( |
||
1007 | 'description' => __( 'Meta value.', 'woocommerce' ), |
||
1008 | 'type' => 'mixed', |
||
1009 | 'context' => array( 'view', 'edit' ), |
||
1010 | ), |
||
1011 | ), |
||
1012 | ), |
||
1013 | ), |
||
1014 | ), |
||
1015 | ), |
||
1016 | ), |
||
1017 | 'fee_lines' => array( |
||
1018 | 'description' => __( 'Fee lines data.', 'woocommerce' ), |
||
1019 | 'type' => 'array', |
||
1020 | 'context' => array( 'view', 'edit' ), |
||
1021 | 'items' => array( |
||
1022 | 'type' => 'object', |
||
1023 | 'properties' => array( |
||
1024 | 'id' => array( |
||
1025 | 'description' => __( 'Item ID.', 'woocommerce' ), |
||
1026 | 'type' => 'integer', |
||
1027 | 'context' => array( 'view', 'edit' ), |
||
1028 | 'readonly' => true, |
||
1029 | ), |
||
1030 | 'name' => array( |
||
1031 | 'description' => __( 'Fee name.', 'woocommerce' ), |
||
1032 | 'type' => 'mixed', |
||
1033 | 'context' => array( 'view', 'edit' ), |
||
1034 | ), |
||
1035 | 'tax_class' => array( |
||
1036 | 'description' => __( 'Tax class of fee.', 'woocommerce' ), |
||
1037 | 'type' => 'string', |
||
1038 | 'context' => array( 'view', 'edit' ), |
||
1039 | ), |
||
1040 | 'tax_status' => array( |
||
1041 | 'description' => __( 'Tax status of fee.', 'woocommerce' ), |
||
1042 | 'type' => 'string', |
||
1043 | 'context' => array( 'view', 'edit' ), |
||
1044 | 'enum' => array( 'taxable', 'none' ), |
||
1045 | ), |
||
1046 | 'total' => array( |
||
1047 | 'description' => __( 'Line total (after discounts).', 'woocommerce' ), |
||
1048 | 'type' => 'string', |
||
1049 | 'context' => array( 'view', 'edit' ), |
||
1050 | ), |
||
1051 | 'total_tax' => array( |
||
1052 | 'description' => __( 'Line total tax (after discounts).', 'woocommerce' ), |
||
1053 | 'type' => 'string', |
||
1054 | 'context' => array( 'view', 'edit' ), |
||
1055 | 'readonly' => true, |
||
1056 | ), |
||
1057 | 'taxes' => array( |
||
1058 | 'description' => __( 'Line taxes.', 'woocommerce' ), |
||
1059 | 'type' => 'array', |
||
1060 | 'context' => array( 'view', 'edit' ), |
||
1061 | 'readonly' => true, |
||
1062 | 'items' => array( |
||
1063 | 'type' => 'object', |
||
1064 | 'properties' => array( |
||
1065 | 'id' => array( |
||
1066 | 'description' => __( 'Tax rate ID.', 'woocommerce' ), |
||
1067 | 'type' => 'integer', |
||
1068 | 'context' => array( 'view', 'edit' ), |
||
1069 | 'readonly' => true, |
||
1070 | ), |
||
1071 | 'total' => array( |
||
1072 | 'description' => __( 'Tax total.', 'woocommerce' ), |
||
1073 | 'type' => 'string', |
||
1074 | 'context' => array( 'view', 'edit' ), |
||
1075 | 'readonly' => true, |
||
1076 | ), |
||
1077 | 'subtotal' => array( |
||
1078 | 'description' => __( 'Tax subtotal.', 'woocommerce' ), |
||
1079 | 'type' => 'string', |
||
1080 | 'context' => array( 'view', 'edit' ), |
||
1081 | 'readonly' => true, |
||
1082 | ), |
||
1083 | ), |
||
1084 | ), |
||
1085 | ), |
||
1086 | 'meta_data' => array( |
||
1087 | 'description' => __( 'Meta data.', 'woocommerce' ), |
||
1088 | 'type' => 'array', |
||
1089 | 'context' => array( 'view', 'edit' ), |
||
1090 | 'items' => array( |
||
1091 | 'type' => 'object', |
||
1092 | 'properties' => array( |
||
1093 | 'id' => array( |
||
1094 | 'description' => __( 'Meta ID.', 'woocommerce' ), |
||
1095 | 'type' => 'integer', |
||
1096 | 'context' => array( 'view', 'edit' ), |
||
1097 | 'readonly' => true, |
||
1098 | ), |
||
1099 | 'key' => array( |
||
1100 | 'description' => __( 'Meta key.', 'woocommerce' ), |
||
1101 | 'type' => 'string', |
||
1102 | 'context' => array( 'view', 'edit' ), |
||
1103 | ), |
||
1104 | 'value' => array( |
||
1105 | 'description' => __( 'Meta value.', 'woocommerce' ), |
||
1106 | 'type' => 'mixed', |
||
1107 | 'context' => array( 'view', 'edit' ), |
||
1108 | ), |
||
1109 | ), |
||
1110 | ), |
||
1111 | ), |
||
1112 | ), |
||
1113 | ), |
||
1114 | ), |
||
1115 | 'coupon_lines' => array( |
||
1116 | 'description' => __( 'Coupons line data.', 'woocommerce' ), |
||
1117 | 'type' => 'array', |
||
1118 | 'context' => array( 'view', 'edit' ), |
||
1119 | 'items' => array( |
||
1120 | 'type' => 'object', |
||
1121 | 'properties' => array( |
||
1122 | 'id' => array( |
||
1123 | 'description' => __( 'Item ID.', 'woocommerce' ), |
||
1124 | 'type' => 'integer', |
||
1125 | 'context' => array( 'view', 'edit' ), |
||
1126 | 'readonly' => true, |
||
1127 | ), |
||
1128 | 'code' => array( |
||
1129 | 'description' => __( 'Coupon code.', 'woocommerce' ), |
||
1130 | 'type' => 'mixed', |
||
1131 | 'context' => array( 'view', 'edit' ), |
||
1132 | ), |
||
1133 | 'discount' => array( |
||
1134 | 'description' => __( 'Discount total.', 'woocommerce' ), |
||
1135 | 'type' => 'string', |
||
1136 | 'context' => array( 'view', 'edit' ), |
||
1137 | 'readonly' => true, |
||
1138 | ), |
||
1139 | 'discount_tax' => array( |
||
1140 | 'description' => __( 'Discount total tax.', 'woocommerce' ), |
||
1141 | 'type' => 'string', |
||
1142 | 'context' => array( 'view', 'edit' ), |
||
1143 | 'readonly' => true, |
||
1144 | ), |
||
1145 | 'meta_data' => array( |
||
1146 | 'description' => __( 'Meta data.', 'woocommerce' ), |
||
1147 | 'type' => 'array', |
||
1148 | 'context' => array( 'view', 'edit' ), |
||
1149 | 'items' => array( |
||
1150 | 'type' => 'object', |
||
1151 | 'properties' => array( |
||
1152 | 'id' => array( |
||
1153 | 'description' => __( 'Meta ID.', 'woocommerce' ), |
||
1154 | 'type' => 'integer', |
||
1155 | 'context' => array( 'view', 'edit' ), |
||
1156 | 'readonly' => true, |
||
1157 | ), |
||
1158 | 'key' => array( |
||
1159 | 'description' => __( 'Meta key.', 'woocommerce' ), |
||
1160 | 'type' => 'string', |
||
1161 | 'context' => array( 'view', 'edit' ), |
||
1162 | ), |
||
1163 | 'value' => array( |
||
1164 | 'description' => __( 'Meta value.', 'woocommerce' ), |
||
1165 | 'type' => 'mixed', |
||
1166 | 'context' => array( 'view', 'edit' ), |
||
1167 | ), |
||
1168 | ), |
||
1169 | ), |
||
1170 | ), |
||
1171 | ), |
||
1172 | ), |
||
1173 | ), |
||
1174 | 'refunds' => array( |
||
1175 | 'description' => __( 'List of refunds.', 'woocommerce' ), |
||
1176 | 'type' => 'array', |
||
1177 | 'context' => array( 'view', 'edit' ), |
||
1178 | 'readonly' => true, |
||
1179 | 'items' => array( |
||
1180 | 'type' => 'object', |
||
1181 | 'properties' => array( |
||
1182 | 'id' => array( |
||
1183 | 'description' => __( 'Refund ID.', 'woocommerce' ), |
||
1184 | 'type' => 'integer', |
||
1185 | 'context' => array( 'view', 'edit' ), |
||
1186 | 'readonly' => true, |
||
1187 | ), |
||
1188 | 'reason' => array( |
||
1189 | 'description' => __( 'Refund reason.', 'woocommerce' ), |
||
1190 | 'type' => 'string', |
||
1191 | 'context' => array( 'view', 'edit' ), |
||
1192 | 'readonly' => true, |
||
1193 | ), |
||
1194 | 'total' => array( |
||
1195 | 'description' => __( 'Refund total.', 'woocommerce' ), |
||
1196 | 'type' => 'string', |
||
1197 | 'context' => array( 'view', 'edit' ), |
||
1198 | 'readonly' => true, |
||
1199 | ), |
||
1200 | ), |
||
1201 | ), |
||
1202 | ), |
||
1203 | 'set_paid' => array( |
||
1204 | 'description' => __( 'Define if the order is paid. It will set the status to processing and reduce stock items.', 'woocommerce' ), |
||
1205 | 'type' => 'boolean', |
||
1206 | 'default' => false, |
||
1207 | 'context' => array( 'edit' ), |
||
1208 | ), |
||
1209 | ), |
||
1210 | ); |
||
1211 | |||
1212 | return $this->add_additional_fields_schema( $schema ); |
||
1213 | } |
||
1262 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.