From 0e115da493c9348a8163e72897982d00ac7b5909 Mon Sep 17 00:00:00 2001 From: Hari KT Date: Thu, 12 Dec 2019 12:20:22 +0530 Subject: [PATCH] upgrade phpunit and codesniffer --- composer.json | 4 ++-- src/RateAdapter.php | 4 +++- src/Ship.php | 6 ++++-- src/UPS/Rate.php | 2 +- tests/ArrTest.php | 4 +++- tests/Fedex/FedexTest.php | 4 ++-- tests/PackageDimensionsTest.php | 3 ++- tests/PackageTest.php | 4 +++- tests/QuoteTest.php | 3 ++- tests/RateAdapterTest.php | 4 +++- tests/ShipTest.php | 3 ++- tests/ShipmentTest.php | 4 +++- tests/UPS/RateTest.php | 3 ++- tests/USPS/RateTest.php | 3 ++- tests/ValidatorTest.php | 4 +++- 15 files changed, 37 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index 9f61f9d..0e4024f 100644 --- a/composer.json +++ b/composer.json @@ -15,8 +15,8 @@ } }, "require-dev": { - "phpunit/phpunit": "4.0.*", - "squizlabs/php_codesniffer": "1.5.5" + "phpunit/phpunit": "7.0.*", + "squizlabs/php_codesniffer": "3.5.*" }, "require": { "php": ">=5.4" diff --git a/src/RateAdapter.php b/src/RateAdapter.php index 087c0d9..d15d117 100644 --- a/src/RateAdapter.php +++ b/src/RateAdapter.php @@ -95,6 +95,8 @@ abstract class RateAdapter protected function sortByCost() { - uasort($this->rates, function ($a, $b) { return ($a->getCost() > $b->getCost());}); + uasort($this->rates, function ($a, $b) { + return ($a->getCost() > $b->getCost()); + }); } } diff --git a/src/Ship.php b/src/Ship.php index 570cc82..3ccdbff 100644 --- a/src/Ship.php +++ b/src/Ship.php @@ -139,8 +139,10 @@ class Ship return $display_rates; } - protected function sortByCost(& $rates) + protected function sortByCost(&$rates) { - uasort($rates, function ($a, $b) { return ($a->getCost() > $b->getCost());}); + uasort($rates, function ($a, $b) { + return ($a->getCost() > $b->getCost()); + }); } } diff --git a/src/UPS/Rate.php b/src/UPS/Rate.php index 8957021..13695cd 100644 --- a/src/UPS/Rate.php +++ b/src/UPS/Rate.php @@ -95,8 +95,8 @@ class Rate extends RateAdapter ]); $this->setRequestAdapter(Arr::get($options, 'requestAdapter', new RateRequest\Post())); - } + protected function validate() { $this->validatePackages(); diff --git a/tests/ArrTest.php b/tests/ArrTest.php index 706f4c9..cfc7291 100644 --- a/tests/ArrTest.php +++ b/tests/ArrTest.php @@ -1,7 +1,9 @@ new StubFedex, ]); $rateAdapter->getRates(); - } } diff --git a/tests/PackageDimensionsTest.php b/tests/PackageDimensionsTest.php index a6451fe..155548a 100644 --- a/tests/PackageDimensionsTest.php +++ b/tests/PackageDimensionsTest.php @@ -5,8 +5,9 @@ namespace pdt256\Shipping; use pdt256\Shipping\RateRequest\StubFedex; use pdt256\Shipping\RateRequest\StubUPS; use pdt256\Shipping\RateRequest\StubUSPS; +use PHPUnit\Framework\TestCase; -class PackageDimensionsValidationTrait extends \PHPUnit_Framework_TestCase +class PackageDimensionsValidationTrait extends TestCase { protected function getNormalPackage() { diff --git a/tests/PackageTest.php b/tests/PackageTest.php index 2407da6..4da2d6b 100644 --- a/tests/PackageTest.php +++ b/tests/PackageTest.php @@ -1,7 +1,9 @@