Plugin Directory

Changeset 3317812


Ignore:
Timestamp:
06/25/2025 05:41:44 PM (9 months ago)
Author:
bitsstech
Message:

new version

Location:
shipment-tracker-for-woocommerce/trunk
Files:
10 added
47 edited

Legend:

Unmodified
Added
Removed
  • shipment-tracker-for-woocommerce/trunk/README.txt

    r3292239 r3317812  
    4343Eliminate the need for multiple plugins with our Swiss army knife for shipment tracking. Manage everything in one place.
    4444
    45 ### Inbuilt SMS and Email Functionality
     45### Inbuilt SMS, WhatsApp and Email Functionality
    4646
    4747Send tracking updates directly to your customers via SMS and email.
     
    7373   
    7474
    75 -   **SMS & Email Notifications:**
     75-   **SMS, WhatsApp & Email Notifications:**
    7676   
    7777
    7878     >-   **Easily integrates with WooCommerce's default email** system to provide real-time tracking updates.
    7979   
    80     >-   **Send tracking updates** via SMS, Email, or WhatsApp (coming soon).
     80    >-   **Send tracking updates** via SMS, Email, or WhatsApp.
    8181   
    8282    >-   Global SMS service availability.
     
    4144149.  Custom development assistance.
    415415
    416 10.  Priority phone and ticket based support.
     41610. Priority phone and ticket based support.
     417
     41811. Branded SMS & WhatsApp messaging.
    417419
    418420## Compatibility
  • shipment-tracker-for-woocommerce/trunk/admin/js/bt-sync-shipment-tracking-admin.js

    r3308462 r3317812  
    11681168        var checkbox2 = document.getElementById('checkbox2');
    11691169        var mobile_no = document.getElementById('register_mobile_number').value;
    1170         if (!checkbox1.checked || !checkbox2.checked || mobile_no === '') {
    1171             alert('Please check both checkboxes to proceed and enter your mobile number.');
     1170        if (mobile_no === '') {
     1171            alert('Please enter your mobile number to proceed.');
    11721172        }
    11731173        else {
     
    12651265    $(document).on('submit', '#bt_buy_sms_form', function (e) {
    12661266        var qty = $('#bt_sms_input_credits_buy').val();
    1267         if (qty < 2000) {
     1267        if (qty < 1000) {
    12681268            e.preventDefault();
    1269             alert("Minimum purchase of 2000 credits are required.");
     1269            alert("Minimum purchase of 1000 credits are required.");
    12701270        }
    12711271
  • shipment-tracker-for-woocommerce/trunk/admin/partials/bt-st-buy-credits-popup.php

    r3299743 r3317812  
    3232                                            <input type="hidden" name="apikey"  value="<?php echo esc_html($api); ?>" />     
    3333                                            <p class="is-size-6" for="quantity">No. of Credits:</p>
    34                                             <input id="bt_sms_input_credits_buy" value="" class="input is-medium mb-2" required type="number" name="quantity" maxlength="7" min="2000" max="200000" placeholder="Enter quantity"/><br>
     34                                            <input id="bt_sms_input_credits_buy" value="" class="input is-medium mb-2" required type="number" name="quantity" maxlength="7" min="1000" max="200000" placeholder="Enter quantity"/><br>
    3535                                            <p class="is-size-6" >Price per Credit:</p>
    3636                                            <p id="bt_sms_price_per_credit" class="is-size-5 pb-2" >-</p>
  • shipment-tracker-for-woocommerce/trunk/bt-sync-shipment-tracking.php

    r3308462 r3317812  
    1717 * Plugin URI:        https://shipment-tracker-for-woocommerce.bitss.tech/
    1818 * Description:       Most comprehensive shipment tracking plugin that extends your woocommerce store with shipment related features. Keeps you & your customers informed about shipment movement.
    19  * Version:           1.4.24.15
     19 * Version:           1.4.24.16
    2020 * Author:            Bitss Techniques
    2121 * Author URI:        https://shipment-tracker-for-woocommerce.bitss.tech
     
    5959
    6060define( 'Carbon_Fields\URL', trailingslashit( plugin_dir_url( __FILE__ ) ) . 'vendor/htmlburger/carbon-fields/' );//fix for Bitnami installations.
    61 define( 'BT_SYNC_SHIPMENT_TRACKING_VERSION', '1.4.24.15' );
     61define( 'BT_SYNC_SHIPMENT_TRACKING_VERSION', '1.4.24.16' );
    6262define( 'BT_SHIPPING_PROVIDERS', array('delhivery' =>'Delhivery','nimbuspost' => 'Nimbuspost (Deprecated)','nimbuspost_new' => 'Nimbuspost','shipmozo'=>'Shipmozo','shiprocket' => 'Shiprocket', 'xpressbees' => 'Xpressbees', 'manual' =>'Custom Shipping') );
    6363define( 'BT_SHIPPING_PROVIDERS_WITH_NONE', array('none' =>'none','delhivery' =>'Delhivery', 'nimbuspost' => 'Nimbuspost (OLD)','nimbuspost_new' => 'Nimbuspost(NEW)','shipmozo'=>'Shipmozo','shiprocket' => 'Shiprocket', 'xpressbees' => 'Xpressbees','manual' =>'Custom Shipping') );
  • shipment-tracker-for-woocommerce/trunk/composer.lock

    r3292239 r3317812  
    99        {
    1010            "name": "htmlburger/carbon-fields",
    11             "version": "v3.6.6",
     11            "version": "v3.6.9",
    1212            "source": {
    1313                "type": "git",
    1414                "url": "https://github.com/htmlburger/carbon-fields.git",
    15                 "reference": "9cb536e775f3c0688e18fca39445326521197220"
     15                "reference": "f82e80e3e3469d6e86cc17a8950b918ad448a059"
    1616            },
    1717            "dist": {
    1818                "type": "zip",
    19                 "url": "https://api.github.com/repos/htmlburger/carbon-fields/zipball/9cb536e775f3c0688e18fca39445326521197220",
    20                 "reference": "9cb536e775f3c0688e18fca39445326521197220",
     19                "url": "https://api.github.com/repos/htmlburger/carbon-fields/zipball/f82e80e3e3469d6e86cc17a8950b918ad448a059",
     20                "reference": "f82e80e3e3469d6e86cc17a8950b918ad448a059",
    2121                "shasum": ""
    2222            },
     
    145145                "source": "https://github.com/htmlburger/carbon-fields"
    146146            },
    147             "time": "2025-04-17T11:56:23+00:00"
     147            "time": "2025-06-11T11:23:23+00:00"
    148148        },
    149149        {
    150150            "name": "php-units-of-measure/php-units-of-measure",
    151             "version": "v2.1.0",
     151            "version": "v2.2.0",
    152152            "source": {
    153153                "type": "git",
    154154                "url": "https://github.com/PhpUnitsOfMeasure/php-units-of-measure.git",
    155                 "reference": "25f476e9c50e11af8cf044d22ffc271c96aa5248"
     155                "reference": "cf1b83b1ef7615dd53f70864c9e7f496b1ec0fd1"
    156156            },
    157157            "dist": {
    158158                "type": "zip",
    159                 "url": "https://api.github.com/repos/PhpUnitsOfMeasure/php-units-of-measure/zipball/25f476e9c50e11af8cf044d22ffc271c96aa5248",
    160                 "reference": "25f476e9c50e11af8cf044d22ffc271c96aa5248",
     159                "url": "https://api.github.com/repos/PhpUnitsOfMeasure/php-units-of-measure/zipball/cf1b83b1ef7615dd53f70864c9e7f496b1ec0fd1",
     160                "reference": "cf1b83b1ef7615dd53f70864c9e7f496b1ec0fd1",
    161161                "shasum": ""
    162162            },
    163163            "require": {
    164                 "php": ">=5.4.0"
     164                "php": ">=7.4"
    165165            },
    166166            "replace": {
     
    168168            },
    169169            "require-dev": {
    170                 "phpunit/phpunit": "4.8.*",
    171                 "squizlabs/php_codesniffer": "2.2.*"
     170                "phpunit/phpunit": "^9.5",
     171                "squizlabs/php_codesniffer": "^3.7"
    172172            },
    173173            "type": "library",
     
    184184                {
    185185                    "name": "Jonathan Hanson",
    186                     "email": "[email protected]",
    187                     "homepage": "http://www.jonathan-hanson.org/",
    188186                    "role": "Developer"
    189187                }
     
    197195            ],
    198196            "support": {
    199                 "email": "[email protected]",
    200197                "issues": "https://github.com/PhpUnitsOfMeasure/php-units-of-measure/issues",
    201198                "source": "https://github.com/PhpUnitsOfMeasure/php-units-of-measure"
    202199            },
    203             "time": "2016-07-24T22:36:00+00:00"
     200            "time": "2025-04-30T23:02:43+00:00"
    204201        }
    205202    ],
     
    212209    "platform": [],
    213210    "platform-dev": [],
    214     "plugin-api-version": "2.3.0"
     211    "plugin-api-version": "2.6.0"
    215212}
  • shipment-tracker-for-woocommerce/trunk/includes/class-bt-sync-shipment-tracking.php

    r3308462 r3317812  
    645645        if(empty($api)){
    646646            $register_for_sms_form = '
    647              <div class="is-overlay" style="background: #202020d4;">
    648                 <div class="container" style="display: flex; flex-direction: column; align-items: center;justify-content: center;height:100%;">
    649                     <div class="field is-horizontal" style="width: 100%; max-width: 600px;">
    650                         <div class="field-body" style="width: 100%;">
    651                             <div class="field" style="width: 100%;">
    652                                 <div class="control">
    653                                     <label class="checkbox" style="width: 100%; color: white;font-size:12px;">
    654                                         <input type="checkbox" id="checkbox1">
    655                                         I agree to the terms & conditions and authorize "Bitss Techniques" to send SMS/WhatsApp on my behalf.
    656                                     </label>
    657                                 </div>
     647            <div class="is-overlay" style="background:rgba(0, 0, 0, 0.80);">
     648            <div class="panel is-info" style="background-color:white;max-width: 600px; margin: -10px auto;">
     649                <p class="panel-heading">
     650                    Register for SMS/WhatsApp Messaging
     651                </p>
     652                <div class="panel-block" style="flex-direction: column; align-items: stretch;">
     653                    <div class="panel-block" style="flex-direction: column; align-items: stretch;">
     654                        <div class="notification is-info is-light mb-3" style="font-size: 15px;">
     655                            <strong>Why Register?</strong>
     656                            <ul style="margin-left: 1.2em; list-style: disc; font-size: 14px;">
     657                                <li>Enable SMS & WhatsApp order updates for your customers</li>
     658                                <li>Reduce support queries & improve satisfaction</li>
     659                                <li>Quick, free registration</li>
     660                            </ul>
     661                        </div>
     662                        <div class="field is-grouped" style="width:100%;">
     663                            <p class="control is-expanded">
     664                            <input style="display:none" checked="checked" type="checkbox" id="checkbox1">
     665                            <input style="display:none" checked="checked" type="checkbox" id="checkbox2">
     666
     667                                <input type="text" id="register_mobile_number" class="input is-medium" placeholder="Mobile number with country code" style="height: 44px;">
     668                            </p>
     669                            <p class="control">
     670                                <button type="button" class="button is-info is-medium" id="register_get_api_key" style="height: 44px;">
     671                                    Register
     672                                </button>
     673                            </p>
     674                        </div>
     675                        <div id="register_get_api_key_test_connection_modal" class="modal">
     676                            <div class="modal-background"></div>
     677                            <div class="modal-card">
     678                                <header class="modal-card-head">
     679                                    <p id="register_get_api_key_tc-m-content" class="modal-content"></p>
     680                                </header>
    658681                            </div>
    659682                        </div>
    660                     </div>
    661                     <div class="field is-horizontal" style="width: 100%; max-width: 600px;">
    662                         <div class="field-body" style="width: 100%;">
    663                             <div class="field" style="width: 100%;">
    664                                 <div class="control">
    665                                     <label class="checkbox" style="width: 100%; color: white;font-size:12px;">
    666                                         <input type="checkbox" id="checkbox2">
    667                                         I understand that misuse of the service will lead to immediate termination of account.
    668                                     </label>
    669                                 </div>
    670                             </div>
     683                        <div class="panel-block" style="font-size:12px; margin-top: 8px;">
     684                            By registering, you authorize Bitss Techniques to send SMS/WhatsApp on your behalf. Misuse will lead to termination.
    671685                        </div>
    672686                    </div>
    673                     <div class="field is-horizontal" style="width: 100%; max-width: 600px; text-align: center;">
    674                         <div class="field-body" style="width: 100%;">
    675                             <div class="field" style="width: 100%;">
    676                                 <div class="control">
    677                                     <input type="text" id="register_mobile_number" class="p-2" style="font-size: 16px;" placeholder="Enter mobile number">
    678                                     <button type="button" class=" button is-medium" id="register_get_api_key" style="" >
    679                                         Click Here to Register for SMS/WhatsApp
    680                                     </button>
    681                                     <div id="register_get_api_key_test_connection_modal" class="modal">
    682                                         <div class="modal-background"></div>
    683                                             <div class="modal-card">
    684                                                 <header class="modal-card-head">
    685                                                     <p id="register_get_api_key_tc-m-content" class="modal-content"></p>
    686                                                
    687                                                     </header>
    688                                             </div>
    689                                     </div>
    690                                 </div>
    691                             </div>
    692                         </div>
    693687                    </div>
    694688                </div>
     689            </div>
    695690            </div>
    696691            ';
     
    801796                                                    <div class="control">
    802797                                                        <button type="button" class=" button is-medium" id="get_sms_trial" style="width: 100%;" >
    803                                                             Send SMS
     798                                                            Send
    804799                                                        </button>
    805800                                                        <div id="get_sms_trial_test_connection_modal" class="modal">
     
    817812                                            </div>
    818813                                     </div>
    819                                     <p class="help is-info">Enter your mobile number with country code. Eg: +91 94622 42982 <br>We will send an sms of selected event to your mobile number.<br>
    820                                     Supported Countries: <b>All</b></p>
     814                                    <p class="help is-info">Enter your mobile number with country code. Eg: +91 94622 42982 <br>
     815                                    Upgrade to Premium to send SMS Messages using your own brand name. <br>
     816                                    Supported Countries: <b>All</b><br>
     817                                   
     818                                    </p>
    821819                     </div>
    822820                ' ),
     
    845843                                                    <div class="control">
    846844                                                        <button type="button" class=" button is-medium" id="get_whatsapp_trial" style="width: 100%;" >
    847                                                             Send WhatsApp
     845                                                            Send
    848846                                                        </button>
    849847                                                        <div id="get_whatsapp_trial_test_connection_modal" class="modal">
     
    861859                                            </div>
    862860                                     </div>
    863                                     <p class="help is-info">Enter your mobile number with country code. Eg: +91 94622 42982 <br>We will send an WhatsApp of selected event to your mobile number.<br>
     861                                    <p class="help is-info">Enter your mobile number with country code. Eg: +91 94622 42982 <br>
     862                                    Upgrade to Premium to Send WhatsApp messages using your own brand name. <br>
    864863                                    Supported Countries: <b>All</b></p>
    865864                     </div>
     
    910909                            <h3 class="title is-5">Note:</h3>
    911910                            <h4 class="title is-6">SMS/WhatsApp are chargeable and requires registration. You can buy messaging credits from within this plugin.</h4>
    912                             <h4 class="title is-6">Sms/WhatsApp messages are sent using pre-approved, co-branded DLT/Meta templates. For sending fully branded sms using your sender id, <a target="_blank" href="https://billing.bitss.tech/index.php?fuse=support&controller=ticket&view=submitticket">pls raise a support ticket</a>.</h4>
     911                            <h4 class="title is-6">SMS/WhatsApp messages are sent using pre-approved, co-branded DLT/Meta templates. For sending fully branded sms using your brand name, upgrade to Premium & then <a target="_blank" href="https://billing.bitss.tech/index.php?fuse=support&controller=ticket&view=submitticket">pls raise a support ticket</a>.</h4>
    913912                            <h4 class="title is-6">Need a Full Featured SMS Panel for advanced SMS Messaging? <a target="_blank" href="https://smsapi.bitss.tech">Signup here for fast, reliable & cost effective sms service.</a></h4>
    914913                            <h4 class="title is-6">Emails are free and are sent using your own server. Email template can be customized from <a target="_blank"  href="/wp-admin/admin.php?page=wc-settings&tab=email&section=bt_sst_wc_shipment_email">woocommerce email settings</a>.</h4>
  • shipment-tracker-for-woocommerce/trunk/public/class-bt-sync-shipment-tracking-public.php

    r3308462 r3317812  
    357357    }
    358358
     359    function getDaysDifferenceFromToday($date)
     360    {
     361        try {
     362            // Attempt to create DateTime object from the input
     363            $givenDate = new DateTime($date);
     364            $currentDate = new DateTime();
     365
     366            $interval = $currentDate->diff($givenDate);
     367            return (int)$interval->format('%r%a'); // returns signed number of days
     368        } catch (Exception $e) {
     369            // Handle invalid date format
     370            return null; // or you could return a specific error message or code
     371        }
     372    }
     373
    359374    function addDayswithdate($date, $days)
    360375    {
     
    10561071            $shippingTimeline = ob_get_clean();
    10571072
     1073            $edd_variables = array(
     1074                'bt_sst_message_text_template' => $bt_sst_message_text_template,
     1075                'min_date' => $min_date,
     1076                'max_date' => $max_date,
     1077                'delivery_pincode' => $delivery_pincode,
     1078                'city' => $city,
     1079                'min_date_charges' => $min_date_charges,
     1080                'max_date_charges' => $max_date_charges,
     1081                'cut_off_time' => $cut_of_time,
     1082                'processing_time' => $processing_time,
     1083                'shipping_timeline_html' => $shippingTimeline
     1084            );
     1085
     1086            $edd_variables = apply_filters('bt_edd_variables', $edd_variables,$product_id );
     1087
     1088            $bt_sst_message_text_template = $edd_variables['bt_sst_message_text_template'];
     1089            $min_date = $edd_variables['min_date'];
     1090            $max_date = $edd_variables['max_date'];
     1091            $delivery_pincode = $edd_variables['delivery_pincode'];
     1092            $city = $edd_variables['city'];
     1093            $min_date_charges = $edd_variables['min_date_charges'];
     1094            $max_date_charges = $edd_variables['max_date_charges'];
     1095            $cut_of_time = $edd_variables['cut_off_time'];
     1096            $processing_time = $edd_variables['processing_time'];
     1097            $shippingTimeline = $edd_variables['shipping_timeline_html'];
     1098
     1099
     1100
    10581101            $message_text_template = $this->update_message_text_template($bt_sst_message_text_template, $min_date, $max_date, $delivery_pincode, $city, $min_date_charges, $max_date_charges, $cut_of_time, $edit_postcode, $processing_time, $shippingTimeline);
     1102
     1103            $message_text_template = apply_filters('bt_edd_message_text', $message_text_template, $edd_variables , $product_id);
    10591104
    10601105            $response = array(
     
    14151460                $WC_Shipping_Rate->add_meta_data('bt_sst_courier_company_name', $courier_name);
    14161461                $WC_Shipping_Rate->add_meta_data('bt_sst_shipment_provider', 'generic');
    1417 
     1462                $bt_sst_shipping_duration_days = 1;
     1463                $WC_Shipping_Rate->add_meta_data('bt_sst_shipping_duration_days', $bt_sst_shipping_duration_days);
    14181464                $rates[$id] = $WC_Shipping_Rate;
    14191465            }
     
    15201566                        $WC_Shipping_Rate->set_cost($cost);
    15211567                        $WC_Shipping_Rate->set_instance_id($id);
     1568                        $bt_sst_shipping_duration_days = 4; // set default of 4 days
     1569                        $WC_Shipping_Rate->add_meta_data('bt_sst_shipping_duration_days', $bt_sst_shipping_duration_days);
     1570                       
    15221571                        // $WC_Shipping_Rate->set_taxes($texes);
    15231572
     
    15591608                        $delivery_date = '';
    15601609                        $show_delivery_date = carbon_get_theme_option("bt_sst_show_delivery_date");
     1610                        $bt_sst_shipping_duration_days = null;
    15611611                        if ($show_delivery_date == 1) {
    15621612                            $processing_days = $this->bt_get_processing_days();//first try to get at product or category level.
     
    15701620                            }
    15711621                            $d = $this->addDayswithdate($rb['etd'], $processing_days);
     1622                            $bt_sst_shipping_duration_days = $this->getDaysDifferenceFromToday($rb['etd']);
    15721623                            $delivery_date = " (Edd: " . $d . ")";
    15731624                        }
     
    15851636                        $WC_Shipping_Rate->add_meta_data('bt_sst_sr_courier_company_name', $rb['courier_name']);
    15861637                        $WC_Shipping_Rate->add_meta_data('bt_sst_shipment_provider', 'shiprocket');
    1587 
     1638                        $WC_Shipping_Rate->add_meta_data('bt_sst_shipping_duration_days', $bt_sst_shipping_duration_days);
    15881639                        $rates[$id] = $WC_Shipping_Rate;
    15891640                    }
     
    16101661                        $delivery_date = '';
    16111662                        $show_delivery_date = carbon_get_theme_option("bt_sst_show_delivery_date");
     1663                        $bt_sst_shipping_duration_days = null;
    16121664                        if ($show_delivery_date == 1) {
    16131665                            $processing_days = carbon_get_theme_option("bt_sst_shipment_processing_days");
     
    16181670                            $min_date = explode("-", $etd)[0];
    16191671                            $max_date = explode("-", $etd)[1];
    1620 
     1672                            $bt_sst_shipping_duration_days = $this->getDaysDifferenceFromToday($min_date);
    16211673                            $min_date = $this->addDayswithdate($min_date, $processing_days);
    16221674                            $max_date = $this->addDayswithdate($max_date, $processing_days);
     
    16361688                        $WC_Shipping_Rate->add_meta_data('bt_sst_sr_courier_company_name', $rb['courier_name']);
    16371689                        $WC_Shipping_Rate->add_meta_data('bt_sst_shipment_provider', 'shiprocket');
    1638 
     1690                        $WC_Shipping_Rate->add_meta_data('bt_sst_shipping_duration_days', $bt_sst_shipping_duration_days);
    16391691                        $rates[$id] = $WC_Shipping_Rate;
    16401692                    }
     
    17281780                        $WC_Shipping_Rate->set_cost($cost);
    17291781                        $WC_Shipping_Rate->set_instance_id($id);
     1782                        $bt_sst_shipping_duration_days = 4; // set default of 4 days
     1783                        $WC_Shipping_Rate->add_meta_data('bt_sst_shipping_duration_days', $bt_sst_shipping_duration_days);
    17301784                        // $WC_Shipping_Rate->set_taxes($texes);
    17311785
     
    17631817                        $delivery_date = '';
    17641818                        $show_delivery_date = carbon_get_theme_option("bt_sst_show_delivery_date");
     1819                        $bt_sst_shipping_duration_days = null; // set default of 4 days
    17651820                        if ($show_delivery_date == 1) {
    17661821                            $processing_days = $this->bt_get_processing_days();//first try to get at product or category level.
     
    17771832                            preg_match('/\d+/', $input, $matches);
    17781833                            $days = intval($matches[0]);
     1834                            $bt_sst_shipping_duration_days = $days;
    17791835                            $interval = new DateInterval("P{$days}D");
    17801836                            $currentDate->add($interval);
     
    17961852                        $WC_Shipping_Rate->set_instance_id($id);
    17971853                        $WC_Shipping_Rate->set_taxes($texes);
     1854                       
     1855                        $WC_Shipping_Rate->add_meta_data('bt_sst_shipping_duration_days', $bt_sst_shipping_duration_days);
    17981856                        $WC_Shipping_Rate->add_meta_data('bt_sst_courier_company_id', $rb['id']);
    17991857                        $WC_Shipping_Rate->add_meta_data('bt_sst_courier_company_name', $rb['name']);
     
    18931951                        $WC_Shipping_Rate->set_instance_id($id);
    18941952                        // $WC_Shipping_Rate->set_taxes($texes);
    1895 
     1953                        $bt_sst_shipping_duration_days = 4; // set default of 4 days
     1954                        $WC_Shipping_Rate->add_meta_data('bt_sst_shipping_duration_days', $bt_sst_shipping_duration_days);
    18961955                        $rates[$id] = $WC_Shipping_Rate;
    18971956                    }
     
    19492008                        $WC_Shipping_Rate->set_instance_id($id);
    19502009                        $WC_Shipping_Rate->set_taxes($texes);
     2010                        $bt_sst_shipping_duration_days = 4; // set default of 4 days
     2011                        $WC_Shipping_Rate->add_meta_data('bt_sst_shipping_duration_days', $bt_sst_shipping_duration_days);
    19512012                        $WC_Shipping_Rate->add_meta_data('bt_sst_courier_company_id', $rb['id']);
    19522013                        $WC_Shipping_Rate->add_meta_data('bt_sst_courier_company_name', $rb['name']);
     
    20472108                        $WC_Shipping_Rate->set_cost($cost);
    20482109                        $WC_Shipping_Rate->set_instance_id($id);
     2110                        $bt_sst_shipping_duration_days = 4; // set default of 4 days
     2111                        $WC_Shipping_Rate->add_meta_data('bt_sst_shipping_duration_days', $bt_sst_shipping_duration_days);
    20492112                        // $WC_Shipping_Rate->set_taxes($texes);
    20502113
     
    20772140
    20782141                        $lable = "Delhivery " . ucfirst($rb['mode']);
     2142                        $bt_sst_shipping_duration_days = null;
    20792143                        if (isset($rb['tat']) && $rb['tat'] != null) {
    20802144                            $lable .= " / " . $rb['tat'] . ($rb['tat'] > 1 ? " days " : " day");
     2145                            $bt_sst_shipping_duration_days = $rb['tat'];
    20812146                        }
    20822147                        $id = 'flat_rate:delhivery:' . $rb['mode'];
     
    21242189                        $WC_Shipping_Rate->add_meta_data('bt_sst_courier_company_name', $lable);
    21252190                        $WC_Shipping_Rate->add_meta_data('bt_sst_shipment_provider', 'delhivery');
    2126 
     2191                        $WC_Shipping_Rate->add_meta_data('bt_sst_shipping_duration_days', $bt_sst_shipping_duration_days);
    21272192                        $rates[$id] = $WC_Shipping_Rate;
    21282193                    }
  • shipment-tracker-for-woocommerce/trunk/public/css/bt-sync-shipment-tracking-primery-template-form-2.css

    r3284690 r3317812  
    3333    height: unset;
    3434    line-height: unset;
     35    margin: 0;
    3536}
    3637
  • shipment-tracker-for-woocommerce/trunk/vendor/composer/ClassLoader.php

    r3267231 r3317812  
    4646    private static $includeFile;
    4747
    48     /** @var ?string */
     48    /** @var string|null */
    4949    private $vendorDir;
    5050
    5151    // PSR-4
    5252    /**
    53      * @var array[]
    54      * @psalm-var array<string, array<string, int>>
     53     * @var array<string, array<string, int>>
    5554     */
    5655    private $prefixLengthsPsr4 = array();
    5756    /**
    58      * @var array[]
    59      * @psalm-var array<string, array<int, string>>
     57     * @var array<string, list<string>>
    6058     */
    6159    private $prefixDirsPsr4 = array();
    6260    /**
    63      * @var array[]
    64      * @psalm-var array<string, string>
     61     * @var list<string>
    6562     */
    6663    private $fallbackDirsPsr4 = array();
     
    6865    // PSR-0
    6966    /**
    70      * @var array[]
    71      * @psalm-var array<string, array<string, string[]>>
     67     * List of PSR-0 prefixes
     68     *
     69     * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
     70     *
     71     * @var array<string, array<string, list<string>>>
    7272     */
    7373    private $prefixesPsr0 = array();
    7474    /**
    75      * @var array[]
    76      * @psalm-var array<string, string>
     75     * @var list<string>
    7776     */
    7877    private $fallbackDirsPsr0 = array();
     
    8281
    8382    /**
    84      * @var string[]
    85      * @psalm-var array<string, string>
     83     * @var array<string, string>
    8684     */
    8785    private $classMap = array();
     
    9189
    9290    /**
    93      * @var bool[]
    94      * @psalm-var array<string, bool>
     91     * @var array<string, bool>
    9592     */
    9693    private $missingClasses = array();
    9794
    98     /** @var ?string */
     95    /** @var string|null */
    9996    private $apcuPrefix;
    10097
    10198    /**
    102      * @var self[]
     99     * @var array<string, self>
    103100     */
    104101    private static $registeredLoaders = array();
    105102
    106103    /**
    107      * @param ?string $vendorDir
     104     * @param string|null $vendorDir
    108105     */
    109106    public function __construct($vendorDir = null)
     
    114111
    115112    /**
    116      * @return string[]
     113     * @return array<string, list<string>>
    117114     */
    118115    public function getPrefixes()
     
    126123
    127124    /**
    128      * @return array[]
    129      * @psalm-return array<string, array<int, string>>
     125     * @return array<string, list<string>>
    130126     */
    131127    public function getPrefixesPsr4()
     
    135131
    136132    /**
    137      * @return array[]
    138      * @psalm-return array<string, string>
     133     * @return list<string>
    139134     */
    140135    public function getFallbackDirs()
     
    144139
    145140    /**
    146      * @return array[]
    147      * @psalm-return array<string, string>
     141     * @return list<string>
    148142     */
    149143    public function getFallbackDirsPsr4()
     
    153147
    154148    /**
    155      * @return string[] Array of classname => path
    156      * @psalm-return array<string, string>
     149     * @return array<string, string> Array of classname => path
    157150     */
    158151    public function getClassMap()
     
    162155
    163156    /**
    164      * @param string[] $classMap Class to filename map
    165      * @psalm-param array<string, string> $classMap
     157     * @param array<string, string> $classMap Class to filename map
    166158     *
    167159     * @return void
     
    180172     * appending or prepending to the ones previously set for this prefix.
    181173     *
    182      * @param string          $prefix  The prefix
    183      * @param string[]|string $paths   The PSR-0 root directories
    184      * @param bool            $prepend Whether to prepend the directories
     174     * @param string              $prefix  The prefix
     175     * @param list<string>|string $paths   The PSR-0 root directories
     176     * @param bool                $prepend Whether to prepend the directories
    185177     *
    186178     * @return void
     
    188180    public function add($prefix, $paths, $prepend = false)
    189181    {
     182        $paths = (array) $paths;
    190183        if (!$prefix) {
    191184            if ($prepend) {
    192185                $this->fallbackDirsPsr0 = array_merge(
    193                     (array) $paths,
     186                    $paths,
    194187                    $this->fallbackDirsPsr0
    195188                );
     
    197190                $this->fallbackDirsPsr0 = array_merge(
    198191                    $this->fallbackDirsPsr0,
    199                     (array) $paths
     192                    $paths
    200193                );
    201194            }
     
    206199        $first = $prefix[0];
    207200        if (!isset($this->prefixesPsr0[$first][$prefix])) {
    208             $this->prefixesPsr0[$first][$prefix] = (array) $paths;
     201            $this->prefixesPsr0[$first][$prefix] = $paths;
    209202
    210203            return;
     
    212205        if ($prepend) {
    213206            $this->prefixesPsr0[$first][$prefix] = array_merge(
    214                 (array) $paths,
     207                $paths,
    215208                $this->prefixesPsr0[$first][$prefix]
    216209            );
     
    218211            $this->prefixesPsr0[$first][$prefix] = array_merge(
    219212                $this->prefixesPsr0[$first][$prefix],
    220                 (array) $paths
     213                $paths
    221214            );
    222215        }
     
    227220     * appending or prepending to the ones previously set for this namespace.
    228221     *
    229      * @param string          $prefix  The prefix/namespace, with trailing '\\'
    230      * @param string[]|string $paths   The PSR-4 base directories
    231      * @param bool            $prepend Whether to prepend the directories
     222     * @param string              $prefix  The prefix/namespace, with trailing '\\'
     223     * @param list<string>|string $paths   The PSR-4 base directories
     224     * @param bool                $prepend Whether to prepend the directories
    232225     *
    233226     * @throws \InvalidArgumentException
     
    237230    public function addPsr4($prefix, $paths, $prepend = false)
    238231    {
     232        $paths = (array) $paths;
    239233        if (!$prefix) {
    240234            // Register directories for the root namespace.
    241235            if ($prepend) {
    242236                $this->fallbackDirsPsr4 = array_merge(
    243                     (array) $paths,
     237                    $paths,
    244238                    $this->fallbackDirsPsr4
    245239                );
     
    247241                $this->fallbackDirsPsr4 = array_merge(
    248242                    $this->fallbackDirsPsr4,
    249                     (array) $paths
     243                    $paths
    250244                );
    251245            }
     
    257251            }
    258252            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
    259             $this->prefixDirsPsr4[$prefix] = (array) $paths;
     253            $this->prefixDirsPsr4[$prefix] = $paths;
    260254        } elseif ($prepend) {
    261255            // Prepend directories for an already registered namespace.
    262256            $this->prefixDirsPsr4[$prefix] = array_merge(
    263                 (array) $paths,
     257                $paths,
    264258                $this->prefixDirsPsr4[$prefix]
    265259            );
     
    268262            $this->prefixDirsPsr4[$prefix] = array_merge(
    269263                $this->prefixDirsPsr4[$prefix],
    270                 (array) $paths
     264                $paths
    271265            );
    272266        }
     
    277271     * replacing any others previously set for this prefix.
    278272     *
    279      * @param string          $prefix The prefix
    280      * @param string[]|string $paths  The PSR-0 base directories
     273     * @param string              $prefix The prefix
     274     * @param list<string>|string $paths  The PSR-0 base directories
    281275     *
    282276     * @return void
     
    295289     * replacing any others previously set for this namespace.
    296290     *
    297      * @param string          $prefix The prefix/namespace, with trailing '\\'
    298      * @param string[]|string $paths  The PSR-4 base directories
     291     * @param string              $prefix The prefix/namespace, with trailing '\\'
     292     * @param list<string>|string $paths  The PSR-4 base directories
    299293     *
    300294     * @throws \InvalidArgumentException
     
    430424    {
    431425        if ($file = $this->findFile($class)) {
    432             (self::$includeFile)($file);
     426            $includeFile = self::$includeFile;
     427            $includeFile($file);
    433428
    434429            return true;
     
    481476
    482477    /**
    483      * Returns the currently registered loaders indexed by their corresponding vendor directories.
    484      *
    485      * @return self[]
     478     * Returns the currently registered loaders keyed by their corresponding vendor directories.
     479     *
     480     * @return array<string, self>
    486481     */
    487482    public static function getRegisteredLoaders()
     
    561556    }
    562557
    563     private static function initializeIncludeClosure(): void
     558    /**
     559     * @return void
     560     */
     561    private static function initializeIncludeClosure()
    564562    {
    565563        if (self::$includeFile !== null) {
     
    575573         * @return void
    576574         */
    577         self::$includeFile = static function($file) {
     575        self::$includeFile = \Closure::bind(static function($file) {
    578576            include $file;
    579         };
     577        }, null, null);
    580578    }
    581579}
  • shipment-tracker-for-woocommerce/trunk/vendor/composer/InstalledVersions.php

    r3267231 r3317812  
    9999        foreach (self::getInstalled() as $installed) {
    100100            if (isset($installed['versions'][$packageName])) {
    101                 return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
     101                return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
    102102            }
    103103        }
     
    120120    public static function satisfies(VersionParser $parser, $packageName, $constraint)
    121121    {
    122         $constraint = $parser->parseConstraints($constraint);
     122        $constraint = $parser->parseConstraints((string) $constraint);
    123123        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
    124124
     
    329329                    $installed[] = self::$installedByVendor[$vendorDir];
    330330                } elseif (is_file($vendorDir.'/composer/installed.php')) {
    331                     $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
     331                    /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
     332                    $required = require $vendorDir.'/composer/installed.php';
     333                    $installed[] = self::$installedByVendor[$vendorDir] = $required;
    332334                    if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    333335                        self::$installed = $installed[count($installed) - 1];
     
    341343            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
    342344            if (substr(__DIR__, -8, 1) !== 'C') {
    343                 self::$installed = require __DIR__ . '/installed.php';
     345                /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
     346                $required = require __DIR__ . '/installed.php';
     347                self::$installed = $required;
    344348            } else {
    345349                self::$installed = array();
    346350            }
    347351        }
    348         $installed[] = self::$installed;
     352
     353        if (self::$installed !== array()) {
     354            $installed[] = self::$installed;
     355        }
    349356
    350357        return $installed;
  • shipment-tracker-for-woocommerce/trunk/vendor/composer/installed.json

    r3284690 r3317812  
    33        {
    44            "name": "htmlburger/carbon-fields",
    5             "version": "v3.6.6",
    6             "version_normalized": "3.6.6.0",
     5            "version": "v3.6.9",
     6            "version_normalized": "3.6.9.0",
    77            "source": {
    88                "type": "git",
    99                "url": "https://github.com/htmlburger/carbon-fields.git",
    10                 "reference": "9cb536e775f3c0688e18fca39445326521197220"
     10                "reference": "f82e80e3e3469d6e86cc17a8950b918ad448a059"
    1111            },
    1212            "dist": {
    1313                "type": "zip",
    14                 "url": "https://api.github.com/repos/htmlburger/carbon-fields/zipball/9cb536e775f3c0688e18fca39445326521197220",
    15                 "reference": "9cb536e775f3c0688e18fca39445326521197220",
     14                "url": "https://api.github.com/repos/htmlburger/carbon-fields/zipball/f82e80e3e3469d6e86cc17a8950b918ad448a059",
     15                "reference": "f82e80e3e3469d6e86cc17a8950b918ad448a059",
    1616                "shasum": ""
    1717            },
     
    2424                "yoast/phpunit-polyfills": "^1.0"
    2525            },
    26             "time": "2025-04-17T11:56:23+00:00",
     26            "time": "2025-06-11T11:23:23+00:00",
    2727            "type": "library",
    2828            "installation-source": "dist",
     
    146146        {
    147147            "name": "php-units-of-measure/php-units-of-measure",
    148             "version": "v2.1.0",
    149             "version_normalized": "2.1.0.0",
     148            "version": "v2.2.0",
     149            "version_normalized": "2.2.0.0",
    150150            "source": {
    151151                "type": "git",
    152152                "url": "https://github.com/PhpUnitsOfMeasure/php-units-of-measure.git",
    153                 "reference": "25f476e9c50e11af8cf044d22ffc271c96aa5248"
     153                "reference": "cf1b83b1ef7615dd53f70864c9e7f496b1ec0fd1"
    154154            },
    155155            "dist": {
    156156                "type": "zip",
    157                 "url": "https://api.github.com/repos/PhpUnitsOfMeasure/php-units-of-measure/zipball/25f476e9c50e11af8cf044d22ffc271c96aa5248",
    158                 "reference": "25f476e9c50e11af8cf044d22ffc271c96aa5248",
     157                "url": "https://api.github.com/repos/PhpUnitsOfMeasure/php-units-of-measure/zipball/cf1b83b1ef7615dd53f70864c9e7f496b1ec0fd1",
     158                "reference": "cf1b83b1ef7615dd53f70864c9e7f496b1ec0fd1",
    159159                "shasum": ""
    160160            },
    161161            "require": {
    162                 "php": ">=5.4.0"
     162                "php": ">=7.4"
    163163            },
    164164            "replace": {
     
    166166            },
    167167            "require-dev": {
    168                 "phpunit/phpunit": "4.8.*",
    169                 "squizlabs/php_codesniffer": "2.2.*"
    170             },
    171             "time": "2016-07-24T22:36:00+00:00",
     168                "phpunit/phpunit": "^9.5",
     169                "squizlabs/php_codesniffer": "^3.7"
     170            },
     171            "time": "2025-04-30T23:02:43+00:00",
    172172            "type": "library",
    173173            "installation-source": "dist",
     
    184184                {
    185185                    "name": "Jonathan Hanson",
    186                     "email": "[email protected]",
    187                     "homepage": "http://www.jonathan-hanson.org/",
    188186                    "role": "Developer"
    189187                }
     
    197195            ],
    198196            "support": {
    199                 "email": "[email protected]",
    200197                "issues": "https://github.com/PhpUnitsOfMeasure/php-units-of-measure/issues",
    201198                "source": "https://github.com/PhpUnitsOfMeasure/php-units-of-measure"
  • shipment-tracker-for-woocommerce/trunk/vendor/composer/installed.php

    r3284690 r3317812  
    44        'pretty_version' => '1.14.21.x-dev',
    55        'version' => '1.14.21.9999999-dev',
    6         'reference' => '7633a98894c470b46667ed21baec71f0a8dce2f1',
     6        'reference' => '5d6f6ca21235b70aceb1363e637ca9440fb4ccdc',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => '1.14.21.x-dev',
    1515            'version' => '1.14.21.9999999-dev',
    16             'reference' => '7633a98894c470b46667ed21baec71f0a8dce2f1',
     16            'reference' => '5d6f6ca21235b70aceb1363e637ca9440fb4ccdc',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'htmlburger/carbon-fields' => array(
    23             'pretty_version' => 'v3.6.6',
    24             'version' => '3.6.6.0',
    25             'reference' => '9cb536e775f3c0688e18fca39445326521197220',
     23            'pretty_version' => 'v3.6.9',
     24            'version' => '3.6.9.0',
     25            'reference' => 'f82e80e3e3469d6e86cc17a8950b918ad448a059',
    2626            'type' => 'library',
    2727            'install_path' => __DIR__ . '/../htmlburger/carbon-fields',
     
    3030        ),
    3131        'php-units-of-measure/php-units-of-measure' => array(
    32             'pretty_version' => 'v2.1.0',
    33             'version' => '2.1.0.0',
    34             'reference' => '25f476e9c50e11af8cf044d22ffc271c96aa5248',
     32            'pretty_version' => 'v2.2.0',
     33            'version' => '2.2.0.0',
     34            'reference' => 'cf1b83b1ef7615dd53f70864c9e7f496b1ec0fd1',
    3535            'type' => 'library',
    3636            'install_path' => __DIR__ . '/../php-units-of-measure/php-units-of-measure',
  • shipment-tracker-for-woocommerce/trunk/vendor/composer/platform_check.php

    r3253299 r3317812  
    55$issues = array();
    66
    7 if (!(PHP_VERSION_ID >= 50620)) {
    8     $issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.20". You are running ' . PHP_VERSION . '.';
     7if (!(PHP_VERSION_ID >= 70400)) {
     8    $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
    99}
    1010
  • shipment-tracker-for-woocommerce/trunk/vendor/htmlburger/carbon-fields/config.php

    r3284690 r3317812  
    55# Define version constant
    66if ( ! defined( __NAMESPACE__ . '\VERSION' ) ) {
    7     define( __NAMESPACE__ . '\VERSION', '3.6.6' );
     7    define( __NAMESPACE__ . '\VERSION', '3.6.9' );
    88}
    99
  • shipment-tracker-for-woocommerce/trunk/vendor/htmlburger/carbon-fields/core/Container/Block_Container.php

    r3284690 r3317812  
    450450        ob_start();
    451451        call_user_func( $this->render_callback , $fields, $attributes, $content, $post_id, $block );
    452         $toReturn = ob_get_contents();
    453         ob_clean();
    454         return $toReturn;
     452        return ob_get_clean();
    455453    }
    456454
  • shipment-tracker-for-woocommerce/trunk/vendor/htmlburger/carbon-fields/core/Service/Meta_Query_Service.php

    r2469257 r3317812  
    101101
    102102    public function filter_get_meta_sql( $sql ) {
    103         if ( strpos( $sql['where'], static::META_KEY_PREFIX ) !== false ) {
    104             $sql['where'] = preg_replace( $this->get_meta_key_replace_regex(), '$1 LIKE $2', $sql['where'] );
    105         }
    106         return $sql;
    107     }
     103        if ( strpos( $sql['where'], static::META_KEY_PREFIX ) !== false ) {
     104            $sql['where'] = preg_replace( $this->get_meta_key_replace_regex(), '$1 LIKE $2', $sql['where'] );
     105        }
     106        if ( strpos( $sql['join'], static::META_KEY_PREFIX ) !== false ) {
     107            $sql['join'] = str_replace( static::META_KEY_PREFIX, '', $sql['join'] );
     108        }
     109        return $sql;
     110    }
    108111
    109112    /**************************************************
  • shipment-tracker-for-woocommerce/trunk/vendor/htmlburger/carbon-fields/package.json

    r3284690 r3317812  
    11{
    22  "name": "carbon-fields",
    3   "version": "3.6.6",
     3  "version": "3.6.9",
    44  "description": "WordPress developer-friendly custom fields for post types, taxonomy terms, users, comments, widgets, options, navigation menus and more.",
    55  "directories": {
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/.gitignore

    r2844514 r3317812  
    2424*.sass-cache
    2525
    26 # Vagrant files
    27 /.vagrant/
     26.phpunit.result.cache
     27tests/clover.xml
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/CHANGELOG.md

    r2844514 r3317812  
     1## v2.2.0 (April 30th, 2025)
     2- Drop support of PHP < 7.4
     3- Add `isUnitDefined()`, `listAllUnits()`, `getOriginalValue()`, and `getOriginalUnit()` methods to the Physical Quantity parent class
     4- Add new Power Physical Quantity
     5- Add Imperial Gallons to the Volume quantity
     6- Move to Github Actions, away from Travis CI
     7- Use Docker containers instead of Vagrant/VBox instances for dev environments
     8- Add local dev scripts for `lint`, `test`, and `shell`, in `./scripts/`
     9
    110## v2.1.0 (July 24th, 2016)
    211- Added getUnitDefinitions() method to PhysicalQuantity classes, to get a raw list of UnitofMeasure objects defined on that quantity
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/README.md

    r2844514 r3317812  
    4444
    4545## Installation
    46 This library is best included in your projects via Composer.  See the [Composer website](http://getcomposer.org/) for more details, and see the [Packagist.org site for this library](https://packagist.org/packages/php-units-of-measure/php-units-of-measure).
    47 
    48 If you'd prefer to manually include this library as a dependency in your project, then it is recommended that you use a [PSR-4](http://www.php-fig.org/psr/psr-4/) compliant PHP autoloader.  The mapping between this project's root namespace and its base directory is:
     46This library is best included in your projects via Composer.  See the [Composer website](https://getcomposer.org/) for more details, and see the [Packagist.org site for this library](https://packagist.org/packages/php-units-of-measure/php-units-of-measure).
     47
     48If you'd prefer to manually include this library as a dependency in your project, then it is recommended that you use a [PSR-4](https://www.php-fig.org/psr/psr-4/) compliant PHP autoloader.  The mapping between this project's root namespace and its base directory is:
    4949- vendor namespace 'PhpUnitsOfMeasure\' maps to the library's base directory 'source/'
    5050
     
    5252
    5353### Project Tags and Versions
    54 This project follows the guidelines set out in [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html).  In general, versions are of the form 'X.Y.Z', and increments to X denote backward-incompatible major changes.
    55 
    56 It is recommended that if your project includes this project as a dependency and you are using an automated dependency management tool such as [Composer](http://getcomposer.org/), then you should 'pin' the major version (X) and allow only variations in 'Y' (minor changes) and 'Z' (bugfixes).  See the documentation of your dependency manager for more details.
     54This project follows the guidelines set out in [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html).  In general, versions are of the form 'X.Y.Z', and increments to X denote backward-incompatible major changes.
     55
     56It is recommended that if your project includes this project as a dependency and you are using an automated dependency management tool such as [Composer](https://getcomposer.org/), then you should 'pin' the major version (X) and allow only variations in 'Y' (minor changes) and 'Z' (bugfixes).  See the documentation of your dependency manager for more details.
    5757
    5858
     
    240240
    241241### Adding New Physical Quantities
    242 [Physical quantities](http://en.wikipedia.org/wiki/Physical_quantity) are categories of measurable values, like mass, length, force, etc.
     242[Physical quantities](https://en.wikipedia.org/wiki/Physical_quantity) are categories of measurable values, like mass, length, force, etc.
    243243
    244244For physical quantities that are not already present in this library, it will be necessary to write a class to support a new one.  All physical quantities implement the `\PhpUnitsOfMeasure\PhysicalQuantityInterface` interface, typically extend the `\PhpUnitsOfMeasure\AbstractPhysicalQuantity` class, and typically have only an `initialize()` method which creates the quantity's units of measure.  See above for typical examples of physical quantity classes and of how to add new units to a quantity class.
     
    278278
    279279### Pull Requests and Merging
    280 The workflow for this repository loosely follows [gitflow](http://nvie.com/posts/a-successful-git-branching-model/) and goes as follows:
    281 - To develop new contributions, fork or branch from the `develop` branch of the main repository
    282 - Pull requests and contribution merges are always made to the `develop` branch of the main repository
    283 - From time to time, `develop` is merged into `master` by a project maintainer using --no-ff, and a new tag and version are released
    284 
    285 In this way, no feature-development work is ever directly contributed to `master`; merges to master only ever come from `develop` when a new version is being cut or from a bugfix branch, and are never fast-forward merges.  this maintains the `master` branch as a series of released production versions of the code, while `develop` is always the sum of the approved and merged contributions from developers.
    286 
    287 End users of this repository should only use tagged commits in production.  Users interested in the current 'soon-to-be-released' code may use `develop`, with the understanding that it changes quickly.  All other existing branches (if any) should be considered 'feature' branches in development, and not yet ready for use.
     280The workflow for this repository goes as follows:
     281- To develop new contributions, fork or branch from the `master` branch of the main repository
     282- Pull requests and contribution merges are always made to the `master` branch of the main repository
     283- From time to time, commits of `master` are tagged and a new version is released
     284- At present, there is no support for maintaining bug-fix branches of older project versions.  This is something we can revisit if a need arises.
     285
     286End users of this repository should only use tagged commits in production.  Users interested in the current 'soon-to-be-released' code may use `master`, with the understanding that it may change unexpectedly.  All other existing branches (if any) should be considered 'feature' branches in development, and not yet ready for use.
    288287
    289288### Local Testing Environment
    290 There's a Vagrant virtual machine configuration included which is suitable for running the necessary unit tests.  To bring up the machine, make sure you have Vagrant and Virtualbox installed, and from the project root directory:
    291 
    292 
    293 ``` bash
    294 vagrant up
    295 vagrant ssh
    296 cd /project
    297 ```
    298 
    299 ### Setting Up for Testing
    300 The virtual machine development environment already has Composer installed.  Once you're ssh'ed into the virtual machine, install this project's dev dependencies:
    301 
    302 ``` bash
    303 rm -rf vendor
    304 composer.phar update --verbose --prefer-dist
    305 ```
    306 
    307 ### Unit Tests
    308 All the tests associated with this project can be manually run with:
    309 
    310 ``` bash
    311 vendor/bin/phpunit -c ./tests/phpunit.xml.dist ./tests
    312 ```
    313 
    314 ### CodeSniffer
    315 Codesniffer verifies that coding standards are being met.  Once the project is built with development dependencies, you can run the checks with:
    316 
    317 ``` bash
    318 vendor/bin/phpcs --encoding=utf-8 --extensions=php --standard=./tests/phpcs.xml -nsp ./
    319 ```
    320 
    321 ### Continuous Integration
    322 The above tests are automatically run against Github commits with Travis-CI.
    323 - https://travis-ci.org/PhpUnitsOfMeasure/php-units-of-measure
     289There's a `Dockerfile` and a set of helper scripts in `scripts/` suitable for running the necessary unit tests.  With Docker installed, do:
     290
     291``` shell
     292# Execute the lint checks
     293./script/lint
     294
     295# Execute the unit tests
     296./script/test
     297```
     298
     299In addition, `./script/shell` will get you a bash shell in a temporary container.  Note that the hosts directory is mounted into the container, and changes to files inside the container will persist.
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/composer.json

    r2844514 r3317812  
    11{
    2     "name":        "php-units-of-measure/php-units-of-measure",
    3 
     2    "name": "php-units-of-measure/php-units-of-measure",
    43    "description": "A PHP library for converting between standard units of measure.",
    5 
    64    "keywords": [
    7          "measurements", "data", "conversion"
    8      ],
    9 
    10     "homepage":    "https://github.com/PhpUnitsOfMeasure/php-units-of-measure",
    11 
     5        "measurements",
     6        "data",
     7        "conversion"
     8    ],
     9    "homepage": "https://github.com/PhpUnitsOfMeasure/php-units-of-measure",
    1210    "license": "MIT",
    13 
    1411    "authors": [
    1512        {
    16             "name":     "Jonathan Hanson",
    17             "email":    "[email protected]",
    18             "homepage": "http://www.jonathan-hanson.org/",
    19             "role":     "Developer"
     13            "name": "Jonathan Hanson",
     14            "role": "Developer"
    2015        }
    2116    ],
    22 
    2317    "support": {
    24         "email":  "[email protected]",
    2518        "issues": "https://github.com/PhpUnitsOfMeasure/php-units-of-measure/issues",
    2619        "source": "https://github.com/PhpUnitsOfMeasure/php-units-of-measure"
    2720    },
    28 
    2921    "require": {
    30         "php": ">=5.4.0"
     22        "php": ">=7.4"
    3123    },
    32 
    3324    "require-dev": {
    34         "phpunit/phpunit":           "4.8.*",
    35         "squizlabs/php_codesniffer": "2.2.*"
     25        "phpunit/phpunit":           "^9.5",
     26        "squizlabs/php_codesniffer": "^3.7"
    3627    },
    37 
    3828    "replace": {
    3929        "triplepoint/php-units-of-measure": "*"
    4030    },
    41    
    4231    "autoload": {
    4332        "psr-4": {
     
    4736    "autoload-dev": {
    4837        "psr-4": {
    49              "PhpUnitsOfMeasureTest\\": "tests/"
     38            "PhpUnitsOfMeasureTest\\": "tests/"
    5039        }
     40    },
     41    "scripts": {
     42        "test": "phpunit -c ./tests/phpunit.xml.dist ./tests",
     43        "lint": "phpcs --encoding=utf-8 --extensions=php --standard=./tests/phpcs.xml -nsp ./"
    5144    }
    5245}
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/source/AbstractPhysicalQuantity.php

    r2844514 r3317812  
    1212     */
    1313    // protected static $unitDefinitions;
     14
     15    /**
     16     * Static cache for unit lookups.
     17     *
     18     * @var UnitOfMeasureInterface[]
     19     */
     20    private static $unitCache = [];
     21
     22    /**
     23     * Create a cache key for the unit lookup cache.
     24     *
     25     * @var UnitOfMeasureInterface[]
     26     */
     27    private static function buildUnitCacheKey($unit)
     28    {
     29        return get_called_class() . '#' . $unit;
     30    }
    1431
    1532    /**
     
    4865        }
    4966
     67        $key = static::buildUnitCacheKey($unit);
     68        if (isset(self::$unitCache[$key])) {
     69            return self::$unitCache[$key];
     70        }
     71
    5072        foreach (static::$unitDefinitions as $unitOfMeasure) {
    5173            if ($unit === $unitOfMeasure->getName() || $unitOfMeasure->isAliasOf($unit)) {
    52                 return $unitOfMeasure;
     74                return self::$unitCache[$key] = $unitOfMeasure;
    5375            }
    5476        }
     
    212234    }
    213235
     236    /**
     237     * @see \PhpUnitsOfMeasure\PhysicalQuantityInterface::isUnitDefined
     238     */
     239    public static function isUnitDefined($name)
     240    {
     241        $units = static::getUnitDefinitions();
     242        foreach ($units as $unit) {
     243            if ($name === $unit->getName() || $unit->isAliasOf($name)) {
     244                return true;
     245            }
     246        }
     247        return false;
     248    }
     249   
     250    /**
     251     * @see \PhpUnitsOfMeasure\PhysicalQuantityInterface::listAllUnits
     252     */
     253    public static function listAllUnits()
     254    {
     255        $return = [];
     256        $units = static::getUnitDefinitions();
     257        foreach ($units as $unit) {
     258            $return[$unit->getName()] = $unit->getAliases();
     259        }
     260        return $return;
     261    }
    214262
    215263    /**
     
    217265     * @return Array $unitDefinitions
    218266     */
    219     public static function getUnitDefinitions() {
     267    public static function getUnitDefinitions()
     268    {
    220269        if (!is_array(static::$unitDefinitions)) {
    221270            static::$unitDefinitions = [];
     
    225274        return static::$unitDefinitions;
    226275    }
     276
     277    /**
     278     * @return float
     279     */
     280    public function getOriginalValue()
     281    {
     282        return $this->originalValue;
     283    }
     284
     285    /**
     286     * @return string
     287     */
     288    public function getOriginalUnit()
     289    {
     290        return $this->originalUnit;
     291    }
    227292}
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/source/PhysicalQuantity/Volume.php

    r2844514 r3317812  
    149149        $newUnit->addAlias('us gal');
    150150        static::addUnit($newUnit);
     151
     152        // Imperial Gallon
     153        $newUnit = UnitOfMeasure::linearUnitFactory('imp gal', 4.54609e-3);
     154        $newUnit->addAlias('imperial gallon');
     155        $newUnit->addAlias('imperial gal');
     156        $newUnit->addAlias('imp gallon');
     157        $newUnit->addAlias('impg');
     158        static::addUnit($newUnit);
     159       
    151160        // Quart
    152161        $newUnit = UnitOfMeasure::linearUnitFactory('qt', 9.4635295e-4);
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/source/PhysicalQuantityInterface.php

    r2844514 r3317812  
    7272     */
    7373    public function isEquivalentQuantity(PhysicalQuantityInterface $testQuantity);
     74
     75    /**
     76     * @return float
     77     */
     78    public function getOriginalValue();
     79
     80    /**
     81     * @return string
     82     */
     83    public function getOriginalUnit();
     84
     85    /**
     86     * Verify if the given value respond to an already defined unit of meaure of the current
     87     * phisical quantity.
     88     *
     89     * @param string $name the string to verify
     90     *
     91     * @return boolean True if $name has been defined into the current physical quantity, false if not.
     92     */
     93    public static function isUnitDefined($name);
     94
     95    /**
     96     * Return a list of all the unit of measure defined in the current physical quantity
     97     *
     98     * @return array of all units as strings.
     99     *     Keys of the array are the units of measure; for any key the value is
     100     *     another array containing all aliases.
     101     */
     102    public static function listAllUnits();
    74103}
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/AbstractPhysicalQuantityTest.php

    r2844514 r3317812  
    33namespace PhpUnitsOfMeasureTest;
    44
    5 use PHPUnit_Framework_TestCase;
     5use PHPUnit\Framework\TestCase;
    66use PhpUnitsOfMeasure\AbstractPhysicalQuantity;
    77use PhpUnitsOfMeasure\UnitOfMeasureInterface;
    88use PhpUnitsOfMeasure\Exception\PhysicalQuantityMismatch;
    9 use PhpUnitsOfMeasure\Exception\DuplicateUnitNameOrAlias;
    10 use PhpUnitsOfMeasure\Exception\NonNumericValue;
    11 use PhpUnitsOfMeasure\Exception\NonStringUnitName;
    12 use PhpUnitsOfMeasure\Exception\UnknownUnitOfMeasure;
    139use PhpUnitsOfMeasureTest\Fixtures\PhysicalQuantity\Wonkicity;
    1410use PhpUnitsOfMeasureTest\Fixtures\PhysicalQuantity\Woogosity;
     
    2117 * @runTestsInSeparateProcesses
    2218 */
    23 class AbstractPhysicalQuantityTest extends PHPUnit_Framework_TestCase
     19class AbstractPhysicalQuantityTest extends TestCase
    2420{
    2521    protected function getTestUnitOfMeasure($name, $aliases = [])
    2622    {
    27         $newUnit = $this->getMockBuilder('PhpUnitsOfMeasure\UnitOfMeasureInterface')
     23        $newUnit = $this->getMockBuilder(UnitOfMeasureInterface::class)
    2824            ->getMock();
    2925        $newUnit->method('getName')
     
    3127        $newUnit->method('getAliases')
    3228            ->willReturn($aliases);
     29        $newUnit->method('isAliasOf')
     30            ->will($this->returnCallback(
     31                function ($value) use ($aliases) {
     32                    return in_array($value, $aliases);
     33                }
     34            ));
    3335
    3436        return $newUnit;
     
    3840     * @covers \PhpUnitsOfMeasure\AbstractPhysicalQuantity::addUnit
    3941     */
    40     public function testAddUnit()
     42    public function testAddUnit(): void
    4143    {
    4244        $newUnit = $this->getTestUnitOfMeasure('noconflict', ['definitelynoconflict']);
     
    4850     * @dataProvider exceptionProducingUnitsProvider
    4951     * @covers \PhpUnitsOfMeasure\AbstractPhysicalQuantity::addUnit
    50      * @expectedException \PhpUnitsOfMeasure\Exception\DuplicateUnitNameOrAlias
    51      */
    52     public function testAddUnitFailsOnNameCollision($unitName, $unitAliases)
    53     {
     52     */
     53    public function testAddUnitFailsOnNameCollision($unitName, $unitAliases): void
     54    {
     55        $this->expectException(\PhpUnitsOfMeasure\Exception\DuplicateUnitNameOrAlias::class);
    5456        $newUnit = $this->getTestUnitOfMeasure($unitName, $unitAliases);
    5557
     
    6062     * @covers \PhpUnitsOfMeasure\AbstractPhysicalQuantity::getUnit
    6163     */
    62     public function testGetUnit()
     64    public function testGetUnit(): void
    6365    {
    6466        $unit = Wonkicity::getUnit('u');
     
    6971    /**
    7072     * @covers \PhpUnitsOfMeasure\AbstractPhysicalQuantity::getUnit
    71      * @expectedException \PhpUnitsOfMeasure\Exception\UnknownUnitOfMeasure
    72      */
    73     public function testGetUnitFailsOnUnknownUnit()
    74     {
     73     */
     74    public function testGetUnitFailsOnUnknownUnit(): void
     75    {
     76        $this->expectException(\PhpUnitsOfMeasure\Exception\UnknownUnitOfMeasure::class);
    7577        Wonkicity::getUnit('someUnknownUnit');
    7678    }
     
    7981     * @covers \PhpUnitsOfMeasure\AbstractPhysicalQuantity::__construct
    8082     */
    81     public function testInstantiateNewUnit()
     83    public function testInstantiateNewUnit(): void
    8284    {
    8385        $value = new Wonkicity(1.234, 'quatloos');
     
    8688    /**
    8789     * @covers \PhpUnitsOfMeasure\AbstractPhysicalQuantity::__construct
    88      * @expectedException \PhpUnitsOfMeasure\Exception\NonNumericValue
    89      */
    90     public function testInstantiateNewUnitNonNumericValue()
    91     {
     90     */
     91    public function testInstantiateNewUnitNonNumericValue(): void
     92    {
     93        $this->expectException(\PhpUnitsOfMeasure\Exception\NonNumericValue::class);
    9294        $value = new Wonkicity('string', 'quatloos');
    9395    }
     
    9597    /**
    9698     * @covers \PhpUnitsOfMeasure\AbstractPhysicalQuantity::__construct
    97      * @expectedException \PhpUnitsOfMeasure\Exception\NonStringUnitName
    98      */
    99     public function testInstantiateNewUnitNonStringUnit()
    100     {
     99     */
     100    public function testInstantiateNewUnitNonStringUnit(): void
     101    {
     102        $this->expectException(\PhpUnitsOfMeasure\Exception\NonStringUnitName::class);
    101103        $value = new Wonkicity(1.234, 42);
    102104    }
     
    105107     * @dataProvider quantityConversionsProvider
    106108     * @covers \PhpUnitsOfMeasure\AbstractPhysicalQuantity::toUnit
    107      * @expectedException \PhpUnitsOfMeasure\Exception\UnknownUnitOfMeasure
    108109     */
    109110    public function testConvertToUnknownUnitThrowsException(
     
    111112        $arbitraryUnit,
    112113        $valueInArbitraryUnit
    113     ) {
     114    ): void {
     115        $this->expectException(\PhpUnitsOfMeasure\Exception\UnknownUnitOfMeasure::class);
    114116        $value->toUnit('someUnknownUnit');
    115117    }
     
    123125        $arbitraryUnit,
    124126        $valueInArbitraryUnit
    125     ) {
     127    ): void {
    126128        $this->assertSame($valueInArbitraryUnit, $value->toUnit($arbitraryUnit));
    127129    }
     
    131133     * @covers \PhpUnitsOfMeasure\AbstractPhysicalQuantity::__toString
    132134     */
    133     public function testToString(AbstractPhysicalQuantity $value, $string)
     135    public function testToString(AbstractPhysicalQuantity $value, $string): void
    134136    {
    135137        $this->assertSame($string, (string) $value);
     
    137139
    138140    /**
    139      *
    140141     * @dataProvider quantityConversionsProvider
    141142     */
     
    144145        $arbitraryUnit,
    145146        $valueInArbitraryUnit
    146     ) {
     147    ): void {
    147148        serialize($value);
    148149    }
     
    155156        $arbitraryUnit,
    156157        $valueInArbitraryUnit
    157     ) {
     158    ): void {
    158159        $unserializedValue = unserialize(serialize($value));
    159160
     
    171172        $sumString,
    172173        $diffString
    173     ) {
     174    ): void {
    174175        if ($shouldThrowException) {
    175             $this->setExpectedException('PhpUnitsOfMeasure\Exception\PhysicalQuantityMismatch');
     176            $this->expectException(PhysicalQuantityMismatch::class);
    176177        }
    177178
     
    193194        $sumString,
    194195        $diffString
    195     ) {
     196    ): void {
    196197        if ($shouldThrowException) {
    197             $this->setExpectedException('PhpUnitsOfMeasure\Exception\PhysicalQuantityMismatch');
     198            $this->expectException(PhysicalQuantityMismatch::class);
    198199        }
    199200
     
    208209     * @covers \PhpUnitsOfMeasure\AbstractPhysicalQuantity::getUnitDefinitions
    209210     */
    210     public function testGetAllUnits() {
    211       $array = Wonkicity::getUnitDefinitions();
    212 
    213       $this->assertTrue(is_array($array));
    214 
    215       $expected = array(Wonkicity::getUnit('u'), Wonkicity::getUnit('v'));
    216       $this->assertEquals($array, $expected);
     211    public function testGetAllUnits(): void
     212    {
     213        $array = Wonkicity::getUnitDefinitions();
     214
     215        $this->assertIsArray($array);
     216
     217        $expected = array(Wonkicity::getUnit('u'), Wonkicity::getUnit('v'));
     218        $this->assertEquals($array, $expected);
     219    }
     220
     221    /**
     222     * @covers \PhpUnitsOfMeasure\AbstractPhysicalQuantity::isUnitDefined
     223     */
     224    public function testIsUnitDefined(): void
     225    {
     226        $newUnit = $this->getTestUnitOfMeasure('noconflict', ['definitelynoconflict_1', 'definitelynoconflict_2']);
     227        Wonkicity::addUnit($newUnit);
     228
     229        $someExistingUnits = ['u', 'uvees', 'v', 'vorp', 'noconflict', 'definitelynoconflict_1', 'definitelynoconflict_2'];
     230        $unexistingUnits = ['kg', 'l', 'definitelynoconflict_'];
     231
     232        foreach ($someExistingUnits as $someExistingUnit) {
     233            $this->assertTrue(Wonkicity::isUnitDefined($someExistingUnit), "$someExistingUnit is not defined");
     234        }
     235        foreach ($unexistingUnits as $unexistingUnit) {
     236            $this->assertFalse(Wonkicity::isUnitDefined($unexistingUnit), "$unexistingUnit is not defined");
     237        }
     238    }
     239
     240    /**
     241     * @covers \PhpUnitsOfMeasure\AbstractPhysicalQuantity::listAllUnits
     242     */
     243    public function testListAllUnits(): void
     244    {
     245        $newUnit = $this->getTestUnitOfMeasure('noconflict', ['definitelynoconflict_1', 'definitelynoconflict_2']);
     246        Wonkicity::addUnit($newUnit);
     247
     248        $allUnits = Wonkicity::listAllUnits();
     249        $expected = [];
     250        $expected['u'] = ['uvee', 'uvees'];
     251        $expected['v'] = ['vorp', 'vorps'];
     252        $expected['noconflict'] = ['definitelynoconflict_1', 'definitelynoconflict_2'];
     253        $this->assertEquals($allUnits, $expected);
     254    }
     255
     256    public function testGetOriginalValue()
     257    {
     258        $value = 2;
     259        $unit = 'u';
     260        $physicalQuantity = new Wonkicity($value, $unit);
     261        $this->assertEquals($value, $physicalQuantity->getOriginalValue());
     262        $this->assertEquals($unit, $physicalQuantity->getOriginalUnit());
    217263    }
    218264
     
    222268     * 2) The set of aliases for the new unit to test
    223269     */
    224     public function exceptionProducingUnitsProvider()
     270    public function exceptionProducingUnitsProvider(): array
    225271    {
    226272        return [
     
    238284     * 3) The expected resulting value of the conversion
    239285     */
    240     public function quantityConversionsProvider()
     286    public function quantityConversionsProvider(): array
    241287    {
    242288        return [
     
    255301     * 2) the expected resulting string from the conversion
    256302     */
    257     public function toStringProvider()
     303    public function toStringProvider(): array
    258304    {
    259305        return [
     
    275321     * 5) The string-cast result of a subtraction operation with the two operands (ignored for errors)
    276322     */
    277     public function arithmeticProvider()
     323    public function arithmeticProvider(): array
    278324    {
    279325        return [
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/DemonstrationTests.php

    r2844514 r3317812  
    33namespace PhpUnitsOfMeasureTest;
    44
    5 use PHPUnit_Framework_TestCase;
     5use PHPUnit\Framework\TestCase;
    66
    77use PhpUnitsOfMeasure\UnitOfMeasure;
    8 use PhpUnitsOfMeasure\AbstractDerivedPhysicalQuantity;
    9 use PhpUnitsOfMeasure\DerivedPhysicalQuantityFactory;
    10 use PhpUnitsOfMeasure\PhysicalQuantity\UnknownDerivedPhysicalQuantity;
    11 use PhpUnitsOfMeasureTest\Fixtures\PhysicalQuantity\Plooposity;
    12 use PhpUnitsOfMeasureTest\Fixtures\PhysicalQuantity\Pumpalumpiness;
    138use PhpUnitsOfMeasureTest\Fixtures\PhysicalQuantity\Wigginess;
    14 use PhpUnitsOfMeasureTest\Fixtures\PhysicalQuantity\Wonkicity;
    159use PhpUnitsOfMeasureTest\Fixtures\PhysicalQuantity\Woogosity;
    1610
     
    3327 * @runTestsInSeparateProcesses
    3428 */
    35 class DemonstrationTests extends PHPUnit_Framework_TestCase
     29class DemonstrationTests extends TestCase
    3630{
    37     public function testInstantiatingQuantities()
     31    public function testInstantiatingQuantities(): void
    3832    {
    3933        // New quantities are created like this, with
     
    4539        // (for example sopee, sopees, s).
    4640        $a = new Wigginess(1, 'sopee');
    47         $this->assertInstanceOf('PhpUnitsOfMeasureTest\Fixtures\PhysicalQuantity\Wigginess', $a);
     41        $this->assertInstanceOf(Wigginess::class, $a);
    4842
    4943        $a = new Wigginess(2.123, 'sopees');
    50         $this->assertInstanceOf('PhpUnitsOfMeasureTest\Fixtures\PhysicalQuantity\Wigginess', $a);
     44        $this->assertInstanceOf(Wigginess::class, $a);
    5145
    5246        $a = new Wigginess(2.6, 's');
    53         $this->assertInstanceOf('PhpUnitsOfMeasureTest\Fixtures\PhysicalQuantity\Wigginess', $a);
     47        $this->assertInstanceOf(Wigginess::class, $a);
    5448
    5549        $a = new Wigginess(1, 'tumpet');
    56         $this->assertInstanceOf('PhpUnitsOfMeasureTest\Fixtures\PhysicalQuantity\Wigginess', $a);
     50        $this->assertInstanceOf(Wigginess::class, $a);
    5751
    5852        $a = new Wigginess(2.123, 'tumpets');
    59         $this->assertInstanceOf('PhpUnitsOfMeasureTest\Fixtures\PhysicalQuantity\Wigginess', $a);
     53        $this->assertInstanceOf(Wigginess::class, $a);
    6054
    6155        $a = new Wigginess(2.6, 't');
    62         $this->assertInstanceOf('PhpUnitsOfMeasureTest\Fixtures\PhysicalQuantity\Wigginess', $a);
     56        $this->assertInstanceOf(Wigginess::class, $a);
    6357    }
    6458
    65     public function testStringConversionForQuantities()
     59    public function testStringConversionForQuantities(): void
    6660    {
    6761        // Casting physical quantity objects to strings will
     
    7468    }
    7569
    76     public function testUnitConversionForQuantities()
     70    public function testUnitConversionForQuantities(): void
    7771    {
    7872        // Creating equivalent quantities from existing
     
    9185    }
    9286
    93     public function testCreatingNewUnitsForQuantities()
     87    public function testCreatingNewUnitsForQuantities(): void
    9488    {
    9589        // New units of measure can be defined and registered
     
    151145    }
    152146
    153     public function testAutomaticSIUnitsForQuantities()
     147    public function testAutomaticSIUnitsForQuantities(): void
    154148    {
    155149        // SI units have a standard prefix naming convention to easily
     
    165159        $a = new Woogosity(21, 'plurp');
    166160
    167         $this->assertInstanceOf('PhpUnitsOfMeasureTest\Fixtures\PhysicalQuantity\Woogosity', $a);
     161        $this->assertInstanceOf(Woogosity::class, $a);
    168162        $this->assertSame(21*4.5 * 1e3, $a->toUnit('millilupees'));
    169163        $this->assertSame(21*4.5 * 1e3, $a->toUnit('ml'));
     
    172166    }
    173167
    174     public function testAddQuantities()
     168    public function testAddQuantities(): void
    175169    {
    176170        // Two quantities of equivalent value can be summed
     
    180174        $c = $a->add($b);
    181175
    182         $this->assertInstanceOf('PhpUnitsOfMeasureTest\Fixtures\PhysicalQuantity\Wigginess', $c);
     176        $this->assertInstanceOf(Wigginess::class, $c);
    183177        $this->assertSame(3 + (2*2.5), $c->toUnit('sopee'));
    184178    }
    185179
    186     public function testSubtractQuantities()
     180    public function testSubtractQuantities(): void
    187181    {
    188182        // Similar to the add method, subtract called on the
     
    193187        $c = $a->subtract($b);
    194188
    195         $this->assertInstanceOf('PhpUnitsOfMeasureTest\Fixtures\PhysicalQuantity\Wigginess', $c);
     189        $this->assertInstanceOf(Wigginess::class, $c);
    196190        $this->assertSame(3 - (2*2.5), $c->toUnit('sopee'));
    197191    }
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/Fixtures/PhysicalQuantity/Wigginess.php

    r2844514 r3317812  
    1010    protected static $unitDefinitions;
    1111
    12     protected static function initialize()
     12    protected static function initialize(): void
    1313    {
    1414        $native = UnitOfMeasure::nativeUnitFactory('s');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/Fixtures/PhysicalQuantity/Wonkicity.php

    r2844514 r3317812  
    1010    protected static $unitDefinitions;
    1111
    12     protected static function initialize()
     12    protected static function initialize(): void
    1313    {
    1414        $native = UnitOfMeasure::nativeUnitFactory('u');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/Fixtures/PhysicalQuantity/Woogosity.php

    r2844514 r3317812  
    1313    protected static $unitDefinitions;
    1414
    15     protected static function initialize()
     15    protected static function initialize(): void
    1616    {
    1717        $native = UnitOfMeasure::nativeUnitFactory('l');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/PhysicalQuantity/AbstractPhysicalQuantityTestCase.php

    r2844514 r3317812  
    33namespace PhpUnitsOfMeasureTest\PhysicalQuantity;
    44
    5 use PHPUnit_Framework_TestCase;
     5use PHPUnit\Framework\TestCase;
     6use PhpUnitsOfMeasure\PhysicalQuantityInterface;
    67
    78/**
    89 * This is a parent class for all the PhysicalQuantity childrens' test cases.
    910 */
    10 abstract class AbstractPhysicalQuantityTestCase extends PHPUnit_Framework_TestCase
     11abstract class AbstractPhysicalQuantityTestCase extends TestCase
    1112{
    12     protected $supportedUnitsWithAliases = [];
     13    protected array $supportedUnitsWithAliases = [];
    1314
    1415    /**
    1516     * Verify that the object instantiates without error.
    1617     */
    17     public function testConstructorSucceeds()
     18    public function testConstructorSucceeds(): void
    1819    {
    1920        $this->instantiateTestQuantity();
     
    2425     * exceptions are thrown.
    2526     */
    26     public function testSupportedUnits()
     27    public function testSupportedUnits(): void
    2728    {
    2829        $quantity = $this->instantiateTestQuantity();
     
    3536    /**
    3637     * Build a test object of the target physical quantity.
    37      *
    38      * @return PhysicalQuantityInterface
    3938     */
    40     abstract protected function instantiateTestQuantity();
     39    abstract protected function instantiateTestQuantity(): PhysicalQuantityInterface;
    4140}
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/PhysicalQuantity/AccelerationTest.php

    r2844514 r3317812  
    44
    55use PhpUnitsOfMeasure\PhysicalQuantity\Acceleration;
     6use PhpUnitsOfMeasure\PhysicalQuantityInterface;
    67
    78class AccelerationTest extends AbstractPhysicalQuantityTestCase
    89{
    9     protected $supportedUnitsWithAliases = [
     10    protected array $supportedUnitsWithAliases = [
    1011        'm/s^2',
    1112        'm/s²',
     
    1617    ];
    1718
    18     protected function instantiateTestQuantity()
     19    protected function instantiateTestQuantity(): PhysicalQuantityInterface
    1920    {
    2021        return new Acceleration(1, 'm/s^2');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/PhysicalQuantity/AngleTest.php

    r2844514 r3317812  
    44
    55use PhpUnitsOfMeasure\PhysicalQuantity\Angle;
     6use PhpUnitsOfMeasure\PhysicalQuantityInterface;
    67
    78class AngleTest extends AbstractPhysicalQuantityTestCase
    89{
    9     protected $supportedUnitsWithAliases = [
     10    protected array $supportedUnitsWithAliases = [
    1011        'rad',
    1112        'radian',
     
    250251    ];
    251252
    252     protected function instantiateTestQuantity()
     253    protected function instantiateTestQuantity(): PhysicalQuantityInterface
    253254    {
    254255        return new Angle(1, 'deg');
    255256    }
    256257
    257     public function testToDegrees()
     258    public function testToDegrees(): void
    258259    {
    259260        $angle = new Angle(2 * M_PI, 'rad');
     
    261262    }
    262263
    263     public function testToRadians()
     264    public function testToRadians(): void
    264265    {
    265266        $angle = new Angle(720, 'degree');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/PhysicalQuantity/AreaTest.php

    r2844514 r3317812  
    44
    55use PhpUnitsOfMeasure\PhysicalQuantity\Area;
     6use PhpUnitsOfMeasure\PhysicalQuantityInterface;
    67
    78class AreaTest extends AbstractPhysicalQuantityTestCase
    89{
    9     protected $supportedUnitsWithAliases = [
     10    protected array $supportedUnitsWithAliases = [
    1011        'm^2',
    1112        'm²',
     
    6263    ];
    6364
    64     protected function instantiateTestQuantity()
     65    protected function instantiateTestQuantity(): PhysicalQuantityInterface
    6566    {
    6667        return new Area(1, 'm^2');
    6768    }
    6869
    69     public function testToHectares()
     70    public function testToHectares(): void
    7071    {
    7172        $area = new Area(3, 'ha');
     
    7879     * so we'll check that it's close.
    7980     */
    80     public function testToAcres()
     81    public function testToAcres(): void
    8182    {
    8283        $area = new Area(13, 'ac');
     
    8788    }
    8889
    89     public function testToAre()
     90    public function testToAre(): void
    9091    {
    9192        $area = new Area(100, 'm^2');
     
    9394    }
    9495
    95     public function testToDecare()
     96    public function testToDecare(): void
    9697    {
    9798        $area = new Area(1000, 'm^2');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/PhysicalQuantity/ElectricCurrentTest.php

    r2844514 r3317812  
    44
    55use PhpUnitsOfMeasure\PhysicalQuantity\ElectricCurrent;
     6use PhpUnitsOfMeasure\PhysicalQuantityInterface;
    67
    78class ElectricCurrentTest extends AbstractPhysicalQuantityTestCase
    89{
    9     protected $supportedUnitsWithAliases = [
     10    protected array $supportedUnitsWithAliases = [
    1011        'A',
    1112        'amp',
     
    115116    ];
    116117
    117     protected function instantiateTestQuantity()
     118    protected function instantiateTestQuantity(): PhysicalQuantityInterface
    118119    {
    119120        return new ElectricCurrent(1, 'A');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/PhysicalQuantity/EnergyTest.php

    r2844514 r3317812  
    44
    55use PhpUnitsOfMeasure\PhysicalQuantity\Energy;
     6use PhpUnitsOfMeasure\PhysicalQuantityInterface;
    67
    78class EnergyTest extends AbstractPhysicalQuantityTestCase
    89{
    9     protected $supportedUnitsWithAliases = [
     10    protected array $supportedUnitsWithAliases = [
    1011        'Wh',
    1112        'watt hour',
     
    5960    ];
    6061
    61     protected function instantiateTestQuantity()
     62    protected function instantiateTestQuantity(): PhysicalQuantityInterface
    6263    {
    6364        return new Energy(1, 'Wh');
    6465    }
    6566
    66     public function testToKilowattHour()
     67    public function testToKilowattHour(): void
    6768    {
    6869        $quantity = new Energy(1000, 'Wh');
     
    7071    }
    7172
    72     public function testToWattHour()
     73    public function testToWattHour(): void
    7374    {
    7475        $quantity = new Energy(1, 'kWh');
     
    7677    }
    7778
    78     public function testToMegaJoule()
     79    public function testToMegaJoule(): void
    7980    {
    8081        $quantity = new Energy(1, 'kWh');
     
    8283    }
    8384
    84     public function testToJoule()
     85    public function testToJoule(): void
    8586    {
    8687        $quantity = new Energy(1, 'Wh');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/PhysicalQuantity/LengthTest.php

    r2844514 r3317812  
    44
    55use PhpUnitsOfMeasure\PhysicalQuantity\Length;
     6use PhpUnitsOfMeasure\PhysicalQuantityInterface;
    67
    78class LengthTest extends AbstractPhysicalQuantityTestCase
    89{
    9     protected $supportedUnitsWithAliases = [
     10    protected array $supportedUnitsWithAliases = [
    1011        'm',
    1112        'meter',
     
    136137    ];
    137138
    138     protected function instantiateTestQuantity()
     139    protected function instantiateTestQuantity(): PhysicalQuantityInterface
    139140    {
    140141        return new Length(1, 'm');
    141142    }
    142143
    143     public function testToMillimeters()
     144    public function testToMillimeters(): void
    144145    {
    145146        $quantity = new Length(5, 'm');
     
    147148    }
    148149
    149     public function testToMegameters()
     150    public function testToMegameters(): void
    150151    {
    151152        $quantity = new Length(5, 'm');
     
    153154    }
    154155
    155     public function testToInches()
     156    public function testToInches(): void
    156157    {
    157158        $quantity = new Length(2, 'ft');
    158         $this->assertEquals(24, $quantity->toUnit('in'));
     159        $this->assertEquals(24, round($quantity->toUnit('in')));
    159160    }
    160161
    161     public function testToNauticalMiles()
     162    public function testToNauticalMiles(): void
    162163    {
    163164        $quantity = new Length(3704, 'm');
     
    165166    }
    166167
    167     public function testToScandinavianMil()
     168    public function testToScandinavianMil(): void
    168169    {
    169170        $quantity = new Length(20000, 'm');
     
    171172    }
    172173
    173     public function testToAstronomicalUnit()
     174    public function testToAstronomicalUnit(): void
    174175    {
    175176        $quantity = new Length(150000000, 'km');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/PhysicalQuantity/LuminousIntensityTest.php

    r2844514 r3317812  
    44
    55use PhpUnitsOfMeasure\PhysicalQuantity\LuminousIntensity;
     6use PhpUnitsOfMeasure\PhysicalQuantityInterface;
    67
    78class LuminousIntensityTest extends AbstractPhysicalQuantityTestCase
    89{
    9     protected $supportedUnitsWithAliases = [
     10    protected array $supportedUnitsWithAliases = [
    1011        'cd',
    1112        'candela',
     
    5253    ];
    5354
    54     protected function instantiateTestQuantity()
     55    protected function instantiateTestQuantity(): PhysicalQuantityInterface
    5556    {
    5657        return new LuminousIntensity(1, 'cd');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/PhysicalQuantity/MassTest.php

    r2844514 r3317812  
    44
    55use PhpUnitsOfMeasure\PhysicalQuantity\Mass;
     6use PhpUnitsOfMeasure\PhysicalQuantityInterface;
    67
    78class MassTest extends AbstractPhysicalQuantityTestCase
    89{
    9     protected $supportedUnitsWithAliases = [
     10    protected array $supportedUnitsWithAliases = [
    1011        'kg',
    1112        'kilogram',
     
    8889    ];
    8990
    90     protected function instantiateTestQuantity()
     91    protected function instantiateTestQuantity(): PhysicalQuantityInterface
    9192    {
    9293        return new Mass(1, 'kg');
    9394    }
    9495
    95     public function testToGrams()
     96    public function testToGrams(): void
    9697    {
    9798        $quantity = new Mass(5, 'kg');
     
    99100    }
    100101
    101     public function testToMilligrams()
     102    public function testToMilligrams(): void
    102103    {
    103104        $quantity = new Mass(5, 'kg');
     
    105106    }
    106107
    107     public function testToPounds()
     108    public function testToPounds(): void
    108109    {
    109110        $quantity = new Mass(16, 'oz');
     
    111112    }
    112113
    113     public function testToStones()
     114    public function testToStones(): void
    114115    {
    115116        $quantity = new Mass(14, 'pound');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/PhysicalQuantity/PressureTest.php

    r2844514 r3317812  
    44
    55use PhpUnitsOfMeasure\PhysicalQuantity\Pressure;
     6use PhpUnitsOfMeasure\PhysicalQuantityInterface;
    67
    78class PressureTest extends AbstractPhysicalQuantityTestCase
    89{
    9     protected $supportedUnitsWithAliases = [
     10    protected array $supportedUnitsWithAliases = [
    1011        'Pa',
    1112        'pascal',
     
    8485    ];
    8586
    86     protected function instantiateTestQuantity()
     87    protected function instantiateTestQuantity(): PhysicalQuantityInterface
    8788    {
    8889        return new Pressure(1, 'Pa');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/PhysicalQuantity/QuantityTest.php

    r2844514 r3317812  
    44
    55use PhpUnitsOfMeasure\PhysicalQuantity\Quantity;
     6use PhpUnitsOfMeasure\PhysicalQuantityInterface;
    67
    78class QuantityTest extends AbstractPhysicalQuantityTestCase
    89{
    9     protected $supportedUnitsWithAliases = [
     10    protected array $supportedUnitsWithAliases = [
    1011        'mol',
    1112        'mole',
     
    7374    ];
    7475
    75     protected function instantiateTestQuantity()
     76    protected function instantiateTestQuantity(): PhysicalQuantityInterface
    7677    {
    7778        return new Quantity(1, 'mol');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/PhysicalQuantity/SolidAngleTest.php

    r2844514 r3317812  
    44
    55use PhpUnitsOfMeasure\PhysicalQuantity\SolidAngle;
     6use PhpUnitsOfMeasure\PhysicalQuantityInterface;
    67
    78class SolidAngleTest extends AbstractPhysicalQuantityTestCase
    89{
    9     protected $supportedUnitsWithAliases = [
     10    protected array $supportedUnitsWithAliases = [
    1011        'sr',
    1112        'steradian',
     
    7374    ];
    7475
    75     protected function instantiateTestQuantity()
     76    protected function instantiateTestQuantity(): PhysicalQuantityInterface
    7677    {
    7778        return new SolidAngle(1, 'steradian');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/PhysicalQuantity/TemperatureTest.php

    r2844514 r3317812  
    44
    55use PhpUnitsOfMeasure\PhysicalQuantity\Temperature;
     6use PhpUnitsOfMeasure\PhysicalQuantityInterface;
    67
    78class TemperatureTest extends AbstractPhysicalQuantityTestCase
    89{
    9     protected $supportedUnitsWithAliases = [
     10    protected array $supportedUnitsWithAliases = [
    1011        'K',
    1112        '°K',
     
    8081    ];
    8182
    82     protected function instantiateTestQuantity()
     83    protected function instantiateTestQuantity(): PhysicalQuantityInterface
    8384    {
    8485        return new Temperature(1, 'K');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/PhysicalQuantity/TimeTest.php

    r2844514 r3317812  
    44
    55use PhpUnitsOfMeasure\PhysicalQuantity\Time;
     6use PhpUnitsOfMeasure\PhysicalQuantityInterface;
    67
    78class TimeTest extends AbstractPhysicalQuantityTestCase
    89{
    9     protected $supportedUnitsWithAliases = [
     10    protected array $supportedUnitsWithAliases = [
    1011        's',
    1112        'sec',
     
    141142    ];
    142143
    143     protected function instantiateTestQuantity()
     144    protected function instantiateTestQuantity(): PhysicalQuantityInterface
    144145    {
    145146        return new Time(1, 'sec');
    146147    }
    147148
    148     public function testToSeconds()
     149    public function testToSeconds(): void
    149150    {
    150151        $angle = new Time(5, 'm');
     
    152153    }
    153154
    154     public function testToMinutes()
     155    public function testToMinutes(): void
    155156    {
    156157        $angle = new Time(360, 'sec');
     
    158159    }
    159160
    160     public function testToHours()
     161    public function testToHours(): void
    161162    {
    162163        $angle = new Time(120, 'mins');
     
    164165    }
    165166
    166     public function testToDays()
     167    public function testToDays(): void
    167168    {
    168169        $angle = new Time(72, 'hours');
     
    170171    }
    171172
    172     public function testToWeeks()
     173    public function testToWeeks(): void
    173174    {
    174175        $angle = new Time(14, 'd');
     
    176177    }
    177178
    178     public function testToGregorianYears()
     179    public function testToGregorianYears(): void
    179180    {
    180181        $angle = new Time(365.2425, 'd');
     
    182183    }
    183184
    184     public function testToJulianYears()
     185    public function testToJulianYears(): void
    185186    {
    186187        $angle = new Time(365.25, 'd');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/PhysicalQuantity/VelocityTest.php

    r2844514 r3317812  
    44
    55use PhpUnitsOfMeasure\PhysicalQuantity\Velocity;
     6use PhpUnitsOfMeasure\PhysicalQuantityInterface;
    67
    78class VelocityTest extends AbstractPhysicalQuantityTestCase
    89{
    9     protected $supportedUnitsWithAliases = [
     10    protected array $supportedUnitsWithAliases = [
    1011        'm/s',
    1112        'meters/sec',
     
    3031    ];
    3132
    32     protected function instantiateTestQuantity()
     33    protected function instantiateTestQuantity(): PhysicalQuantityInterface
    3334    {
    3435        return new Velocity(1, 'm/s');
    3536    }
    3637
    37     public function testToKilometersPerHour()
     38    public function testToKilometersPerHour(): void
    3839    {
    3940        $speed = new Velocity(1, 'km/h');
     
    4142    }
    4243
    43     public function testToFeetPerSecond()
     44    public function testToFeetPerSecond(): void
    4445    {
    4546        $speed = new Velocity(2, 'm/s');
     
    4748    }
    4849
    49     public function testToKmPerHour()
     50    public function testToKmPerHour(): void
    5051    {
    5152        $speed = new Velocity(2, 'mph');
     
    5354    }
    5455
    55     public function testToKnot()
     56    public function testToKnot(): void
    5657    {
    5758        $speed = new Velocity(2, 'm/s');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/PhysicalQuantity/VolumeTest.php

    r2844514 r3317812  
    44
    55use PhpUnitsOfMeasure\PhysicalQuantity\Volume;
     6use PhpUnitsOfMeasure\PhysicalQuantityInterface;
    67
    78class VolumeTest extends AbstractPhysicalQuantityTestCase
    89{
    9     protected $supportedUnitsWithAliases = [
     10    protected array $supportedUnitsWithAliases = [
    1011        'm^3',
    1112        'm³',
     
    8586    ];
    8687
    87     protected function instantiateTestQuantity()
     88    protected function instantiateTestQuantity(): PhysicalQuantityInterface
    8889    {
    8990        return new Volume(1, 'm^3');
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/UnitOfMeasureTest.php

    r2844514 r3317812  
    33namespace PhpUnitsOfMeasureTest;
    44
     5use PHPUnit\Framework\TestCase;
    56use PhpUnitsOfMeasure\UnitOfMeasure;
    67
    7 class UnitOfMeasureTest extends \PHPUnit_Framework_TestCase
     8class UnitOfMeasureTest extends TestCase
    89{
    910    /**
     
    1112     * @covers \PhpUnitsOfMeasure\UnitOfMeasure::getName
    1213     */
    13     public function testGetName()
     14    public function testGetName(): void
    1415    {
    1516        $uom = new UnitOfMeasure(
     
    2829    /**
    2930     * @covers \PhpUnitsOfMeasure\UnitOfMeasure::__construct
    30      * @expectedException \PhpUnitsOfMeasure\Exception\NonStringUnitName
    31      */
    32     public function testConstructWithNonStringName()
    33     {
     31     */
     32    public function testConstructWithNonStringName(): void
     33    {
     34        $this->expectException(\PhpUnitsOfMeasure\Exception\NonStringUnitName::class);
    3435        $uom = new UnitOfMeasure(
    3536            42,
     
    4748     * @covers \PhpUnitsOfMeasure\UnitOfMeasure::getAliases
    4849     */
    49     public function testGetAliases()
     50    public function testGetAliases(): void
    5051    {
    5152        $uom = new UnitOfMeasure(
     
    7071    /**
    7172     * @covers \PhpUnitsOfMeasure\UnitOfMeasure::addAlias
    72      * @expectedException \PhpUnitsOfMeasure\Exception\NonStringUnitName
    73      */
    74     public function testAddAliasWithNonStringAlias()
    75     {
     73     */
     74    public function testAddAliasWithNonStringAlias(): void
     75    {
     76        $this->expectException(\PhpUnitsOfMeasure\Exception\NonStringUnitName::class);
    7677        $uom = new UnitOfMeasure(
    7778            'quatloos',
     
    9091     * @covers \PhpUnitsOfMeasure\UnitOfMeasure::isAliasOf
    9192     */
    92     public function testIsAliasOf()
     93    public function testIsAliasOf(): void
    9394    {
    9495        $uom = new UnitOfMeasure(
     
    110111     * @covers \PhpUnitsOfMeasure\UnitOfMeasure::isAliasOf
    111112     */
    112     public function testIsNotAliasOf()
     113    public function testIsNotAliasOf(): void
    113114    {
    114115        $uom = new UnitOfMeasure(
     
    129130    /**
    130131     * @covers \PhpUnitsOfMeasure\UnitOfMeasure::isAliasOf
    131      * @expectedException \PhpUnitsOfMeasure\Exception\NonStringUnitName
    132      */
    133     public function testIsAliasOfWithNonStringAlias()
    134     {
     132     *
     133     */
     134    public function testIsAliasOfWithNonStringAlias(): void
     135    {
     136        $this->expectException(\PhpUnitsOfMeasure\Exception\NonStringUnitName::class);
    135137        $uom = new UnitOfMeasure(
    136138            'quatloos',
     
    151153     * @covers \PhpUnitsOfMeasure\UnitOfMeasure::convertValueFromNativeUnitOfMeasure
    152154     */
    153     public function testConvertValueFromNativeUnitOfMeasure()
     155    public function testConvertValueFromNativeUnitOfMeasure(): void
    154156    {
    155157        $uom = new UnitOfMeasure(
     
    168170    /**
    169171     * @covers \PhpUnitsOfMeasure\UnitOfMeasure::convertValueFromNativeUnitOfMeasure
    170      * @expectedException \PhpUnitsOfMeasure\Exception\NonNumericValue
    171      */
    172     public function testConvertValueFromNativeUnitOfMeasureWithNonNumericalValue()
    173     {
     172     */
     173    public function testConvertValueFromNativeUnitOfMeasureWithNonNumericalValue(): void
     174    {
     175        $this->expectException(\PhpUnitsOfMeasure\Exception\NonNumericValue::class);
    174176        $uom = new UnitOfMeasure(
    175177            'quatloos',
     
    188190     * @covers \PhpUnitsOfMeasure\UnitOfMeasure::convertValueToNativeUnitOfMeasure
    189191     */
    190     public function testConvertValueToNativeUnitOfMeasure()
     192    public function testConvertValueToNativeUnitOfMeasure(): void
    191193    {
    192194        $uom = new UnitOfMeasure(
     
    205207    /**
    206208     * @covers \PhpUnitsOfMeasure\UnitOfMeasure::convertValueToNativeUnitOfMeasure
    207      * @expectedException \PhpUnitsOfMeasure\Exception\NonNumericValue
    208      */
    209     public function testConvertValueToNativeUnitOfMeasureWithNonNumericalValue()
    210     {
     209     */
     210    public function testConvertValueToNativeUnitOfMeasureWithNonNumericalValue(): void
     211    {
     212        $this->expectException(\PhpUnitsOfMeasure\Exception\NonNumericValue::class);
    211213        $uom = new UnitOfMeasure(
    212214            'quatloos',
  • shipment-tracker-for-woocommerce/trunk/vendor/php-units-of-measure/php-units-of-measure/tests/phpunit.xml.dist

    r2844514 r3317812  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 
    3 <phpunit
    4     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    5     xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.4/phpunit.xsd"
    6     colors="true"
    7     verbose="true">
     2<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     3         xsi:noNamespaceSchemaLocation="../vendor/phpunit/phpunit/phpunit.xsd"
     4         colors="true"
     5         verbose="true"
     6         beStrictAboutTestsThatDoNotTestAnything="false"
     7>
    88
    99    <testsuites>
     
    1313    </testsuites>
    1414
    15     <filter>
    16         <blacklist>
    17             <directory suffix=".php">../vendor</directory>
    18         </blacklist>
    19         <whitelist>
     15    <coverage>
     16        <include>
    2017            <directory suffix=".php">../source</directory>
    21         </whitelist>
    22     </filter>
     18        </include>
     19        <exclude>
     20            <directory>../vendor</directory>
     21        </exclude>
     22        <report>
     23            <clover outputFile="clover.xml"/>
     24        </report>
     25    </coverage>
    2326
    24     <logging>
    25         <log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/>
    26     </logging>
    2727</phpunit>
Note: See TracChangeset for help on using the changeset viewer.