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