From e9162b20e9fc887c3c4917151935f9c0d11f3a7d Mon Sep 17 00:00:00 2001 From: Pierre Tondereau Date: Fri, 31 May 2019 10:47:26 +0200 Subject: [PATCH 01/16] Create FUNDING.yml --- .github/FUNDING.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..779dc52 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,9 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +custom: # Replace with a single custom sponsorship URL From eedc6674f031d172b155c4aba17e8b1a12849836 Mon Sep 17 00:00:00 2001 From: Pierre Tondereau Date: Mon, 19 Aug 2019 17:29:51 +0200 Subject: [PATCH 02/16] Update for Laravel 5.8. (#19) * Update for Laravel 5.8. * Update docs. * Update minimun PHP version. --- .gitignore | 3 +- .travis.yml | 132 ++++++++++++++++++---------------- README.md | 4 +- composer.json | 11 ++- src/UpsApiServiceProvider.php | 1 - 5 files changed, 77 insertions(+), 74 deletions(-) diff --git a/.gitignore b/.gitignore index 8925195..089088d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea vendor -composer.lock \ No newline at end of file +composer.lock +.phpunit.result.cache \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 1d541c7..169af4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,74 +1,80 @@ -language: php - -sudo: false +dist: xenial matrix: include: - - php: 5.5.9 - env: LARAVEL_VERSION=5.1.* - - php: 5.5.9 - env: LARAVEL_VERSION=5.2.* - - php: 5.5 - env: LARAVEL_VERSION=5.1.* - - php: 5.5 - env: LARAVEL_VERSION=5.2.* - - php: 5.6 - env: LARAVEL_VERSION=5.1.* - - php: 5.6 - env: LARAVEL_VERSION=5.2.* - - php: 5.6 - env: LARAVEL_VERSION=5.3.* - - php: 5.6 - env: LARAVEL_VERSION=5.4.* - - php: 7.0 - env: LARAVEL_VERSION=5.1.* - - php: 7.0 - env: LARAVEL_VERSION=5.2.* - - php: 7.0 - env: LARAVEL_VERSION=5.3.* - - php: 7.0 - env: LARAVEL_VERSION=5.4.* - - php: 7.0 - env: LARAVEL_VERSION=5.5.* - - php: 7.1 - env: LARAVEL_VERSION=5.1.* - - php: 7.1 - env: LARAVEL_VERSION=5.2.* - - php: 7.1 - env: LARAVEL_VERSION=5.3.* - - php: 7.1 - env: LARAVEL_VERSION=5.4.* - - php: 7.1 - env: LARAVEL_VERSION=5.5.* - - php: 7.1 - env: LARAVEL_VERSION=5.6.* - - php: 7.1 - env: LARAVEL_VERSION=5.7.* - - php: 7.2 - env: LARAVEL_VERSION=5.6.* - - php: 7.2 - env: LARAVEL_VERSION=5.7.* - - php: hhvm - env: LARAVEL_VERSION=5.1.* - - php: hhvm - env: LARAVEL_VERSION=5.2.* - - php: hhvm - env: LARAVEL_VERSION=5.3.* - - php: hhvm - env: LARAVEL_VERSION=5.4.* + - env: + - PHP_VERSION=7.1 + - LARAVEL_VERSION=5.5.* + - SYMFONY_VERSION=^3.0 + - PHPUNIT_VERSION=^6.5 + - env: + - PHP_VERSION=7.1 + - LARAVEL_VERSION=5.6.* + - SYMFONY_VERSION=^4.0 + - PHPUNIT_VERSION=^7.5 + - env: + - PHP_VERSION=7.1 + - LARAVEL_VERSION=5.7.* + - SYMFONY_VERSION=^4.0 + - PHPUNIT_VERSION=^7.5 + - env: + - PHP_VERSION=7.1 + - LARAVEL_VERSION=5.8.* + - SYMFONY_VERSION=^4.0 + - PHPUNIT_VERSION=^7.5 + - env: + - PHP_VERSION=7.2 + - LARAVEL_VERSION=5.5.* + - SYMFONY_VERSION=^3.0 + - PHPUNIT_VERSION=^6.5 + - env: + - PHP_VERSION=7.2 + - LARAVEL_VERSION=5.6.* + - SYMFONY_VERSION=^4.0 + - PHPUNIT_VERSION=^7.5 + - env: + - PHP_VERSION=7.2 + - LARAVEL_VERSION=5.7.* + - SYMFONY_VERSION=^4.0 + - PHPUNIT_VERSION=^7.5 + - env: + - PHP_VERSION=7.2 + - LARAVEL_VERSION=5.8.* + - SYMFONY_VERSION=^4.0 + - PHPUNIT_VERSION=^8.0 + - env: + - PHP_VERSION=7.3 + - LARAVEL_VERSION=5.5.* + - SYMFONY_VERSION=^3.0 + - PHPUNIT_VERSION=^6.5 + - env: + - PHP_VERSION=7.3 + - LARAVEL_VERSION=5.6.* + - SYMFONY_VERSION=^4.0 + - PHPUNIT_VERSION=^7.5 + - env: + - PHP_VERSION=7.3 + - LARAVEL_VERSION=5.7.* + - SYMFONY_VERSION=^4.0 + - PHPUNIT_VERSION=^7.5 + - env: + - PHP_VERSION=7.3 + - LARAVEL_VERSION=5.8.* + - SYMFONY_VERSION=^4.0 + - PHPUNIT_VERSION=^8.0 + before_install: - - if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then echo 'hhvm.jit = false' >> /etc/hhvm/php.ini ; fi - - composer self-update --stable -n - - composer require "laravel/framework:${LARAVEL_VERSION}" --no-update -n + - travis_retry docker pull registry.gitlab.com/grahamcampbell/php:$PHP_VERSION + - docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:$PHP_VERSION require "laravel/framework:${LARAVEL_VERSION}" --no-update -n + - docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:$PHP_VERSION require "symfony/lts:${SYMFONY_VERSION}" --no-update -n + - docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:$PHP_VERSION require "phpunit/phpunit:${PHPUNIT_VERSION}" --dev --no-update -n install: - - travis_retry composer install --no-suggest --prefer-dist -n -o + - travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:$PHP_VERSION install --no-suggest --prefer-dist -n -o script: - - if [ "$TRAVIS_PHP_VERSION" != "5.6" ]; then vendor/bin/phpunit; fi - - if [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then vendor/bin/phpunit --coverage-clover build/logs/clover.xml; fi + - docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit registry.gitlab.com/grahamcampbell/php:$PHP_VERSION --coverage-clover build/logs/clover.xml after_script: - - if [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi - - if [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi + - travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint ocular registry.gitlab.com/grahamcampbell/php:$PHP_VERSION code-coverage:upload --format=php-clover build/logs/clover.xml diff --git a/README.md b/README.md index 7afee87..ad45d20 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Laravel UPS Api ================= -## For Laravel 5.1+ +## For Laravel 5.5+ [![Build Status](https://travis-ci.org/ptondereau/Laravel-UPS-Api.svg?branch=master)](https://travis-ci.org/ptondereau/Laravel-UPS-Api) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ptondereau/Laravel-UPS-Api/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ptondereau/Laravel-UPS-Api/?branch=master) @@ -16,8 +16,6 @@ Laravel UPS Api was created by, and is maintained by [Pierre Tondereau](https:// ## Installation -Either [PHP](https://php.net) 5.5+ or [HHVM](http://hhvm.com) 3.6+ are required. - To get the latest version of Laravel UPS Api, simply require the project using [Composer](https://getcomposer.org): ```bash diff --git a/composer.json b/composer.json index 41fe237..aa6fc8d 100644 --- a/composer.json +++ b/composer.json @@ -3,15 +3,14 @@ "description": "A small Laravel's wrapper for the PHP UPS API library", "keywords": ["laravel", "framework", "UPS", "Laravel UPS Api", "Laravel-Ups-Api", "Pierre Tondereau", "Ptondereau"], "require": { - "php": ">=5.5.9", - "illuminate/contracts": "~5.1.0|~5.2.0|~5.3.0|~5.4.0|~5.5.0|~5.6.0|~5.7.0", - "illuminate/support": "~5.1.0|~5.2.0|~5.3.0|~5.4.0|~5.5.0|~5.6.0|~5.7.0", + "php": "^7.1.3", + "illuminate/contracts": "5.5.*|5.6.*|5.7.*|5.8.*", + "illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*", "gabrielbull/ups-api": "^0.7.6" }, "require-dev": { - "phpunit/phpunit": "^4.8|^5.0|^6.0|^7.0", - "graham-campbell/testbench": "^3.0|^4.0|^5.0", - "codeclimate/php-test-reporter": "^0.3.0" + "graham-campbell/analyzer": "^2.1", + "graham-campbell/testbench": "^5.2" }, "autoload": { "psr-4": { diff --git a/src/UpsApiServiceProvider.php b/src/UpsApiServiceProvider.php index d55340b..a41bef6 100644 --- a/src/UpsApiServiceProvider.php +++ b/src/UpsApiServiceProvider.php @@ -166,7 +166,6 @@ protected function registerRate() $config['user_id'], $config['password'], $config['sandbox'], - null, $app->make('log') ); }); From 4405275323b5570af9268462ca9ba6e40e2e755a Mon Sep 17 00:00:00 2001 From: Pierre Tondereau Date: Mon, 19 Aug 2019 17:50:28 +0200 Subject: [PATCH 03/16] Update to UPS-API 0.8. (#20) --- composer.json | 2 +- src/Facades/UpsAddressValidation.php | 7 +- src/Facades/UpsLocator.php | 7 +- src/Facades/UpsQuantumView.php | 7 +- src/Facades/UpsRate.php | 7 +- src/Facades/UpsRateTimeInTransit.php | 18 +++ src/Facades/UpsShipping.php | 7 +- src/Facades/UpsSimpleAddressValidation.php | 7 +- src/Facades/UpsTimeInTransit.php | 7 +- src/Facades/UpsTracking.php | 7 +- src/Facades/UpsTradeability.php | 7 +- src/UpsApiServiceProvider.php | 109 +++++------------- tests/Facades/UpsAddressValidationTest.php | 21 +--- tests/Facades/UpsLocatorTest.php | 21 +--- tests/Facades/UpsQuantumViewTest.php | 21 +--- tests/Facades/UpsRateTest.php | 21 +--- tests/Facades/UpsRateTimeInTransitTest.php | 33 ++++++ tests/Facades/UpsShippingTest.php | 21 +--- .../UpsSimpleAddressValidationTest.php | 21 +--- tests/Facades/UpsTimeInTransitTest.php | 21 +--- tests/Facades/UpsTrackingTest.php | 21 +--- tests/Facades/UpsTradeabilityTest.php | 21 +--- tests/ServiceProviderTest.php | 6 + 23 files changed, 125 insertions(+), 295 deletions(-) create mode 100644 src/Facades/UpsRateTimeInTransit.php create mode 100644 tests/Facades/UpsRateTimeInTransitTest.php diff --git a/composer.json b/composer.json index aa6fc8d..6498d98 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "php": "^7.1.3", "illuminate/contracts": "5.5.*|5.6.*|5.7.*|5.8.*", "illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*", - "gabrielbull/ups-api": "^0.7.6" + "gabrielbull/ups-api": "^0.8" }, "require-dev": { "graham-campbell/analyzer": "^2.1", diff --git a/src/Facades/UpsAddressValidation.php b/src/Facades/UpsAddressValidation.php index 732b0ae..2f660f1 100644 --- a/src/Facades/UpsAddressValidation.php +++ b/src/Facades/UpsAddressValidation.php @@ -11,12 +11,7 @@ */ class UpsAddressValidation extends Facade { - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() + protected static function getFacadeAccessor(): string { return 'ups.address-validation'; } diff --git a/src/Facades/UpsLocator.php b/src/Facades/UpsLocator.php index 7c6237e..8ec9f49 100644 --- a/src/Facades/UpsLocator.php +++ b/src/Facades/UpsLocator.php @@ -11,12 +11,7 @@ */ class UpsLocator extends Facade { - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() + protected static function getFacadeAccessor(): string { return 'ups.locator'; } diff --git a/src/Facades/UpsQuantumView.php b/src/Facades/UpsQuantumView.php index c821787..7b0b19e 100644 --- a/src/Facades/UpsQuantumView.php +++ b/src/Facades/UpsQuantumView.php @@ -11,12 +11,7 @@ */ class UpsQuantumView extends Facade { - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() + protected static function getFacadeAccessor(): string { return 'ups.quantum-view'; } diff --git a/src/Facades/UpsRate.php b/src/Facades/UpsRate.php index dd6a16b..c91c85b 100644 --- a/src/Facades/UpsRate.php +++ b/src/Facades/UpsRate.php @@ -11,12 +11,7 @@ */ class UpsRate extends Facade { - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() + protected static function getFacadeAccessor(): string { return 'ups.rate'; } diff --git a/src/Facades/UpsRateTimeInTransit.php b/src/Facades/UpsRateTimeInTransit.php new file mode 100644 index 0000000..59031b5 --- /dev/null +++ b/src/Facades/UpsRateTimeInTransit.php @@ -0,0 +1,18 @@ + + */ +class UpsRateTimeInTransit extends Facade +{ + protected static function getFacadeAccessor(): string + { + return 'ups.ratetimeintransit'; + } +} diff --git a/src/Facades/UpsShipping.php b/src/Facades/UpsShipping.php index 8130596..339bf02 100644 --- a/src/Facades/UpsShipping.php +++ b/src/Facades/UpsShipping.php @@ -11,12 +11,7 @@ */ class UpsShipping extends Facade { - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() + protected static function getFacadeAccessor(): string { return 'ups.shipping'; } diff --git a/src/Facades/UpsSimpleAddressValidation.php b/src/Facades/UpsSimpleAddressValidation.php index 31bf8d1..6d26bc2 100644 --- a/src/Facades/UpsSimpleAddressValidation.php +++ b/src/Facades/UpsSimpleAddressValidation.php @@ -11,12 +11,7 @@ */ class UpsSimpleAddressValidation extends Facade { - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() + protected static function getFacadeAccessor(): string { return 'ups.simple-address-validation'; } diff --git a/src/Facades/UpsTimeInTransit.php b/src/Facades/UpsTimeInTransit.php index 86cd079..421bfac 100644 --- a/src/Facades/UpsTimeInTransit.php +++ b/src/Facades/UpsTimeInTransit.php @@ -11,12 +11,7 @@ */ class UpsTimeInTransit extends Facade { - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() + protected static function getFacadeAccessor(): string { return 'ups.time-in-transit'; } diff --git a/src/Facades/UpsTracking.php b/src/Facades/UpsTracking.php index 7547681..3e166d6 100644 --- a/src/Facades/UpsTracking.php +++ b/src/Facades/UpsTracking.php @@ -11,12 +11,7 @@ */ class UpsTracking extends Facade { - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() + protected static function getFacadeAccessor(): string { return 'ups.tracking'; } diff --git a/src/Facades/UpsTradeability.php b/src/Facades/UpsTradeability.php index 9ca802f..eac1f5c 100644 --- a/src/Facades/UpsTradeability.php +++ b/src/Facades/UpsTradeability.php @@ -11,12 +11,7 @@ */ class UpsTradeability extends Facade { - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() + protected static function getFacadeAccessor(): string { return 'ups.tradeability'; } diff --git a/src/UpsApiServiceProvider.php b/src/UpsApiServiceProvider.php index a41bef6..5a81aee 100644 --- a/src/UpsApiServiceProvider.php +++ b/src/UpsApiServiceProvider.php @@ -10,6 +10,7 @@ use Ups\Locator; use Ups\QuantumView; use Ups\Rate; +use Ups\RateTimeInTransit; use Ups\Shipping; use Ups\SimpleAddressValidation; use Ups\TimeInTransit; @@ -23,22 +24,12 @@ */ class UpsApiServiceProvider extends ServiceProvider { - /** - * Boot the service provider. - * - * @return void - */ - public function boot() + public function boot(): void { $this->setupConfig(); } - /** - * Register the service provider. - * - * @return void - */ - public function register() + public function register(): void { $this->registerAddressValidation(); $this->registerSimpleAddressValidation(); @@ -49,14 +40,10 @@ public function register() $this->registerLocator(); $this->registerTradeability(); $this->registerShipping(); + $this->registerRateTimeInTransit(); } - /** - * Setup the config. - * - * @return void - */ - protected function setupConfig() + protected function setupConfig(): void { $source = realpath(__DIR__.'/../config/ups.php'); if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) { @@ -67,12 +54,7 @@ protected function setupConfig() $this->mergeConfigFrom($source, 'ups'); } - /** - * Register the AddressValidation class. - * - * @return void - */ - protected function registerAddressValidation() + protected function registerAddressValidation(): void { $this->app->singleton('ups.address-validation', function (Container $app) { $config = $app->config->get('ups'); @@ -88,12 +70,7 @@ protected function registerAddressValidation() }); } - /** - * Register the SimpleAddressValidation class. - * - * @return void - */ - protected function registerSimpleAddressValidation() + protected function registerSimpleAddressValidation(): void { $this->app->singleton('ups.simple-address-validation', function (Container $app) { $config = $app->config->get('ups'); @@ -109,12 +86,7 @@ protected function registerSimpleAddressValidation() }); } - /** - * Register the QuantumView class. - * - * @return void - */ - protected function registerQuantumView() + protected function registerQuantumView(): void { $this->app->singleton('ups.quantum-view', function (Container $app) { $config = $app->config->get('ups'); @@ -130,12 +102,7 @@ protected function registerQuantumView() }); } - /** - * Register the Tracking class. - * - * @return void - */ - protected function registerTracking() + protected function registerTracking(): void { $this->app->singleton('ups.tracking', function (Container $app) { $config = $app->config->get('ups'); @@ -151,12 +118,7 @@ protected function registerTracking() }); } - /** - * Register the Rate class. - * - * @return void - */ - protected function registerRate() + protected function registerRate(): void { $this->app->singleton('ups.rate', function (Container $app) { $config = $app->config->get('ups'); @@ -171,12 +133,7 @@ protected function registerRate() }); } - /** - * Register the TimeInTransit class. - * - * @return void - */ - protected function registerTimeInTransit() + protected function registerTimeInTransit(): void { $this->app->singleton('ups.time-in-transit', function (Container $app) { $config = $app->config->get('ups'); @@ -192,12 +149,7 @@ protected function registerTimeInTransit() }); } - /** - * Register the Locator class. - * - * @return void - */ - protected function registerLocator() + protected function registerLocator(): void { $this->app->singleton('ups.locator', function (Container $app) { $config = $app->config->get('ups'); @@ -213,12 +165,7 @@ protected function registerLocator() }); } - /** - * Register the Tradeability class. - * - * @return void - */ - protected function registerTradeability() + protected function registerTradeability(): void { $this->app->singleton('ups.tradeability', function (Container $app) { $config = $app->config->get('ups'); @@ -234,12 +181,7 @@ protected function registerTradeability() }); } - /** - * Register the Tradeability class. - * - * @return void - */ - protected function registerShipping() + protected function registerShipping(): void { $this->app->singleton('ups.shipping', function (Container $app) { $config = $app->config->get('ups'); @@ -255,12 +197,22 @@ protected function registerShipping() }); } - /** - * Get the services provided by the provider. - * - * @return string[] - */ - public function provides() + protected function registerRateTimeInTransit(): void + { + $this->app->singleton('ups.ratetimeintransit', function (Container $app) { + $config = $app->config->get('ups'); + + return new RateTimeInTransit( + $config['access_key'], + $config['user_id'], + $config['password'], + $config['sandbox'], + $app->make('log') + ); + }); + } + + public function provides(): array { return [ 'ups.address-validation', @@ -272,6 +224,7 @@ public function provides() 'ups.locator', 'ups.tradeability', 'ups.shipping', + 'ups.ratetimeintransit', ]; } } diff --git a/tests/Facades/UpsAddressValidationTest.php b/tests/Facades/UpsAddressValidationTest.php index 1b7c902..24bd89c 100644 --- a/tests/Facades/UpsAddressValidationTest.php +++ b/tests/Facades/UpsAddressValidationTest.php @@ -16,32 +16,17 @@ class UpsAddressValidationTest extends TestCase { use FacadeTrait; - /** - * Get the facade accessor. - * - * @return string - */ - protected function getFacadeAccessor() + protected function getFacadeAccessor(): string { return 'ups.address-validation'; } - /** - * Get the facade class. - * - * @return string - */ - protected function getFacadeClass() + protected function getFacadeClass(): string { return UpsAddressValidation::class; } - /** - * Get the facade root. - * - * @return string - */ - protected function getFacadeRoot() + protected function getFacadeRoot(): string { return AddressValidation::class; } diff --git a/tests/Facades/UpsLocatorTest.php b/tests/Facades/UpsLocatorTest.php index 2773bb4..7350eb2 100644 --- a/tests/Facades/UpsLocatorTest.php +++ b/tests/Facades/UpsLocatorTest.php @@ -16,32 +16,17 @@ class UpsLocatorTest extends TestCase { use FacadeTrait; - /** - * Get the facade accessor. - * - * @return string - */ - protected function getFacadeAccessor() + protected function getFacadeAccessor(): string { return 'ups.locator'; } - /** - * Get the facade class. - * - * @return string - */ - protected function getFacadeClass() + protected function getFacadeClass(): string { return UpsLocator::class; } - /** - * Get the facade root. - * - * @return string - */ - protected function getFacadeRoot() + protected function getFacadeRoot(): string { return Locator::class; } diff --git a/tests/Facades/UpsQuantumViewTest.php b/tests/Facades/UpsQuantumViewTest.php index ca80b33..044e81a 100644 --- a/tests/Facades/UpsQuantumViewTest.php +++ b/tests/Facades/UpsQuantumViewTest.php @@ -16,32 +16,17 @@ class UpsQuantumViewTest extends TestCase { use FacadeTrait; - /** - * Get the facade accessor. - * - * @return string - */ - protected function getFacadeAccessor() + protected function getFacadeAccessor(): string { return 'ups.quantum-view'; } - /** - * Get the facade class. - * - * @return string - */ - protected function getFacadeClass() + protected function getFacadeClass(): string { return UpsQuantumView::class; } - /** - * Get the facade root. - * - * @return string - */ - protected function getFacadeRoot() + protected function getFacadeRoot(): string { return QuantumView::class; } diff --git a/tests/Facades/UpsRateTest.php b/tests/Facades/UpsRateTest.php index 4df1c31..f291160 100644 --- a/tests/Facades/UpsRateTest.php +++ b/tests/Facades/UpsRateTest.php @@ -16,32 +16,17 @@ class UpsRateTest extends TestCase { use FacadeTrait; - /** - * Get the facade accessor. - * - * @return string - */ - protected function getFacadeAccessor() + protected function getFacadeAccessor(): string { return 'ups.rate'; } - /** - * Get the facade class. - * - * @return string - */ - protected function getFacadeClass() + protected function getFacadeClass(): string { return UpsRate::class; } - /** - * Get the facade root. - * - * @return string - */ - protected function getFacadeRoot() + protected function getFacadeRoot(): string { return Rate::class; } diff --git a/tests/Facades/UpsRateTimeInTransitTest.php b/tests/Facades/UpsRateTimeInTransitTest.php new file mode 100644 index 0000000..09a0774 --- /dev/null +++ b/tests/Facades/UpsRateTimeInTransitTest.php @@ -0,0 +1,33 @@ + + */ +class UpsRateTimeInTransitTest extends TestCase +{ + use FacadeTrait; + + protected function getFacadeAccessor(): string + { + return 'ups.ratetimeintransit'; + } + + protected function getFacadeClass(): string + { + return UpsRateTimeInTransit::class; + } + + protected function getFacadeRoot(): string + { + return RateTimeInTransit::class; + } +} diff --git a/tests/Facades/UpsShippingTest.php b/tests/Facades/UpsShippingTest.php index a9dff83..c5e4dfd 100644 --- a/tests/Facades/UpsShippingTest.php +++ b/tests/Facades/UpsShippingTest.php @@ -16,32 +16,17 @@ class UpsShippingTest extends TestCase { use FacadeTrait; - /** - * Get the facade accessor. - * - * @return string - */ - protected function getFacadeAccessor() + protected function getFacadeAccessor(): string { return 'ups.shipping'; } - /** - * Get the facade class. - * - * @return string - */ - protected function getFacadeClass() + protected function getFacadeClass(): string { return UpsShipping::class; } - /** - * Get the facade root. - * - * @return string - */ - protected function getFacadeRoot() + protected function getFacadeRoot(): string { return Shipping::class; } diff --git a/tests/Facades/UpsSimpleAddressValidationTest.php b/tests/Facades/UpsSimpleAddressValidationTest.php index f8046da..ee05896 100644 --- a/tests/Facades/UpsSimpleAddressValidationTest.php +++ b/tests/Facades/UpsSimpleAddressValidationTest.php @@ -16,32 +16,17 @@ class UpsSimpleAddressValidationTest extends TestCase { use FacadeTrait; - /** - * Get the facade accessor. - * - * @return string - */ - protected function getFacadeAccessor() + protected function getFacadeAccessor(): string { return 'ups.simple-address-validation'; } - /** - * Get the facade class. - * - * @return string - */ - protected function getFacadeClass() + protected function getFacadeClass(): string { return UpsSimpleAddressValidation::class; } - /** - * Get the facade root. - * - * @return string - */ - protected function getFacadeRoot() + protected function getFacadeRoot(): string { return SimpleAddressValidation::class; } diff --git a/tests/Facades/UpsTimeInTransitTest.php b/tests/Facades/UpsTimeInTransitTest.php index 74c5bd7..c077c50 100644 --- a/tests/Facades/UpsTimeInTransitTest.php +++ b/tests/Facades/UpsTimeInTransitTest.php @@ -16,32 +16,17 @@ class UpsTimeInTransitTest extends TestCase { use FacadeTrait; - /** - * Get the facade accessor. - * - * @return string - */ - protected function getFacadeAccessor() + protected function getFacadeAccessor(): string { return 'ups.time-in-transit'; } - /** - * Get the facade class. - * - * @return string - */ - protected function getFacadeClass() + protected function getFacadeClass(): string { return UpsTimeInTransit::class; } - /** - * Get the facade root. - * - * @return string - */ - protected function getFacadeRoot() + protected function getFacadeRoot(): string { return TimeInTransit::class; } diff --git a/tests/Facades/UpsTrackingTest.php b/tests/Facades/UpsTrackingTest.php index a835894..53bab76 100644 --- a/tests/Facades/UpsTrackingTest.php +++ b/tests/Facades/UpsTrackingTest.php @@ -16,32 +16,17 @@ class UpsTrackingTest extends TestCase { use FacadeTrait; - /** - * Get the facade accessor. - * - * @return string - */ - protected function getFacadeAccessor() + protected function getFacadeAccessor(): string { return 'ups.tracking'; } - /** - * Get the facade class. - * - * @return string - */ - protected function getFacadeClass() + protected function getFacadeClass(): string { return UpsTracking::class; } - /** - * Get the facade root. - * - * @return string - */ - protected function getFacadeRoot() + protected function getFacadeRoot(): string { return Tracking::class; } diff --git a/tests/Facades/UpsTradeabilityTest.php b/tests/Facades/UpsTradeabilityTest.php index 59665b7..e910dbf 100644 --- a/tests/Facades/UpsTradeabilityTest.php +++ b/tests/Facades/UpsTradeabilityTest.php @@ -16,32 +16,17 @@ class UpsTradeabilityTest extends TestCase { use FacadeTrait; - /** - * Get the facade accessor. - * - * @return string - */ - protected function getFacadeAccessor() + protected function getFacadeAccessor(): string { return 'ups.tradeability'; } - /** - * Get the facade class. - * - * @return string - */ - protected function getFacadeClass() + protected function getFacadeClass(): string { return UpsTradeability::class; } - /** - * Get the facade root. - * - * @return string - */ - protected function getFacadeRoot() + protected function getFacadeRoot(): string { return Tradeability::class; } diff --git a/tests/ServiceProviderTest.php b/tests/ServiceProviderTest.php index f9c4499..587ce0d 100644 --- a/tests/ServiceProviderTest.php +++ b/tests/ServiceProviderTest.php @@ -7,6 +7,7 @@ use Ups\Locator; use Ups\QuantumView; use Ups\Rate; +use Ups\RateTimeInTransit; use Ups\Shipping; use Ups\SimpleAddressValidation; use Ups\TimeInTransit; @@ -66,4 +67,9 @@ public function testShippingIsInjectable() { $this->assertIsInjectable(Shipping::class); } + + public function testRateTimeInTransitIsInjectable() + { + $this->assertIsInjectable(RateTimeInTransit::class); + } } From 6c6686b7c927802f36d825202ad4c309bf0ff1b2 Mon Sep 17 00:00:00 2001 From: Pierre Tondereau Date: Mon, 19 Aug 2019 18:13:56 +0200 Subject: [PATCH 04/16] Update FUNDING.yml --- .github/FUNDING.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 779dc52..da2fe68 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,9 +1,4 @@ # These are supported funding model platforms -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -custom: # Replace with a single custom sponsorship URL +github: [ptondereau] +custom: https://www.paypal.me/ptondereau From fc7b3ac5075e4cd867e9fbcca9e6bbd9a9b109f9 Mon Sep 17 00:00:00 2001 From: Pierre Tondereau Date: Tue, 3 Sep 2019 16:17:57 +0200 Subject: [PATCH 05/16] Support Laravel 6.0. --- .travis.yml | 10 ++++++++++ README.md | 19 ++++++++++--------- composer.json | 4 ++-- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 169af4c..a84e7d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,6 +42,11 @@ matrix: - LARAVEL_VERSION=5.8.* - SYMFONY_VERSION=^4.0 - PHPUNIT_VERSION=^8.0 + - env: + - PHP_VERSION=7.2 + - LARAVEL_VERSION=^6.0 + - SYMFONY_VERSION=^4.0 + - PHPUNIT_VERSION=^8.0 - env: - PHP_VERSION=7.3 - LARAVEL_VERSION=5.5.* @@ -62,6 +67,11 @@ matrix: - LARAVEL_VERSION=5.8.* - SYMFONY_VERSION=^4.0 - PHPUNIT_VERSION=^8.0 + - env: + - PHP_VERSION=7.3 + - LARAVEL_VERSION=^6.0 + - SYMFONY_VERSION=^4.0 + - PHPUNIT_VERSION=^8.0 before_install: diff --git a/README.md b/README.md index ad45d20..e294411 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Laravel UPS Api ================= -## For Laravel 5.5+ +## For Laravel 5.5+ or 6 [![Build Status](https://travis-ci.org/ptondereau/Laravel-UPS-Api.svg?branch=master)](https://travis-ci.org/ptondereau/Laravel-UPS-Api) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ptondereau/Laravel-UPS-Api/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ptondereau/Laravel-UPS-Api/?branch=master) @@ -38,14 +38,15 @@ Once Laravel UPS Api is installed, you need to register the service provider. Op You can register the all or some Ups facade in the `aliases` key of your `config/app.php` file if you like. -* `'UPSAddressValidator' => 'Ptondereau\LaravelUpsApi\Facades\UpsAddressValidator'` -* `'UPSLocator' => 'Ptondereau\LaravelUpsApi\Facades\UpsLocator'` -* `'UPSQuantumView' => 'Ptondereau\LaravelUpsApi\Facades\UpsQuantumView'` -* `'UPSRate' => 'Ptondereau\LaravelUpsApi\Facades\UpsRate'` -* `'UPSTimeInTransit' => 'Ptondereau\LaravelUpsApi\Facades\UpsTimeInTransit'` -* `'UPSTracking' => 'Ptondereau\LaravelUpsApi\Facades\UpsTracking'` -* `'UPSTradeability' => 'Ptondereau\LaravelUpsApi\Facades\UpsTradeability'` -* `'UPSShipping' => 'Ptondereau\LaravelUpsApi\Facades\UpsShipping'` +* `'UpsAddressValidator' => 'Ptondereau\LaravelUpsApi\Facades\UpsAddressValidator'` +* `'UpsLocator' => 'Ptondereau\LaravelUpsApi\Facades\UpsLocator'` +* `'UpsQuantumView' => 'Ptondereau\LaravelUpsApi\Facades\UpsQuantumView'` +* `'UpsRate' => 'Ptondereau\LaravelUpsApi\Facades\UpsRate'` +* `'UpsTimeInTransit' => 'Ptondereau\LaravelUpsApi\Facades\UpsTimeInTransit'` +* `'UpsTracking' => 'Ptondereau\LaravelUpsApi\Facades\UpsTracking'` +* `'UpsTradeability' => 'Ptondereau\LaravelUpsApi\Facades\UpsTradeability'` +* `'UpsShipping' => 'Ptondereau\LaravelUpsApi\Facades\UpsShipping'` +* `'UpsRateInTransit' => 'Ptondereau\LaravelUpsApi\Facades\UpsRateInTransit'` diff --git a/composer.json b/composer.json index 6498d98..7c64ec4 100644 --- a/composer.json +++ b/composer.json @@ -4,8 +4,8 @@ "keywords": ["laravel", "framework", "UPS", "Laravel UPS Api", "Laravel-Ups-Api", "Pierre Tondereau", "Ptondereau"], "require": { "php": "^7.1.3", - "illuminate/contracts": "5.5.*|5.6.*|5.7.*|5.8.*", - "illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*", + "illuminate/contracts": "^5.5|^6.0", + "illuminate/support": "^5.5|^6.0", "gabrielbull/ups-api": "^0.8" }, "require-dev": { From b7570debd44885aa9b5004266f487eb35009d9ad Mon Sep 17 00:00:00 2001 From: djfrailey Date: Thu, 28 May 2020 10:43:14 -0700 Subject: [PATCH 06/16] Add support for Laravel 7 (#22) Co-authored-by: David Frailey --- .travis.yml | 10 ++++++++++ composer.json | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a84e7d7..5158ac8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,6 +47,11 @@ matrix: - LARAVEL_VERSION=^6.0 - SYMFONY_VERSION=^4.0 - PHPUNIT_VERSION=^8.0 + - env: + - PHP_VERSION=7.2 + - LARAVEL_VERSION=^7.0 + - SYMFONY_VERSION=^4.0 + - PHPUNIT_VERSION=^8.0 - env: - PHP_VERSION=7.3 - LARAVEL_VERSION=5.5.* @@ -72,6 +77,11 @@ matrix: - LARAVEL_VERSION=^6.0 - SYMFONY_VERSION=^4.0 - PHPUNIT_VERSION=^8.0 + - env: + - PHP_VERSION=7.3 + - LARAVEL_VERSION=^7.0 + - SYMFONY_VERSION=^4.0 + - PHPUNIT_VERSION=^8.0 before_install: diff --git a/composer.json b/composer.json index 7c64ec4..3f33978 100644 --- a/composer.json +++ b/composer.json @@ -4,8 +4,8 @@ "keywords": ["laravel", "framework", "UPS", "Laravel UPS Api", "Laravel-Ups-Api", "Pierre Tondereau", "Ptondereau"], "require": { "php": "^7.1.3", - "illuminate/contracts": "^5.5|^6.0", - "illuminate/support": "^5.5|^6.0", + "illuminate/contracts": "^5.5|^6.0|^7.0", + "illuminate/support": "^5.5|^6.0|^7.0", "gabrielbull/ups-api": "^0.8" }, "require-dev": { From a1119aae50e115a418ba6180cb47503f523a43af Mon Sep 17 00:00:00 2001 From: Pierre Tondereau Date: Thu, 28 May 2020 19:46:37 +0200 Subject: [PATCH 07/16] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e294411..bc5c338 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Laravel UPS Api ================= -## For Laravel 5.5+ or 6 +## For Laravel 5.5,6 and 7 [![Build Status](https://travis-ci.org/ptondereau/Laravel-UPS-Api.svg?branch=master)](https://travis-ci.org/ptondereau/Laravel-UPS-Api) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ptondereau/Laravel-UPS-Api/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ptondereau/Laravel-UPS-Api/?branch=master) @@ -84,7 +84,7 @@ There are other classes in this package that are not documented here. This is be ## Security -If you discover a security vulnerability within this package, please send an e-mail to Pierre Tondereau at me@pierre-tondereau.com. All security vulnerabilities will be promptly addressed. +If you discover a security vulnerability within this package, please send an e-mail to Pierre Tondereau at pierre.tondereau@gmail.com. All security vulnerabilities will be promptly addressed. ## License From bc8dced11c535dd2a941da734a2047653ad9cda7 Mon Sep 17 00:00:00 2001 From: Pierre Tondereau Date: Fri, 11 Sep 2020 11:25:25 +0200 Subject: [PATCH 08/16] Laravel 8 (#23) --- .github/workflows/test.yml | 75 ++++++++++++++++++++++++++++ .travis.yml | 100 ------------------------------------- LICENSE | 2 +- README.md | 19 ++++--- composer.json | 11 ++-- 5 files changed, 91 insertions(+), 116 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..47fe0e9 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,75 @@ +name: Tests + +on: + push: + pull_request: + +jobs: + tests: + name: PHP ${{ matrix.php }}; Laravel ${{ matrix.laravel }} + runs-on: ubuntu-20.04 + + strategy: + matrix: + php: ['7.2', '7.3', '7.4', '8.0'] + laravel: ['6', '7', '8'] + exclude: + - php: '7.2' + laravel: '8' + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer:v2 + coverage: none + + - name: Setup Problem Matchers + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Select Laravel 6 + uses: nick-invision/retry@v1 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer require "laravel/framework:6.*" --no-update --no-interaction + if: "matrix.laravel == '6'" + + - name: Select Laravel 7 + uses: nick-invision/retry@v1 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer require "laravel/framework:7.*" --no-update --no-interaction + if: "matrix.laravel == '7'" + + - name: Select Laravel 8 + uses: nick-invision/retry@v1 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer require "laravel/framework:8.*" --no-update --no-interaction + if: "matrix.laravel == '8'" + + - name: Install PHP 7 Dependencies + uses: nick-invision/retry@v1 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --no-interaction --no-progress + if: "matrix.php < 8" + + - name: Install PHP 8 Dependencies + uses: nick-invision/retry@v1 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --no-interaction --no-progress --ignore-platform-req=php + if: "matrix.php >= 8" + + - name: Execute PHPUnit + run: vendor/bin/phpunit \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5158ac8..0000000 --- a/.travis.yml +++ /dev/null @@ -1,100 +0,0 @@ -dist: xenial - -matrix: - include: - - env: - - PHP_VERSION=7.1 - - LARAVEL_VERSION=5.5.* - - SYMFONY_VERSION=^3.0 - - PHPUNIT_VERSION=^6.5 - - env: - - PHP_VERSION=7.1 - - LARAVEL_VERSION=5.6.* - - SYMFONY_VERSION=^4.0 - - PHPUNIT_VERSION=^7.5 - - env: - - PHP_VERSION=7.1 - - LARAVEL_VERSION=5.7.* - - SYMFONY_VERSION=^4.0 - - PHPUNIT_VERSION=^7.5 - - env: - - PHP_VERSION=7.1 - - LARAVEL_VERSION=5.8.* - - SYMFONY_VERSION=^4.0 - - PHPUNIT_VERSION=^7.5 - - env: - - PHP_VERSION=7.2 - - LARAVEL_VERSION=5.5.* - - SYMFONY_VERSION=^3.0 - - PHPUNIT_VERSION=^6.5 - - env: - - PHP_VERSION=7.2 - - LARAVEL_VERSION=5.6.* - - SYMFONY_VERSION=^4.0 - - PHPUNIT_VERSION=^7.5 - - env: - - PHP_VERSION=7.2 - - LARAVEL_VERSION=5.7.* - - SYMFONY_VERSION=^4.0 - - PHPUNIT_VERSION=^7.5 - - env: - - PHP_VERSION=7.2 - - LARAVEL_VERSION=5.8.* - - SYMFONY_VERSION=^4.0 - - PHPUNIT_VERSION=^8.0 - - env: - - PHP_VERSION=7.2 - - LARAVEL_VERSION=^6.0 - - SYMFONY_VERSION=^4.0 - - PHPUNIT_VERSION=^8.0 - - env: - - PHP_VERSION=7.2 - - LARAVEL_VERSION=^7.0 - - SYMFONY_VERSION=^4.0 - - PHPUNIT_VERSION=^8.0 - - env: - - PHP_VERSION=7.3 - - LARAVEL_VERSION=5.5.* - - SYMFONY_VERSION=^3.0 - - PHPUNIT_VERSION=^6.5 - - env: - - PHP_VERSION=7.3 - - LARAVEL_VERSION=5.6.* - - SYMFONY_VERSION=^4.0 - - PHPUNIT_VERSION=^7.5 - - env: - - PHP_VERSION=7.3 - - LARAVEL_VERSION=5.7.* - - SYMFONY_VERSION=^4.0 - - PHPUNIT_VERSION=^7.5 - - env: - - PHP_VERSION=7.3 - - LARAVEL_VERSION=5.8.* - - SYMFONY_VERSION=^4.0 - - PHPUNIT_VERSION=^8.0 - - env: - - PHP_VERSION=7.3 - - LARAVEL_VERSION=^6.0 - - SYMFONY_VERSION=^4.0 - - PHPUNIT_VERSION=^8.0 - - env: - - PHP_VERSION=7.3 - - LARAVEL_VERSION=^7.0 - - SYMFONY_VERSION=^4.0 - - PHPUNIT_VERSION=^8.0 - - -before_install: - - travis_retry docker pull registry.gitlab.com/grahamcampbell/php:$PHP_VERSION - - docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:$PHP_VERSION require "laravel/framework:${LARAVEL_VERSION}" --no-update -n - - docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:$PHP_VERSION require "symfony/lts:${SYMFONY_VERSION}" --no-update -n - - docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:$PHP_VERSION require "phpunit/phpunit:${PHPUNIT_VERSION}" --dev --no-update -n - -install: - - travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint composer registry.gitlab.com/grahamcampbell/php:$PHP_VERSION install --no-suggest --prefer-dist -n -o - -script: - - docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit registry.gitlab.com/grahamcampbell/php:$PHP_VERSION --coverage-clover build/logs/clover.xml - -after_script: - - travis_retry docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint ocular registry.gitlab.com/grahamcampbell/php:$PHP_VERSION code-coverage:upload --format=php-clover build/logs/clover.xml diff --git a/LICENSE b/LICENSE index 082c61b..2918195 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Pierre Tondereau +Copyright (c) 2020 Pierre Tondereau Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index bc5c338..65b95f4 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,15 @@ Laravel UPS Api ================= -## For Laravel 5.5,6 and 7 - -[![Build Status](https://travis-ci.org/ptondereau/Laravel-UPS-Api.svg?branch=master)](https://travis-ci.org/ptondereau/Laravel-UPS-Api) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ptondereau/Laravel-UPS-Api/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ptondereau/Laravel-UPS-Api/?branch=master) -[![Test Coverage](https://codeclimate.com/github/ptondereau/Laravel-UPS-Api/badges/coverage.svg)](https://codeclimate.com/github/ptondereau/Laravel-UPS-Api/coverage) -[![Code Climate](https://codeclimate.com/github/ptondereau/Laravel-UPS-Api/badges/gpa.svg)](https://codeclimate.com/github/ptondereau/Laravel-UPS-Api) -[![StyleCI](https://styleci.io/repos/54156171/shield)](https://styleci.io/repos/54156171) -[![Latest Stable Version](https://poser.pugx.org/ptondereau/laravel-ups-api/v/stable)](https://packagist.org/packages/Ptondereau/laravel-ups-api) -[![Latest Unstable Version](https://poser.pugx.org/ptondereau/laravel-ups-api/v/unstable)](https://packagist.org/packages/Ptondereau/laravel-ups-api) -[![License](https://poser.pugx.org/ptondereau/laravel-ups-api/license)](https://packagist.org/packages/Ptondereau/laravel-ups-api) +## For Laravel 6, 7 and 8 + +

+Build Status +StyleCI Status +Software License +Packagist Downloads +Latest Version +

Laravel UPS Api was created by, and is maintained by [Pierre Tondereau](https://github.com/ptondereau), and PHP UPS Api was created by, and is maintained by [Gabriel Bull](https://github.com/gabrielbull) at [PHP UPS API](https://github.com/gabrielbull/php-ups-api). diff --git a/composer.json b/composer.json index 3f33978..03850b7 100644 --- a/composer.json +++ b/composer.json @@ -3,14 +3,15 @@ "description": "A small Laravel's wrapper for the PHP UPS API library", "keywords": ["laravel", "framework", "UPS", "Laravel UPS Api", "Laravel-Ups-Api", "Pierre Tondereau", "Ptondereau"], "require": { - "php": "^7.1.3", - "illuminate/contracts": "^5.5|^6.0|^7.0", - "illuminate/support": "^5.5|^6.0|^7.0", + "php": "^7.2.5 || ^8.0", + "illuminate/contracts": "^6.0 || ^7.0 || ^8.0", + "illuminate/support": "^6.0 || ^7.0 || ^8.0", "gabrielbull/ups-api": "^0.8" }, "require-dev": { - "graham-campbell/analyzer": "^2.1", - "graham-campbell/testbench": "^5.2" + "graham-campbell/analyzer": "^3.0", + "graham-campbell/testbench": "^5.4", + "phpunit/phpunit": "^8.5.8 || ^9.3.7" }, "autoload": { "psr-4": { From d78fb06bf05831d4945df7e33969f6d1119c9f6f Mon Sep 17 00:00:00 2001 From: Pierre Tondereau Date: Tue, 15 Sep 2020 15:25:07 +0200 Subject: [PATCH 09/16] chore(deps): Update gabrielbull/ups-api to v1.2.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 03850b7..4a3f1fe 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "php": "^7.2.5 || ^8.0", "illuminate/contracts": "^6.0 || ^7.0 || ^8.0", "illuminate/support": "^6.0 || ^7.0 || ^8.0", - "gabrielbull/ups-api": "^0.8" + "gabrielbull/ups-api": "^1.2" }, "require-dev": { "graham-campbell/analyzer": "^3.0", From a69f7cb30452fca6e6a121702291ac2e201f0528 Mon Sep 17 00:00:00 2001 From: Pierre Tondereau Date: Tue, 6 Oct 2020 15:38:45 +0200 Subject: [PATCH 10/16] Create CONTRIBUTING.md (#24) --- CONTRIBUTING.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..5d3a6ed --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,32 @@ +# CONTRIBUTING + +Contributions are welcome, and are accepted via pull requests. Please review these guidelines before submitting any pull requests. + +## Guidelines + +* Please follow the [PSR-12 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) and [PHP-FIG Naming Conventions](https://github.com/php-fig/fig-standards/blob/master/bylaws/002-psr-naming-conventions.md). +* Ensure that the current tests pass, and if you've added something new, add the tests where relevant. +* Remember that we follow [SemVer](http://semver.org). If you are changing the behaviour, or the public api, you may need to update the docs. +* Send a coherent commit history, making sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash](http://git-scm.com/book/en/Git-Tools-Rewriting-History) them before submitting. +* You may also need to [rebase](http://git-scm.com/book/en/Git-Branching-Rebasing) to avoid merge conflicts. + + +## Running Tests + +You will need an install of [Composer](https://getcomposer.org) before continuing. + +First, install the dependencies: + +```bash +$ composer install +``` + +Then run phpunit: + +```bash +$ vendor/bin/phpunit +``` + +If the test suite passes on your local machine you should be good to go. + +When you make a pull request, the tests will automatically be run on multiple php versions. From df3f9a953eba58d33e58c64e99f0c09a3ff1ea84 Mon Sep 17 00:00:00 2001 From: Pierre Tondereau Date: Thu, 13 May 2021 21:23:14 +0200 Subject: [PATCH 11/16] chore(deps): bump gabrielbull/ups-api v2 --- .github/workflows/test.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 47fe0e9..9a7d095 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ on: jobs: tests: name: PHP ${{ matrix.php }}; Laravel ${{ matrix.laravel }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: diff --git a/composer.json b/composer.json index 4a3f1fe..08ada5e 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "php": "^7.2.5 || ^8.0", "illuminate/contracts": "^6.0 || ^7.0 || ^8.0", "illuminate/support": "^6.0 || ^7.0 || ^8.0", - "gabrielbull/ups-api": "^1.2" + "gabrielbull/ups-api": "^1.2.2 || ^2.0" }, "require-dev": { "graham-campbell/analyzer": "^3.0", From c690c7fc8f690165f526e81bb79f3d00c605e78a Mon Sep 17 00:00:00 2001 From: Pierre Tondereau Date: Thu, 13 May 2021 21:29:41 +0200 Subject: [PATCH 12/16] chore: Update tests. --- phpunit.xml | 28 ---------------------------- phpunit.xml.dist | 30 ++++++++++++++++++++++++++++++ tests/TestCase.php | 4 +--- 3 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 phpunit.xml create mode 100644 phpunit.xml.dist diff --git a/phpunit.xml b/phpunit.xml deleted file mode 100644 index de76cb5..0000000 --- a/phpunit.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - ./tests - - - - - ./src - - - \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..2a51e90 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,30 @@ + + + + + ./src + + + + + ./tests + + + diff --git a/tests/TestCase.php b/tests/TestCase.php index 29d6992..f553ad4 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -15,11 +15,9 @@ abstract class TestCase extends AbstractPackageTestCase /** * Get the service provider class. * - * @param \Illuminate\Contracts\Foundation\Application $app - * * @return string */ - protected function getServiceProviderClass($app) + protected function getServiceProviderClass(): string { return UpsApiServiceProvider::class; } From 7841eea39b6450094b85c03af69eb2431058fad2 Mon Sep 17 00:00:00 2001 From: Pierre Tondereau Date: Thu, 17 Feb 2022 15:50:28 +0000 Subject: [PATCH 13/16] Update for Laravel 9. (#27) --- .github/workflows/test.yml | 27 ++++++++++++++++++--------- README.md | 2 +- composer.json | 6 +++--- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9a7d095..5de0810 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,15 +7,25 @@ on: jobs: tests: name: PHP ${{ matrix.php }}; Laravel ${{ matrix.laravel }} - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: - php: ['7.2', '7.3', '7.4', '8.0'] - laravel: ['6', '7', '8'] + php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ] + laravel: [ '6', '7', '8', '9' ] exclude: - php: '7.2' laravel: '8' + - php: '7.2' + laravel: '9' + - php: '7.3' + laravel: '9' + - php: '7.4' + laravel: '9' + - php: '8.1' + laravel: '6' + - php: '8.1' + laravel: '7' steps: - name: Checkout Code @@ -55,21 +65,20 @@ jobs: command: composer require "laravel/framework:8.*" --no-update --no-interaction if: "matrix.laravel == '8'" - - name: Install PHP 7 Dependencies + - name: Select Laravel 9 uses: nick-invision/retry@v1 with: timeout_minutes: 5 max_attempts: 5 - command: composer update --no-interaction --no-progress - if: "matrix.php < 8" + command: composer require "laravel/framework:9.*" --no-update --no-interaction + if: "matrix.laravel == '9'" - - name: Install PHP 8 Dependencies + - name: Install PHP Dependencies uses: nick-invision/retry@v1 with: timeout_minutes: 5 max_attempts: 5 - command: composer update --no-interaction --no-progress --ignore-platform-req=php - if: "matrix.php >= 8" + command: composer update --no-interaction --no-progress - name: Execute PHPUnit run: vendor/bin/phpunit \ No newline at end of file diff --git a/README.md b/README.md index 65b95f4..b4acaed 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Laravel UPS Api ================= -## For Laravel 6, 7 and 8 +## For Laravel 6, 7, 8 and 9

Build Status diff --git a/composer.json b/composer.json index 08ada5e..a3b862c 100644 --- a/composer.json +++ b/composer.json @@ -4,13 +4,13 @@ "keywords": ["laravel", "framework", "UPS", "Laravel UPS Api", "Laravel-Ups-Api", "Pierre Tondereau", "Ptondereau"], "require": { "php": "^7.2.5 || ^8.0", - "illuminate/contracts": "^6.0 || ^7.0 || ^8.0", - "illuminate/support": "^6.0 || ^7.0 || ^8.0", + "illuminate/contracts": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0", "gabrielbull/ups-api": "^1.2.2 || ^2.0" }, "require-dev": { "graham-campbell/analyzer": "^3.0", - "graham-campbell/testbench": "^5.4", + "graham-campbell/testbench": "^5.7", "phpunit/phpunit": "^8.5.8 || ^9.3.7" }, "autoload": { From b08bf09ea2b61efc85421df8bce438cbead9900b Mon Sep 17 00:00:00 2001 From: Ian Conway <43120665+icweb@users.noreply.github.com> Date: Mon, 18 Jul 2022 09:04:22 -0400 Subject: [PATCH 14/16] fix typos in readme and config (#28) --- README.md | 7 +++---- config/ups.php | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b4acaed..f546629 100644 --- a/README.md +++ b/README.md @@ -30,14 +30,13 @@ Instead, you may of course manually update your require block and run `composer } } ``` - -Once Laravel UPS Api is installed, you need to register the service provider. Open up `config/app.php` and add the following to the `providers` key. +The `UpsApiServiceProvider` is auto-discovered and registered by default. If needed, you may register it manually by opening up `config/app.php` and adding the following to the `providers` key. * `'Ptondereau\LaravelUpsApi\UpsApiServiceProvider'` -You can register the all or some Ups facade in the `aliases` key of your `config/app.php` file if you like. +You can register all or some of the Ups facades in the `aliases` key of your `config/app.php` file if you like. -* `'UpsAddressValidator' => 'Ptondereau\LaravelUpsApi\Facades\UpsAddressValidator'` +* `'UpsAddressValidation' => 'Ptondereau\LaravelUpsApi\Facades\UpsAddressValidation'` * `'UpsLocator' => 'Ptondereau\LaravelUpsApi\Facades\UpsLocator'` * `'UpsQuantumView' => 'Ptondereau\LaravelUpsApi\Facades\UpsQuantumView'` * `'UpsRate' => 'Ptondereau\LaravelUpsApi\Facades\UpsRate'` diff --git a/config/ups.php b/config/ups.php index 4020270..451d803 100644 --- a/config/ups.php +++ b/config/ups.php @@ -7,7 +7,7 @@ |-------------------------------------------------------------------------- | | This option specifies the UPS credentials for your account. - | You can put it here but I strongly recommend to put thoses settings into your + | You can put it here but I strongly recommend to put those settings into your | .env & .env.example file. | */ From 81757e0b87842b9a0284205436acab561ae4d755 Mon Sep 17 00:00:00 2001 From: Ed Hanton <104428735+ed-hanton-swytch@users.noreply.github.com> Date: Tue, 13 Jun 2023 15:31:12 +0100 Subject: [PATCH 15/16] Support laravel 10 (#29) * Support laravel 10 * Update tests for laravel 10 * Update README.md for Laravel 10 * Only support supported laravel versions (8-10) * upgrade phpunit * Fix tests as per test-bench upgrade guide * upgrade minimum php version --- .github/workflows/test.yml | 44 +++++++------------ README.md | 2 +- composer.json | 12 ++--- tests/Facades/UpsAddressValidationTest.php | 6 +-- tests/Facades/UpsLocatorTest.php | 6 +-- tests/Facades/UpsQuantumViewTest.php | 6 +-- tests/Facades/UpsRateTest.php | 6 +-- tests/Facades/UpsRateTimeInTransitTest.php | 6 +-- tests/Facades/UpsShippingTest.php | 6 +-- .../UpsSimpleAddressValidationTest.php | 6 +-- tests/Facades/UpsTimeInTransitTest.php | 6 +-- tests/Facades/UpsTrackingTest.php | 6 +-- tests/Facades/UpsTradeabilityTest.php | 6 +-- tests/TestCase.php | 2 +- 14 files changed, 53 insertions(+), 67 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5de0810..13c6541 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,21 +11,15 @@ jobs: strategy: matrix: - php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ] - laravel: [ '6', '7', '8', '9' ] + php: [ '7.4', '8.0', '8.1' ] + laravel: [ '8', '9', '10' ] exclude: - - php: '7.2' - laravel: '8' - - php: '7.2' - laravel: '9' - - php: '7.3' - laravel: '9' - php: '7.4' laravel: '9' - - php: '8.1' - laravel: '6' - - php: '8.1' - laravel: '7' + - php: '7.4' + laravel: '10' + - php: '8.0' + laravel: '10' steps: - name: Checkout Code @@ -41,22 +35,6 @@ jobs: - name: Setup Problem Matchers run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Select Laravel 6 - uses: nick-invision/retry@v1 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer require "laravel/framework:6.*" --no-update --no-interaction - if: "matrix.laravel == '6'" - - - name: Select Laravel 7 - uses: nick-invision/retry@v1 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer require "laravel/framework:7.*" --no-update --no-interaction - if: "matrix.laravel == '7'" - - name: Select Laravel 8 uses: nick-invision/retry@v1 with: @@ -72,6 +50,14 @@ jobs: max_attempts: 5 command: composer require "laravel/framework:9.*" --no-update --no-interaction if: "matrix.laravel == '9'" + + - name: Select Laravel 10 + uses: nick-invision/retry@v1 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer require "laravel/framework:10.*" --no-update --no-interaction + if: "matrix.laravel == '10'" - name: Install PHP Dependencies uses: nick-invision/retry@v1 @@ -81,4 +67,4 @@ jobs: command: composer update --no-interaction --no-progress - name: Execute PHPUnit - run: vendor/bin/phpunit \ No newline at end of file + run: vendor/bin/phpunit diff --git a/README.md b/README.md index f546629..6001f18 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Laravel UPS Api ================= -## For Laravel 6, 7, 8 and 9 +## For Laravel 8, 9 and 10

Build Status diff --git a/composer.json b/composer.json index a3b862c..f68e909 100644 --- a/composer.json +++ b/composer.json @@ -3,15 +3,15 @@ "description": "A small Laravel's wrapper for the PHP UPS API library", "keywords": ["laravel", "framework", "UPS", "Laravel UPS Api", "Laravel-Ups-Api", "Pierre Tondereau", "Ptondereau"], "require": { - "php": "^7.2.5 || ^8.0", - "illuminate/contracts": "^6.0 || ^7.0 || ^8.0 || ^9.0", - "illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "php": "^7.4.15 || ^8.0", + "illuminate/contracts": "^8.0 || ^9.0 || ^10.0", + "illuminate/support": "^8.0 || ^9.0 || ^10.0", "gabrielbull/ups-api": "^1.2.2 || ^2.0" }, "require-dev": { - "graham-campbell/analyzer": "^3.0", - "graham-campbell/testbench": "^5.7", - "phpunit/phpunit": "^8.5.8 || ^9.3.7" + "graham-campbell/analyzer": "^4.0", + "graham-campbell/testbench": "^6.0", + "phpunit/phpunit": "^9.3.7" }, "autoload": { "psr-4": { diff --git a/tests/Facades/UpsAddressValidationTest.php b/tests/Facades/UpsAddressValidationTest.php index 24bd89c..e7704a4 100644 --- a/tests/Facades/UpsAddressValidationTest.php +++ b/tests/Facades/UpsAddressValidationTest.php @@ -16,17 +16,17 @@ class UpsAddressValidationTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.address-validation'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsAddressValidation::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return AddressValidation::class; } diff --git a/tests/Facades/UpsLocatorTest.php b/tests/Facades/UpsLocatorTest.php index 7350eb2..055582c 100644 --- a/tests/Facades/UpsLocatorTest.php +++ b/tests/Facades/UpsLocatorTest.php @@ -16,17 +16,17 @@ class UpsLocatorTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.locator'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsLocator::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return Locator::class; } diff --git a/tests/Facades/UpsQuantumViewTest.php b/tests/Facades/UpsQuantumViewTest.php index 044e81a..2b84e2a 100644 --- a/tests/Facades/UpsQuantumViewTest.php +++ b/tests/Facades/UpsQuantumViewTest.php @@ -16,17 +16,17 @@ class UpsQuantumViewTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.quantum-view'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsQuantumView::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return QuantumView::class; } diff --git a/tests/Facades/UpsRateTest.php b/tests/Facades/UpsRateTest.php index f291160..62e5235 100644 --- a/tests/Facades/UpsRateTest.php +++ b/tests/Facades/UpsRateTest.php @@ -16,17 +16,17 @@ class UpsRateTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.rate'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsRate::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return Rate::class; } diff --git a/tests/Facades/UpsRateTimeInTransitTest.php b/tests/Facades/UpsRateTimeInTransitTest.php index 09a0774..ee25444 100644 --- a/tests/Facades/UpsRateTimeInTransitTest.php +++ b/tests/Facades/UpsRateTimeInTransitTest.php @@ -16,17 +16,17 @@ class UpsRateTimeInTransitTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.ratetimeintransit'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsRateTimeInTransit::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return RateTimeInTransit::class; } diff --git a/tests/Facades/UpsShippingTest.php b/tests/Facades/UpsShippingTest.php index c5e4dfd..ed993a3 100644 --- a/tests/Facades/UpsShippingTest.php +++ b/tests/Facades/UpsShippingTest.php @@ -16,17 +16,17 @@ class UpsShippingTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.shipping'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsShipping::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return Shipping::class; } diff --git a/tests/Facades/UpsSimpleAddressValidationTest.php b/tests/Facades/UpsSimpleAddressValidationTest.php index ee05896..dc8c4a3 100644 --- a/tests/Facades/UpsSimpleAddressValidationTest.php +++ b/tests/Facades/UpsSimpleAddressValidationTest.php @@ -16,17 +16,17 @@ class UpsSimpleAddressValidationTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.simple-address-validation'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsSimpleAddressValidation::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return SimpleAddressValidation::class; } diff --git a/tests/Facades/UpsTimeInTransitTest.php b/tests/Facades/UpsTimeInTransitTest.php index c077c50..4b9a485 100644 --- a/tests/Facades/UpsTimeInTransitTest.php +++ b/tests/Facades/UpsTimeInTransitTest.php @@ -16,17 +16,17 @@ class UpsTimeInTransitTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.time-in-transit'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsTimeInTransit::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return TimeInTransit::class; } diff --git a/tests/Facades/UpsTrackingTest.php b/tests/Facades/UpsTrackingTest.php index 53bab76..eaedcf2 100644 --- a/tests/Facades/UpsTrackingTest.php +++ b/tests/Facades/UpsTrackingTest.php @@ -16,17 +16,17 @@ class UpsTrackingTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.tracking'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsTracking::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return Tracking::class; } diff --git a/tests/Facades/UpsTradeabilityTest.php b/tests/Facades/UpsTradeabilityTest.php index e910dbf..8c813e9 100644 --- a/tests/Facades/UpsTradeabilityTest.php +++ b/tests/Facades/UpsTradeabilityTest.php @@ -16,17 +16,17 @@ class UpsTradeabilityTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.tradeability'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsTradeability::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return Tradeability::class; } diff --git a/tests/TestCase.php b/tests/TestCase.php index f553ad4..138c8c9 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -17,7 +17,7 @@ abstract class TestCase extends AbstractPackageTestCase * * @return string */ - protected function getServiceProviderClass(): string + protected static function getServiceProviderClass(): string { return UpsApiServiceProvider::class; } From 22119bc20895094fe7d4e3a523e140049d2f0ca9 Mon Sep 17 00:00:00 2001 From: Brandon Martus Date: Mon, 20 May 2024 09:11:41 -0400 Subject: [PATCH 16/16] L11 support (#31) * L11 support * add 8.3 for testing * update phpunit and other dependencies * remove old php and laravel support * Update README.md Docs update * php reqs --- .github/workflows/test.yml | 32 ++++++++++---------------------- README.md | 2 +- composer.json | 12 ++++++------ phpunit.xml.dist | 29 ++++++----------------------- 4 files changed, 23 insertions(+), 52 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 13c6541..1e782c1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,15 +11,11 @@ jobs: strategy: matrix: - php: [ '7.4', '8.0', '8.1' ] - laravel: [ '8', '9', '10' ] + php: [ '8.1', '8.2', '8.3' ] + laravel: [ '10', '11' ] exclude: - - php: '7.4' - laravel: '9' - - php: '7.4' - laravel: '10' - - php: '8.0' - laravel: '10' + - php: '8.1' + laravel: '11' steps: - name: Checkout Code @@ -35,29 +31,21 @@ jobs: - name: Setup Problem Matchers run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Select Laravel 8 + - name: Select Laravel 10 uses: nick-invision/retry@v1 with: timeout_minutes: 5 max_attempts: 5 - command: composer require "laravel/framework:8.*" --no-update --no-interaction - if: "matrix.laravel == '8'" + command: composer require "laravel/framework:10.*" --no-update --no-interaction + if: "matrix.laravel == '10'" - - name: Select Laravel 9 - uses: nick-invision/retry@v1 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer require "laravel/framework:9.*" --no-update --no-interaction - if: "matrix.laravel == '9'" - - - name: Select Laravel 10 + - name: Select Laravel 11 uses: nick-invision/retry@v1 with: timeout_minutes: 5 max_attempts: 5 - command: composer require "laravel/framework:10.*" --no-update --no-interaction - if: "matrix.laravel == '10'" + command: composer require "laravel/framework:11.*" --no-update --no-interaction + if: "matrix.laravel == '11'" - name: Install PHP Dependencies uses: nick-invision/retry@v1 diff --git a/README.md b/README.md index 6001f18..5b2ee1f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Laravel UPS Api ================= -## For Laravel 8, 9 and 10 +## For Laravel 10 and 11

Build Status diff --git a/composer.json b/composer.json index f68e909..9dfb52d 100644 --- a/composer.json +++ b/composer.json @@ -3,15 +3,15 @@ "description": "A small Laravel's wrapper for the PHP UPS API library", "keywords": ["laravel", "framework", "UPS", "Laravel UPS Api", "Laravel-Ups-Api", "Pierre Tondereau", "Ptondereau"], "require": { - "php": "^7.4.15 || ^8.0", - "illuminate/contracts": "^8.0 || ^9.0 || ^10.0", - "illuminate/support": "^8.0 || ^9.0 || ^10.0", + "php": "^8.1 || ^8.2 || ^8.3", + "illuminate/contracts": "^8.0 || ^9.0 || ^10.0 || ^11.0", + "illuminate/support": "^8.0 || ^9.0 || ^10.0 || ^11.0", "gabrielbull/ups-api": "^1.2.2 || ^2.0" }, "require-dev": { - "graham-campbell/analyzer": "^4.0", - "graham-campbell/testbench": "^6.0", - "phpunit/phpunit": "^9.3.7" + "graham-campbell/analyzer": "^4.1", + "graham-campbell/testbench": "^6.1", + "phpunit/phpunit": "^10.5.20" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2a51e90..a286814 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,30 +1,13 @@ - - - - ./src - - + ./tests + + + ./src + +