From f5dacaf507d89d2b6d995532f521d8355661ba37 Mon Sep 17 00:00:00 2001 From: balazsbencs <69797681+balazsbencs@users.noreply.github.com> Date: Fri, 12 Mar 2021 11:49:41 +0100 Subject: [PATCH 1/4] Update composer.json Upgrading to Laravel version 6 --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 479a5bc..070d831 100755 --- a/composer.json +++ b/composer.json @@ -22,14 +22,14 @@ ], "require": { "php": ">=7.1.3", - "illuminate/database": "~5", - "illuminate/support": "~5" + "illuminate/database": "~6", + "illuminate/support": "~6" }, "require-dev": { "mockery/mockery": "^1.1", - "orchestra/testbench": "~3.0|~3.6|~3.7", - "phpmd/phpmd": "^2.6", - "phpunit/phpunit": "^7.3" + "orchestra/testbench": "~3.0|~3.6|~3.7|~4.0", + "phpmd/phpmd": "^2.6|^2.7|^2.8|^2.9", + "phpunit/phpunit": "^7.3|^8.0|^9.0" }, "autoload": { "classmap": [ From 81db80763930d85f2025dbf5b6f5b7f0e6ab6d61 Mon Sep 17 00:00:00 2001 From: balazsbencs <69797681+balazsbencs@users.noreply.github.com> Date: Fri, 12 Mar 2021 11:52:07 +0100 Subject: [PATCH 2/4] Update composer.json Upgrading PHP version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 070d831..f614540 100755 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ } ], "require": { - "php": ">=7.1.3", + "php": ">=7.2.5", "illuminate/database": "~6", "illuminate/support": "~6" }, From 9ab2e059cc0de5074bb663938270faa66a90005a Mon Sep 17 00:00:00 2001 From: bencsb Date: Thu, 1 Apr 2021 14:29:39 +0200 Subject: [PATCH 3/4] fix: replace array_random because of deprecated status --- tests/fixtures/database/factories/AddressFactory.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/fixtures/database/factories/AddressFactory.php b/tests/fixtures/database/factories/AddressFactory.php index 24a7e4e..e2a391f 100755 --- a/tests/fixtures/database/factories/AddressFactory.php +++ b/tests/fixtures/database/factories/AddressFactory.php @@ -3,6 +3,7 @@ use Faker\Generator as Faker; use Stylers\Address\Models\Address; use Stylers\Address\Enums\AddressTypeEnum; +use Illuminate\Support\Arr; /* |-------------------------------------------------------------------------- @@ -18,7 +19,7 @@ /** @var \Illuminate\Database\Eloquent\Factory $factory */ $factory->define(Address::class, function (Faker $faker) { return [ - 'type' => array_random(AddressTypeEnum::getConstants()), + 'type' => Arr::random(AddressTypeEnum::getConstants()), 'country' => $faker->country, 'country_code' => $faker->countryCode, 'zip_code' => $faker->postcode, From a76edd0b9cc53c1bb0e307f72027aed104c982f3 Mon Sep 17 00:00:00 2001 From: bencsb Date: Thu, 1 Apr 2021 14:34:22 +0200 Subject: [PATCH 4/4] fix: replace array_sort --- src/Enums/AbstractEnum.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Enums/AbstractEnum.php b/src/Enums/AbstractEnum.php index 511cdba..a006222 100755 --- a/src/Enums/AbstractEnum.php +++ b/src/Enums/AbstractEnum.php @@ -2,6 +2,7 @@ namespace Stylers\Address\Enums; +use Illuminate\Support\Arr; use Stylers\Address\Contracts\Enums\EnumInterface; use \ReflectionClass; @@ -13,6 +14,6 @@ public static function getConstants(): array $reflection = new ReflectionClass($class); $constants = $reflection->getConstants(); - return array_sort($constants); + return Arr::sort($constants); } }