| Conditions | 1 |
| Paths | 1 |
| Total Lines | 831 |
| Code Lines | 660 |
| 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 |
||
| 837 | public function get_item_schema() { |
||
| 838 | $schema = array( |
||
| 839 | '$schema' => 'http://json-schema.org/draft-04/schema#', |
||
| 840 | 'title' => $this->post_type, |
||
| 841 | 'type' => 'object', |
||
| 842 | 'properties' => array( |
||
| 843 | 'id' => array( |
||
| 844 | 'description' => __( 'Unique identifier for the resource.', 'woocommerce' ), |
||
| 845 | 'type' => 'integer', |
||
| 846 | 'context' => array( 'view', 'edit' ), |
||
| 847 | 'readonly' => true, |
||
| 848 | ), |
||
| 849 | 'parent_id' => array( |
||
| 850 | 'description' => __( 'Parent order ID.', 'woocommerce' ), |
||
| 851 | 'type' => 'integer', |
||
| 852 | 'context' => array( 'view', 'edit' ), |
||
| 853 | ), |
||
| 854 | 'number' => array( |
||
| 855 | 'description' => __( 'Order number.', 'woocommerce' ), |
||
| 856 | 'type' => 'string', |
||
| 857 | 'context' => array( 'view', 'edit' ), |
||
| 858 | 'readonly' => true, |
||
| 859 | ), |
||
| 860 | 'order_key' => array( |
||
| 861 | 'description' => __( 'Order key.', 'woocommerce' ), |
||
| 862 | 'type' => 'string', |
||
| 863 | 'context' => array( 'view', 'edit' ), |
||
| 864 | 'readonly' => true, |
||
| 865 | ), |
||
| 866 | 'created_via' => array( |
||
| 867 | 'description' => __( 'Shows where the order was created.', 'woocommerce' ), |
||
| 868 | 'type' => 'string', |
||
| 869 | 'context' => array( 'view', 'edit' ), |
||
| 870 | 'readonly' => true, |
||
| 871 | ), |
||
| 872 | 'version' => array( |
||
| 873 | 'description' => __( 'Version of WooCommerce which last updated the order.', 'woocommerce' ), |
||
| 874 | 'type' => 'integer', |
||
| 875 | 'context' => array( 'view', 'edit' ), |
||
| 876 | 'readonly' => true, |
||
| 877 | ), |
||
| 878 | 'status' => array( |
||
| 879 | 'description' => __( 'Order status.', 'woocommerce' ), |
||
| 880 | 'type' => 'string', |
||
| 881 | 'default' => 'pending', |
||
| 882 | 'enum' => $this->get_order_statuses(), |
||
| 883 | 'context' => array( 'view', 'edit' ), |
||
| 884 | ), |
||
| 885 | 'currency' => array( |
||
| 886 | 'description' => __( 'Currency the order was created with, in ISO format.', 'woocommerce' ), |
||
| 887 | 'type' => 'string', |
||
| 888 | 'default' => get_woocommerce_currency(), |
||
| 889 | 'enum' => array_keys( get_woocommerce_currencies() ), |
||
| 890 | 'context' => array( 'view', 'edit' ), |
||
| 891 | ), |
||
| 892 | 'date_created' => array( |
||
| 893 | 'description' => __( "The date the order was created, in the site's timezone.", 'woocommerce' ), |
||
| 894 | 'type' => 'date-time', |
||
| 895 | 'context' => array( 'view', 'edit' ), |
||
| 896 | 'readonly' => true, |
||
| 897 | ), |
||
| 898 | 'date_created_gmt' => array( |
||
| 899 | 'description' => __( 'The date the order was created, as GMT.', 'woocommerce' ), |
||
| 900 | 'type' => 'date-time', |
||
| 901 | 'context' => array( 'view', 'edit' ), |
||
| 902 | 'readonly' => true, |
||
| 903 | ), |
||
| 904 | 'date_modified' => array( |
||
| 905 | 'description' => __( "The date the order was last modified, in the site's timezone.", 'woocommerce' ), |
||
| 906 | 'type' => 'date-time', |
||
| 907 | 'context' => array( 'view', 'edit' ), |
||
| 908 | 'readonly' => true, |
||
| 909 | ), |
||
| 910 | 'date_modified_gmt' => array( |
||
| 911 | 'description' => __( 'The date the order was last modified, as GMT.', 'woocommerce' ), |
||
| 912 | 'type' => 'date-time', |
||
| 913 | 'context' => array( 'view', 'edit' ), |
||
| 914 | 'readonly' => true, |
||
| 915 | ), |
||
| 916 | 'discount_total' => array( |
||
| 917 | 'description' => __( 'Total discount amount for the order.', 'woocommerce' ), |
||
| 918 | 'type' => 'string', |
||
| 919 | 'context' => array( 'view', 'edit' ), |
||
| 920 | 'readonly' => true, |
||
| 921 | ), |
||
| 922 | 'discount_tax' => array( |
||
| 923 | 'description' => __( 'Total discount tax amount for the order.', 'woocommerce' ), |
||
| 924 | 'type' => 'string', |
||
| 925 | 'context' => array( 'view', 'edit' ), |
||
| 926 | 'readonly' => true, |
||
| 927 | ), |
||
| 928 | 'shipping_total' => array( |
||
| 929 | 'description' => __( 'Total shipping amount for the order.', 'woocommerce' ), |
||
| 930 | 'type' => 'string', |
||
| 931 | 'context' => array( 'view', 'edit' ), |
||
| 932 | 'readonly' => true, |
||
| 933 | ), |
||
| 934 | 'shipping_tax' => array( |
||
| 935 | 'description' => __( 'Total shipping tax amount for the order.', 'woocommerce' ), |
||
| 936 | 'type' => 'string', |
||
| 937 | 'context' => array( 'view', 'edit' ), |
||
| 938 | 'readonly' => true, |
||
| 939 | ), |
||
| 940 | 'cart_tax' => array( |
||
| 941 | 'description' => __( 'Sum of line item taxes only.', 'woocommerce' ), |
||
| 942 | 'type' => 'string', |
||
| 943 | 'context' => array( 'view', 'edit' ), |
||
| 944 | 'readonly' => true, |
||
| 945 | ), |
||
| 946 | 'total' => array( |
||
| 947 | 'description' => __( 'Grand total.', 'woocommerce' ), |
||
| 948 | 'type' => 'string', |
||
| 949 | 'context' => array( 'view', 'edit' ), |
||
| 950 | 'readonly' => true, |
||
| 951 | ), |
||
| 952 | 'total_tax' => array( |
||
| 953 | 'description' => __( 'Sum of all taxes.', 'woocommerce' ), |
||
| 954 | 'type' => 'string', |
||
| 955 | 'context' => array( 'view', 'edit' ), |
||
| 956 | 'readonly' => true, |
||
| 957 | ), |
||
| 958 | 'prices_include_tax' => array( |
||
| 959 | 'description' => __( 'True the prices included tax during checkout.', 'woocommerce' ), |
||
| 960 | 'type' => 'boolean', |
||
| 961 | 'context' => array( 'view', 'edit' ), |
||
| 962 | 'readonly' => true, |
||
| 963 | ), |
||
| 964 | 'customer_id' => array( |
||
| 965 | 'description' => __( 'User ID who owns the order. 0 for guests.', 'woocommerce' ), |
||
| 966 | 'type' => 'integer', |
||
| 967 | 'default' => 0, |
||
| 968 | 'context' => array( 'view', 'edit' ), |
||
| 969 | ), |
||
| 970 | 'customer_ip_address' => array( |
||
| 971 | 'description' => __( "Customer's IP address.", 'woocommerce' ), |
||
| 972 | 'type' => 'string', |
||
| 973 | 'context' => array( 'view', 'edit' ), |
||
| 974 | 'readonly' => true, |
||
| 975 | ), |
||
| 976 | 'customer_user_agent' => array( |
||
| 977 | 'description' => __( 'User agent of the customer.', 'woocommerce' ), |
||
| 978 | 'type' => 'string', |
||
| 979 | 'context' => array( 'view', 'edit' ), |
||
| 980 | 'readonly' => true, |
||
| 981 | ), |
||
| 982 | 'customer_note' => array( |
||
| 983 | 'description' => __( 'Note left by customer during checkout.', 'woocommerce' ), |
||
| 984 | 'type' => 'string', |
||
| 985 | 'context' => array( 'view', 'edit' ), |
||
| 986 | ), |
||
| 987 | 'billing' => array( |
||
| 988 | 'description' => __( 'Billing address.', 'woocommerce' ), |
||
| 989 | 'type' => 'object', |
||
| 990 | 'context' => array( 'view', 'edit' ), |
||
| 991 | 'properties' => array( |
||
| 992 | 'first_name' => array( |
||
| 993 | 'description' => __( 'First name.', 'woocommerce' ), |
||
| 994 | 'type' => 'string', |
||
| 995 | 'context' => array( 'view', 'edit' ), |
||
| 996 | ), |
||
| 997 | 'last_name' => array( |
||
| 998 | 'description' => __( 'Last name.', 'woocommerce' ), |
||
| 999 | 'type' => 'string', |
||
| 1000 | 'context' => array( 'view', 'edit' ), |
||
| 1001 | ), |
||
| 1002 | 'company' => array( |
||
| 1003 | 'description' => __( 'Company name.', 'woocommerce' ), |
||
| 1004 | 'type' => 'string', |
||
| 1005 | 'context' => array( 'view', 'edit' ), |
||
| 1006 | ), |
||
| 1007 | 'address_1' => array( |
||
| 1008 | 'description' => __( 'Address line 1', 'woocommerce' ), |
||
| 1009 | 'type' => 'string', |
||
| 1010 | 'context' => array( 'view', 'edit' ), |
||
| 1011 | ), |
||
| 1012 | 'address_2' => array( |
||
| 1013 | 'description' => __( 'Address line 2', 'woocommerce' ), |
||
| 1014 | 'type' => 'string', |
||
| 1015 | 'context' => array( 'view', 'edit' ), |
||
| 1016 | ), |
||
| 1017 | 'city' => array( |
||
| 1018 | 'description' => __( 'City name.', 'woocommerce' ), |
||
| 1019 | 'type' => 'string', |
||
| 1020 | 'context' => array( 'view', 'edit' ), |
||
| 1021 | ), |
||
| 1022 | 'state' => array( |
||
| 1023 | 'description' => __( 'ISO code or name of the state, province or district.', 'woocommerce' ), |
||
| 1024 | 'type' => 'string', |
||
| 1025 | 'context' => array( 'view', 'edit' ), |
||
| 1026 | ), |
||
| 1027 | 'postcode' => array( |
||
| 1028 | 'description' => __( 'Postal code.', 'woocommerce' ), |
||
| 1029 | 'type' => 'string', |
||
| 1030 | 'context' => array( 'view', 'edit' ), |
||
| 1031 | ), |
||
| 1032 | 'country' => array( |
||
| 1033 | 'description' => __( 'Country code in ISO 3166-1 alpha-2 format.', 'woocommerce' ), |
||
| 1034 | 'type' => 'string', |
||
| 1035 | 'context' => array( 'view', 'edit' ), |
||
| 1036 | ), |
||
| 1037 | 'email' => array( |
||
| 1038 | 'description' => __( 'Email address.', 'woocommerce' ), |
||
| 1039 | 'type' => 'string', |
||
| 1040 | 'format' => 'email', |
||
| 1041 | 'context' => array( 'view', 'edit' ), |
||
| 1042 | ), |
||
| 1043 | 'phone' => array( |
||
| 1044 | 'description' => __( 'Phone number.', 'woocommerce' ), |
||
| 1045 | 'type' => 'string', |
||
| 1046 | 'context' => array( 'view', 'edit' ), |
||
| 1047 | ), |
||
| 1048 | ), |
||
| 1049 | ), |
||
| 1050 | 'shipping' => array( |
||
| 1051 | 'description' => __( 'Shipping address.', 'woocommerce' ), |
||
| 1052 | 'type' => 'object', |
||
| 1053 | 'context' => array( 'view', 'edit' ), |
||
| 1054 | 'properties' => array( |
||
| 1055 | 'first_name' => array( |
||
| 1056 | 'description' => __( 'First name.', 'woocommerce' ), |
||
| 1057 | 'type' => 'string', |
||
| 1058 | 'context' => array( 'view', 'edit' ), |
||
| 1059 | ), |
||
| 1060 | 'last_name' => array( |
||
| 1061 | 'description' => __( 'Last name.', 'woocommerce' ), |
||
| 1062 | 'type' => 'string', |
||
| 1063 | 'context' => array( 'view', 'edit' ), |
||
| 1064 | ), |
||
| 1065 | 'company' => array( |
||
| 1066 | 'description' => __( 'Company name.', 'woocommerce' ), |
||
| 1067 | 'type' => 'string', |
||
| 1068 | 'context' => array( 'view', 'edit' ), |
||
| 1069 | ), |
||
| 1070 | 'address_1' => array( |
||
| 1071 | 'description' => __( 'Address line 1', 'woocommerce' ), |
||
| 1072 | 'type' => 'string', |
||
| 1073 | 'context' => array( 'view', 'edit' ), |
||
| 1074 | ), |
||
| 1075 | 'address_2' => array( |
||
| 1076 | 'description' => __( 'Address line 2', 'woocommerce' ), |
||
| 1077 | 'type' => 'string', |
||
| 1078 | 'context' => array( 'view', 'edit' ), |
||
| 1079 | ), |
||
| 1080 | 'city' => array( |
||
| 1081 | 'description' => __( 'City name.', 'woocommerce' ), |
||
| 1082 | 'type' => 'string', |
||
| 1083 | 'context' => array( 'view', 'edit' ), |
||
| 1084 | ), |
||
| 1085 | 'state' => array( |
||
| 1086 | 'description' => __( 'ISO code or name of the state, province or district.', 'woocommerce' ), |
||
| 1087 | 'type' => 'string', |
||
| 1088 | 'context' => array( 'view', 'edit' ), |
||
| 1089 | ), |
||
| 1090 | 'postcode' => array( |
||
| 1091 | 'description' => __( 'Postal code.', 'woocommerce' ), |
||
| 1092 | 'type' => 'string', |
||
| 1093 | 'context' => array( 'view', 'edit' ), |
||
| 1094 | ), |
||
| 1095 | 'country' => array( |
||
| 1096 | 'description' => __( 'Country code in ISO 3166-1 alpha-2 format.', 'woocommerce' ), |
||
| 1097 | 'type' => 'string', |
||
| 1098 | 'context' => array( 'view', 'edit' ), |
||
| 1099 | ), |
||
| 1100 | ), |
||
| 1101 | ), |
||
| 1102 | 'payment_method' => array( |
||
| 1103 | 'description' => __( 'Payment method ID.', 'woocommerce' ), |
||
| 1104 | 'type' => 'string', |
||
| 1105 | 'context' => array( 'view', 'edit' ), |
||
| 1106 | ), |
||
| 1107 | 'payment_method_title' => array( |
||
| 1108 | 'description' => __( 'Payment method title.', 'woocommerce' ), |
||
| 1109 | 'type' => 'string', |
||
| 1110 | 'context' => array( 'view', 'edit' ), |
||
| 1111 | 'arg_options' => array( |
||
| 1112 | 'sanitize_callback' => 'sanitize_text_field', |
||
| 1113 | ), |
||
| 1114 | ), |
||
| 1115 | 'transaction_id' => array( |
||
| 1116 | 'description' => __( 'Unique transaction ID.', 'woocommerce' ), |
||
| 1117 | 'type' => 'string', |
||
| 1118 | 'context' => array( 'view', 'edit' ), |
||
| 1119 | ), |
||
| 1120 | 'date_paid' => array( |
||
| 1121 | 'description' => __( "The date the order was paid, in the site's timezone.", 'woocommerce' ), |
||
| 1122 | 'type' => 'date-time', |
||
| 1123 | 'context' => array( 'view', 'edit' ), |
||
| 1124 | 'readonly' => true, |
||
| 1125 | ), |
||
| 1126 | 'date_paid_gmt' => array( |
||
| 1127 | 'description' => __( 'The date the order was paid, as GMT.', 'woocommerce' ), |
||
| 1128 | 'type' => 'date-time', |
||
| 1129 | 'context' => array( 'view', 'edit' ), |
||
| 1130 | 'readonly' => true, |
||
| 1131 | ), |
||
| 1132 | 'date_completed' => array( |
||
| 1133 | 'description' => __( "The date the order was completed, in the site's timezone.", 'woocommerce' ), |
||
| 1134 | 'type' => 'date-time', |
||
| 1135 | 'context' => array( 'view', 'edit' ), |
||
| 1136 | 'readonly' => true, |
||
| 1137 | ), |
||
| 1138 | 'date_completed_gmt' => array( |
||
| 1139 | 'description' => __( 'The date the order was completed, as GMT.', 'woocommerce' ), |
||
| 1140 | 'type' => 'date-time', |
||
| 1141 | 'context' => array( 'view', 'edit' ), |
||
| 1142 | 'readonly' => true, |
||
| 1143 | ), |
||
| 1144 | 'cart_hash' => array( |
||
| 1145 | 'description' => __( 'MD5 hash of cart items to ensure orders are not modified.', 'woocommerce' ), |
||
| 1146 | 'type' => 'string', |
||
| 1147 | 'context' => array( 'view', 'edit' ), |
||
| 1148 | 'readonly' => true, |
||
| 1149 | ), |
||
| 1150 | 'meta_data' => array( |
||
| 1151 | 'description' => __( 'Meta data.', 'woocommerce' ), |
||
| 1152 | 'type' => 'array', |
||
| 1153 | 'context' => array( 'view', 'edit' ), |
||
| 1154 | 'items' => array( |
||
| 1155 | 'type' => 'object', |
||
| 1156 | 'properties' => array( |
||
| 1157 | 'id' => array( |
||
| 1158 | 'description' => __( 'Meta ID.', 'woocommerce' ), |
||
| 1159 | 'type' => 'integer', |
||
| 1160 | 'context' => array( 'view', 'edit' ), |
||
| 1161 | 'readonly' => true, |
||
| 1162 | ), |
||
| 1163 | 'key' => array( |
||
| 1164 | 'description' => __( 'Meta key.', 'woocommerce' ), |
||
| 1165 | 'type' => 'string', |
||
| 1166 | 'context' => array( 'view', 'edit' ), |
||
| 1167 | ), |
||
| 1168 | 'value' => array( |
||
| 1169 | 'description' => __( 'Meta value.', 'woocommerce' ), |
||
| 1170 | 'type' => 'mixed', |
||
| 1171 | 'context' => array( 'view', 'edit' ), |
||
| 1172 | ), |
||
| 1173 | ), |
||
| 1174 | ), |
||
| 1175 | ), |
||
| 1176 | 'line_items' => array( |
||
| 1177 | 'description' => __( 'Line items data.', 'woocommerce' ), |
||
| 1178 | 'type' => 'array', |
||
| 1179 | 'context' => array( 'view', 'edit' ), |
||
| 1180 | 'items' => array( |
||
| 1181 | 'type' => 'object', |
||
| 1182 | 'properties' => array( |
||
| 1183 | 'id' => array( |
||
| 1184 | 'description' => __( 'Item ID.', 'woocommerce' ), |
||
| 1185 | 'type' => 'integer', |
||
| 1186 | 'context' => array( 'view', 'edit' ), |
||
| 1187 | 'readonly' => true, |
||
| 1188 | ), |
||
| 1189 | 'name' => array( |
||
| 1190 | 'description' => __( 'Product name.', 'woocommerce' ), |
||
| 1191 | 'type' => 'mixed', |
||
| 1192 | 'context' => array( 'view', 'edit' ), |
||
| 1193 | ), |
||
| 1194 | 'product_id' => array( |
||
| 1195 | 'description' => __( 'Product ID.', 'woocommerce' ), |
||
| 1196 | 'type' => 'mixed', |
||
| 1197 | 'context' => array( 'view', 'edit' ), |
||
| 1198 | ), |
||
| 1199 | 'variation_id' => array( |
||
| 1200 | 'description' => __( 'Variation ID, if applicable.', 'woocommerce' ), |
||
| 1201 | 'type' => 'integer', |
||
| 1202 | 'context' => array( 'view', 'edit' ), |
||
| 1203 | ), |
||
| 1204 | 'quantity' => array( |
||
| 1205 | 'description' => __( 'Quantity ordered.', 'woocommerce' ), |
||
| 1206 | 'type' => 'integer', |
||
| 1207 | 'context' => array( 'view', 'edit' ), |
||
| 1208 | ), |
||
| 1209 | 'tax_class' => array( |
||
| 1210 | 'description' => __( 'Tax class of product.', 'woocommerce' ), |
||
| 1211 | 'type' => 'string', |
||
| 1212 | 'context' => array( 'view', 'edit' ), |
||
| 1213 | ), |
||
| 1214 | 'subtotal' => array( |
||
| 1215 | 'description' => __( 'Line subtotal (before discounts).', 'woocommerce' ), |
||
| 1216 | 'type' => 'string', |
||
| 1217 | 'context' => array( 'view', 'edit' ), |
||
| 1218 | ), |
||
| 1219 | 'subtotal_tax' => array( |
||
| 1220 | 'description' => __( 'Line subtotal tax (before discounts).', 'woocommerce' ), |
||
| 1221 | 'type' => 'string', |
||
| 1222 | 'context' => array( 'view', 'edit' ), |
||
| 1223 | 'readonly' => true, |
||
| 1224 | ), |
||
| 1225 | 'total' => array( |
||
| 1226 | 'description' => __( 'Line total (after discounts).', 'woocommerce' ), |
||
| 1227 | 'type' => 'string', |
||
| 1228 | 'context' => array( 'view', 'edit' ), |
||
| 1229 | ), |
||
| 1230 | 'total_tax' => array( |
||
| 1231 | 'description' => __( 'Line total tax (after discounts).', 'woocommerce' ), |
||
| 1232 | 'type' => 'string', |
||
| 1233 | 'context' => array( 'view', 'edit' ), |
||
| 1234 | 'readonly' => true, |
||
| 1235 | ), |
||
| 1236 | 'taxes' => array( |
||
| 1237 | 'description' => __( 'Line taxes.', 'woocommerce' ), |
||
| 1238 | 'type' => 'array', |
||
| 1239 | 'context' => array( 'view', 'edit' ), |
||
| 1240 | 'readonly' => true, |
||
| 1241 | 'items' => array( |
||
| 1242 | 'type' => 'object', |
||
| 1243 | 'properties' => array( |
||
| 1244 | 'id' => array( |
||
| 1245 | 'description' => __( 'Tax rate ID.', 'woocommerce' ), |
||
| 1246 | 'type' => 'integer', |
||
| 1247 | 'context' => array( 'view', 'edit' ), |
||
| 1248 | ), |
||
| 1249 | 'total' => array( |
||
| 1250 | 'description' => __( 'Tax total.', 'woocommerce' ), |
||
| 1251 | 'type' => 'string', |
||
| 1252 | 'context' => array( 'view', 'edit' ), |
||
| 1253 | ), |
||
| 1254 | 'subtotal' => array( |
||
| 1255 | 'description' => __( 'Tax subtotal.', 'woocommerce' ), |
||
| 1256 | 'type' => 'string', |
||
| 1257 | 'context' => array( 'view', 'edit' ), |
||
| 1258 | ), |
||
| 1259 | ), |
||
| 1260 | ), |
||
| 1261 | ), |
||
| 1262 | 'meta_data' => array( |
||
| 1263 | 'description' => __( 'Meta data.', 'woocommerce' ), |
||
| 1264 | 'type' => 'array', |
||
| 1265 | 'context' => array( 'view', 'edit' ), |
||
| 1266 | 'items' => array( |
||
| 1267 | 'type' => 'object', |
||
| 1268 | 'properties' => array( |
||
| 1269 | 'id' => array( |
||
| 1270 | 'description' => __( 'Meta ID.', 'woocommerce' ), |
||
| 1271 | 'type' => 'integer', |
||
| 1272 | 'context' => array( 'view', 'edit' ), |
||
| 1273 | 'readonly' => true, |
||
| 1274 | ), |
||
| 1275 | 'key' => array( |
||
| 1276 | 'description' => __( 'Meta key.', 'woocommerce' ), |
||
| 1277 | 'type' => 'string', |
||
| 1278 | 'context' => array( 'view', 'edit' ), |
||
| 1279 | ), |
||
| 1280 | 'value' => array( |
||
| 1281 | 'description' => __( 'Meta value.', 'woocommerce' ), |
||
| 1282 | 'type' => 'mixed', |
||
| 1283 | 'context' => array( 'view', 'edit' ), |
||
| 1284 | ), |
||
| 1285 | ), |
||
| 1286 | ), |
||
| 1287 | ), |
||
| 1288 | 'sku' => array( |
||
| 1289 | 'description' => __( 'Product SKU.', 'woocommerce' ), |
||
| 1290 | 'type' => 'string', |
||
| 1291 | 'context' => array( 'view', 'edit' ), |
||
| 1292 | 'readonly' => true, |
||
| 1293 | ), |
||
| 1294 | 'price' => array( |
||
| 1295 | 'description' => __( 'Product price.', 'woocommerce' ), |
||
| 1296 | 'type' => 'number', |
||
| 1297 | 'context' => array( 'view', 'edit' ), |
||
| 1298 | 'readonly' => true, |
||
| 1299 | ), |
||
| 1300 | ), |
||
| 1301 | ), |
||
| 1302 | ), |
||
| 1303 | 'tax_lines' => array( |
||
| 1304 | 'description' => __( 'Tax lines data.', 'woocommerce' ), |
||
| 1305 | 'type' => 'array', |
||
| 1306 | 'context' => array( 'view', 'edit' ), |
||
| 1307 | 'readonly' => true, |
||
| 1308 | 'items' => array( |
||
| 1309 | 'type' => 'object', |
||
| 1310 | 'properties' => array( |
||
| 1311 | 'id' => array( |
||
| 1312 | 'description' => __( 'Item ID.', 'woocommerce' ), |
||
| 1313 | 'type' => 'integer', |
||
| 1314 | 'context' => array( 'view', 'edit' ), |
||
| 1315 | 'readonly' => true, |
||
| 1316 | ), |
||
| 1317 | 'rate_code' => array( |
||
| 1318 | 'description' => __( 'Tax rate code.', 'woocommerce' ), |
||
| 1319 | 'type' => 'string', |
||
| 1320 | 'context' => array( 'view', 'edit' ), |
||
| 1321 | 'readonly' => true, |
||
| 1322 | ), |
||
| 1323 | 'rate_id' => array( |
||
| 1324 | 'description' => __( 'Tax rate ID.', 'woocommerce' ), |
||
| 1325 | 'type' => 'string', |
||
| 1326 | 'context' => array( 'view', 'edit' ), |
||
| 1327 | 'readonly' => true, |
||
| 1328 | ), |
||
| 1329 | 'label' => array( |
||
| 1330 | 'description' => __( 'Tax rate label.', 'woocommerce' ), |
||
| 1331 | 'type' => 'string', |
||
| 1332 | 'context' => array( 'view', 'edit' ), |
||
| 1333 | 'readonly' => true, |
||
| 1334 | ), |
||
| 1335 | 'compound' => array( |
||
| 1336 | 'description' => __( 'Show if is a compound tax rate.', 'woocommerce' ), |
||
| 1337 | 'type' => 'boolean', |
||
| 1338 | 'context' => array( 'view', 'edit' ), |
||
| 1339 | 'readonly' => true, |
||
| 1340 | ), |
||
| 1341 | 'tax_total' => array( |
||
| 1342 | 'description' => __( 'Tax total (not including shipping taxes).', 'woocommerce' ), |
||
| 1343 | 'type' => 'string', |
||
| 1344 | 'context' => array( 'view', 'edit' ), |
||
| 1345 | 'readonly' => true, |
||
| 1346 | ), |
||
| 1347 | 'shipping_tax_total' => array( |
||
| 1348 | 'description' => __( 'Shipping tax total.', 'woocommerce' ), |
||
| 1349 | 'type' => 'string', |
||
| 1350 | 'context' => array( 'view', 'edit' ), |
||
| 1351 | 'readonly' => true, |
||
| 1352 | ), |
||
| 1353 | 'meta_data' => array( |
||
| 1354 | 'description' => __( 'Meta data.', 'woocommerce' ), |
||
| 1355 | 'type' => 'array', |
||
| 1356 | 'context' => array( 'view', 'edit' ), |
||
| 1357 | 'items' => array( |
||
| 1358 | 'type' => 'object', |
||
| 1359 | 'properties' => array( |
||
| 1360 | 'id' => array( |
||
| 1361 | 'description' => __( 'Meta ID.', 'woocommerce' ), |
||
| 1362 | 'type' => 'integer', |
||
| 1363 | 'context' => array( 'view', 'edit' ), |
||
| 1364 | 'readonly' => true, |
||
| 1365 | ), |
||
| 1366 | 'key' => array( |
||
| 1367 | 'description' => __( 'Meta key.', 'woocommerce' ), |
||
| 1368 | 'type' => 'string', |
||
| 1369 | 'context' => array( 'view', 'edit' ), |
||
| 1370 | ), |
||
| 1371 | 'value' => array( |
||
| 1372 | 'description' => __( 'Meta value.', 'woocommerce' ), |
||
| 1373 | 'type' => 'mixed', |
||
| 1374 | 'context' => array( 'view', 'edit' ), |
||
| 1375 | ), |
||
| 1376 | ), |
||
| 1377 | ), |
||
| 1378 | ), |
||
| 1379 | ), |
||
| 1380 | ), |
||
| 1381 | ), |
||
| 1382 | 'shipping_lines' => array( |
||
| 1383 | 'description' => __( 'Shipping lines data.', 'woocommerce' ), |
||
| 1384 | 'type' => 'array', |
||
| 1385 | 'context' => array( 'view', 'edit' ), |
||
| 1386 | 'items' => array( |
||
| 1387 | 'type' => 'object', |
||
| 1388 | 'properties' => array( |
||
| 1389 | 'id' => array( |
||
| 1390 | 'description' => __( 'Item ID.', 'woocommerce' ), |
||
| 1391 | 'type' => 'integer', |
||
| 1392 | 'context' => array( 'view', 'edit' ), |
||
| 1393 | 'readonly' => true, |
||
| 1394 | ), |
||
| 1395 | 'method_title' => array( |
||
| 1396 | 'description' => __( 'Shipping method name.', 'woocommerce' ), |
||
| 1397 | 'type' => 'mixed', |
||
| 1398 | 'context' => array( 'view', 'edit' ), |
||
| 1399 | ), |
||
| 1400 | 'method_id' => array( |
||
| 1401 | 'description' => __( 'Shipping method ID.', 'woocommerce' ), |
||
| 1402 | 'type' => 'mixed', |
||
| 1403 | 'context' => array( 'view', 'edit' ), |
||
| 1404 | ), |
||
| 1405 | 'instance_id' => array( |
||
| 1406 | 'description' => __( 'Shipping instance ID.', 'woocommerce' ), |
||
| 1407 | 'type' => 'string', |
||
| 1408 | 'context' => array( 'view', 'edit' ), |
||
| 1409 | ), |
||
| 1410 | 'total' => array( |
||
| 1411 | 'description' => __( 'Line total (after discounts).', 'woocommerce' ), |
||
| 1412 | 'type' => 'string', |
||
| 1413 | 'context' => array( 'view', 'edit' ), |
||
| 1414 | ), |
||
| 1415 | 'total_tax' => array( |
||
| 1416 | 'description' => __( 'Line total tax (after discounts).', 'woocommerce' ), |
||
| 1417 | 'type' => 'string', |
||
| 1418 | 'context' => array( 'view', 'edit' ), |
||
| 1419 | 'readonly' => true, |
||
| 1420 | ), |
||
| 1421 | 'taxes' => array( |
||
| 1422 | 'description' => __( 'Line taxes.', 'woocommerce' ), |
||
| 1423 | 'type' => 'array', |
||
| 1424 | 'context' => array( 'view', 'edit' ), |
||
| 1425 | 'readonly' => true, |
||
| 1426 | 'items' => array( |
||
| 1427 | 'type' => 'object', |
||
| 1428 | 'properties' => array( |
||
| 1429 | 'id' => array( |
||
| 1430 | 'description' => __( 'Tax rate ID.', 'woocommerce' ), |
||
| 1431 | 'type' => 'integer', |
||
| 1432 | 'context' => array( 'view', 'edit' ), |
||
| 1433 | 'readonly' => true, |
||
| 1434 | ), |
||
| 1435 | 'total' => array( |
||
| 1436 | 'description' => __( 'Tax total.', 'woocommerce' ), |
||
| 1437 | 'type' => 'string', |
||
| 1438 | 'context' => array( 'view', 'edit' ), |
||
| 1439 | 'readonly' => true, |
||
| 1440 | ), |
||
| 1441 | ), |
||
| 1442 | ), |
||
| 1443 | ), |
||
| 1444 | 'meta_data' => array( |
||
| 1445 | 'description' => __( 'Meta data.', 'woocommerce' ), |
||
| 1446 | 'type' => 'array', |
||
| 1447 | 'context' => array( 'view', 'edit' ), |
||
| 1448 | 'items' => array( |
||
| 1449 | 'type' => 'object', |
||
| 1450 | 'properties' => array( |
||
| 1451 | 'id' => array( |
||
| 1452 | 'description' => __( 'Meta ID.', 'woocommerce' ), |
||
| 1453 | 'type' => 'integer', |
||
| 1454 | 'context' => array( 'view', 'edit' ), |
||
| 1455 | 'readonly' => true, |
||
| 1456 | ), |
||
| 1457 | 'key' => array( |
||
| 1458 | 'description' => __( 'Meta key.', 'woocommerce' ), |
||
| 1459 | 'type' => 'string', |
||
| 1460 | 'context' => array( 'view', 'edit' ), |
||
| 1461 | ), |
||
| 1462 | 'value' => array( |
||
| 1463 | 'description' => __( 'Meta value.', 'woocommerce' ), |
||
| 1464 | 'type' => 'mixed', |
||
| 1465 | 'context' => array( 'view', 'edit' ), |
||
| 1466 | ), |
||
| 1467 | ), |
||
| 1468 | ), |
||
| 1469 | ), |
||
| 1470 | ), |
||
| 1471 | ), |
||
| 1472 | ), |
||
| 1473 | 'fee_lines' => array( |
||
| 1474 | 'description' => __( 'Fee lines data.', 'woocommerce' ), |
||
| 1475 | 'type' => 'array', |
||
| 1476 | 'context' => array( 'view', 'edit' ), |
||
| 1477 | 'items' => array( |
||
| 1478 | 'type' => 'object', |
||
| 1479 | 'properties' => array( |
||
| 1480 | 'id' => array( |
||
| 1481 | 'description' => __( 'Item ID.', 'woocommerce' ), |
||
| 1482 | 'type' => 'integer', |
||
| 1483 | 'context' => array( 'view', 'edit' ), |
||
| 1484 | 'readonly' => true, |
||
| 1485 | ), |
||
| 1486 | 'name' => array( |
||
| 1487 | 'description' => __( 'Fee name.', 'woocommerce' ), |
||
| 1488 | 'type' => 'mixed', |
||
| 1489 | 'context' => array( 'view', 'edit' ), |
||
| 1490 | ), |
||
| 1491 | 'tax_class' => array( |
||
| 1492 | 'description' => __( 'Tax class of fee.', 'woocommerce' ), |
||
| 1493 | 'type' => 'string', |
||
| 1494 | 'context' => array( 'view', 'edit' ), |
||
| 1495 | ), |
||
| 1496 | 'tax_status' => array( |
||
| 1497 | 'description' => __( 'Tax status of fee.', 'woocommerce' ), |
||
| 1498 | 'type' => 'string', |
||
| 1499 | 'context' => array( 'view', 'edit' ), |
||
| 1500 | 'enum' => array( 'taxable', 'none' ), |
||
| 1501 | ), |
||
| 1502 | 'total' => array( |
||
| 1503 | 'description' => __( 'Line total (after discounts).', 'woocommerce' ), |
||
| 1504 | 'type' => 'string', |
||
| 1505 | 'context' => array( 'view', 'edit' ), |
||
| 1506 | ), |
||
| 1507 | 'total_tax' => array( |
||
| 1508 | 'description' => __( 'Line total tax (after discounts).', 'woocommerce' ), |
||
| 1509 | 'type' => 'string', |
||
| 1510 | 'context' => array( 'view', 'edit' ), |
||
| 1511 | 'readonly' => true, |
||
| 1512 | ), |
||
| 1513 | 'taxes' => array( |
||
| 1514 | 'description' => __( 'Line taxes.', 'woocommerce' ), |
||
| 1515 | 'type' => 'array', |
||
| 1516 | 'context' => array( 'view', 'edit' ), |
||
| 1517 | 'readonly' => true, |
||
| 1518 | 'items' => array( |
||
| 1519 | 'type' => 'object', |
||
| 1520 | 'properties' => array( |
||
| 1521 | 'id' => array( |
||
| 1522 | 'description' => __( 'Tax rate ID.', 'woocommerce' ), |
||
| 1523 | 'type' => 'integer', |
||
| 1524 | 'context' => array( 'view', 'edit' ), |
||
| 1525 | 'readonly' => true, |
||
| 1526 | ), |
||
| 1527 | 'total' => array( |
||
| 1528 | 'description' => __( 'Tax total.', 'woocommerce' ), |
||
| 1529 | 'type' => 'string', |
||
| 1530 | 'context' => array( 'view', 'edit' ), |
||
| 1531 | 'readonly' => true, |
||
| 1532 | ), |
||
| 1533 | 'subtotal' => array( |
||
| 1534 | 'description' => __( 'Tax subtotal.', 'woocommerce' ), |
||
| 1535 | 'type' => 'string', |
||
| 1536 | 'context' => array( 'view', 'edit' ), |
||
| 1537 | 'readonly' => true, |
||
| 1538 | ), |
||
| 1539 | ), |
||
| 1540 | ), |
||
| 1541 | ), |
||
| 1542 | 'meta_data' => array( |
||
| 1543 | 'description' => __( 'Meta data.', 'woocommerce' ), |
||
| 1544 | 'type' => 'array', |
||
| 1545 | 'context' => array( 'view', 'edit' ), |
||
| 1546 | 'items' => array( |
||
| 1547 | 'type' => 'object', |
||
| 1548 | 'properties' => array( |
||
| 1549 | 'id' => array( |
||
| 1550 | 'description' => __( 'Meta ID.', 'woocommerce' ), |
||
| 1551 | 'type' => 'integer', |
||
| 1552 | 'context' => array( 'view', 'edit' ), |
||
| 1553 | 'readonly' => true, |
||
| 1554 | ), |
||
| 1555 | 'key' => array( |
||
| 1556 | 'description' => __( 'Meta key.', 'woocommerce' ), |
||
| 1557 | 'type' => 'string', |
||
| 1558 | 'context' => array( 'view', 'edit' ), |
||
| 1559 | ), |
||
| 1560 | 'value' => array( |
||
| 1561 | 'description' => __( 'Meta value.', 'woocommerce' ), |
||
| 1562 | 'type' => 'mixed', |
||
| 1563 | 'context' => array( 'view', 'edit' ), |
||
| 1564 | ), |
||
| 1565 | ), |
||
| 1566 | ), |
||
| 1567 | ), |
||
| 1568 | ), |
||
| 1569 | ), |
||
| 1570 | ), |
||
| 1571 | 'coupon_lines' => array( |
||
| 1572 | 'description' => __( 'Coupons line data.', 'woocommerce' ), |
||
| 1573 | 'type' => 'array', |
||
| 1574 | 'context' => array( 'view', 'edit' ), |
||
| 1575 | 'items' => array( |
||
| 1576 | 'type' => 'object', |
||
| 1577 | 'properties' => array( |
||
| 1578 | 'id' => array( |
||
| 1579 | 'description' => __( 'Item ID.', 'woocommerce' ), |
||
| 1580 | 'type' => 'integer', |
||
| 1581 | 'context' => array( 'view', 'edit' ), |
||
| 1582 | 'readonly' => true, |
||
| 1583 | ), |
||
| 1584 | 'code' => array( |
||
| 1585 | 'description' => __( 'Coupon code.', 'woocommerce' ), |
||
| 1586 | 'type' => 'mixed', |
||
| 1587 | 'context' => array( 'view', 'edit' ), |
||
| 1588 | ), |
||
| 1589 | 'discount' => array( |
||
| 1590 | 'description' => __( 'Discount total.', 'woocommerce' ), |
||
| 1591 | 'type' => 'string', |
||
| 1592 | 'context' => array( 'view', 'edit' ), |
||
| 1593 | ), |
||
| 1594 | 'discount_tax' => array( |
||
| 1595 | 'description' => __( 'Discount total tax.', 'woocommerce' ), |
||
| 1596 | 'type' => 'string', |
||
| 1597 | 'context' => array( 'view', 'edit' ), |
||
| 1598 | 'readonly' => true, |
||
| 1599 | ), |
||
| 1600 | 'meta_data' => array( |
||
| 1601 | 'description' => __( 'Meta data.', 'woocommerce' ), |
||
| 1602 | 'type' => 'array', |
||
| 1603 | 'context' => array( 'view', 'edit' ), |
||
| 1604 | 'items' => array( |
||
| 1605 | 'type' => 'object', |
||
| 1606 | 'properties' => array( |
||
| 1607 | 'id' => array( |
||
| 1608 | 'description' => __( 'Meta ID.', 'woocommerce' ), |
||
| 1609 | 'type' => 'integer', |
||
| 1610 | 'context' => array( 'view', 'edit' ), |
||
| 1611 | 'readonly' => true, |
||
| 1612 | ), |
||
| 1613 | 'key' => array( |
||
| 1614 | 'description' => __( 'Meta key.', 'woocommerce' ), |
||
| 1615 | 'type' => 'string', |
||
| 1616 | 'context' => array( 'view', 'edit' ), |
||
| 1617 | ), |
||
| 1618 | 'value' => array( |
||
| 1619 | 'description' => __( 'Meta value.', 'woocommerce' ), |
||
| 1620 | 'type' => 'mixed', |
||
| 1621 | 'context' => array( 'view', 'edit' ), |
||
| 1622 | ), |
||
| 1623 | ), |
||
| 1624 | ), |
||
| 1625 | ), |
||
| 1626 | ), |
||
| 1627 | ), |
||
| 1628 | ), |
||
| 1629 | 'refunds' => array( |
||
| 1630 | 'description' => __( 'List of refunds.', 'woocommerce' ), |
||
| 1631 | 'type' => 'array', |
||
| 1632 | 'context' => array( 'view', 'edit' ), |
||
| 1633 | 'readonly' => true, |
||
| 1634 | 'items' => array( |
||
| 1635 | 'type' => 'object', |
||
| 1636 | 'properties' => array( |
||
| 1637 | 'id' => array( |
||
| 1638 | 'description' => __( 'Refund ID.', 'woocommerce' ), |
||
| 1639 | 'type' => 'integer', |
||
| 1640 | 'context' => array( 'view', 'edit' ), |
||
| 1641 | 'readonly' => true, |
||
| 1642 | ), |
||
| 1643 | 'reason' => array( |
||
| 1644 | 'description' => __( 'Refund reason.', 'woocommerce' ), |
||
| 1645 | 'type' => 'string', |
||
| 1646 | 'context' => array( 'view', 'edit' ), |
||
| 1647 | 'readonly' => true, |
||
| 1648 | ), |
||
| 1649 | 'total' => array( |
||
| 1650 | 'description' => __( 'Refund total.', 'woocommerce' ), |
||
| 1651 | 'type' => 'string', |
||
| 1652 | 'context' => array( 'view', 'edit' ), |
||
| 1653 | 'readonly' => true, |
||
| 1654 | ), |
||
| 1655 | ), |
||
| 1656 | ), |
||
| 1657 | ), |
||
| 1658 | 'set_paid' => array( |
||
| 1659 | 'description' => __( 'Define if the order is paid. It will set the status to processing and reduce stock items.', 'woocommerce' ), |
||
| 1660 | 'type' => 'boolean', |
||
| 1661 | 'default' => false, |
||
| 1662 | 'context' => array( 'edit' ), |
||
| 1663 | ), |
||
| 1664 | ), |
||
| 1665 | ); |
||
| 1666 | |||
| 1667 | return $this->add_additional_fields_schema( $schema ); |
||
| 1668 | } |
||
| 1709 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths