From 26663c822dc480e6dc9a0cee770fb328cce3cb45 Mon Sep 17 00:00:00 2001 From: Abdelrahman Omran Date: Sat, 22 Dec 2018 18:57:12 +0200 Subject: [PATCH 1/9] Fix MySQL / PostgreSQL json column compatibility --- CHANGELOG.md | 2 +- .../2017_01_19_040614_create_attributes_table.php | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index daedb4c..ce7ea38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ This project adheres to [Semantic Versioning](CONTRIBUTING.md). ## [v1.0.1] - 2018-12-22 - Update composer dependencies - Add PHP 7.3 support to travis -- Fix MySQL / PostgreSQL data type compatibility +- Fix MySQL / PostgreSQL json column compatibility ## [v1.0.0] - 2018-10-01 - Enforce Consistency diff --git a/database/migrations/2017_01_19_040614_create_attributes_table.php b/database/migrations/2017_01_19_040614_create_attributes_table.php index 0f21461..289feec 100644 --- a/database/migrations/2017_01_19_040614_create_attributes_table.php +++ b/database/migrations/2017_01_19_040614_create_attributes_table.php @@ -54,11 +54,7 @@ protected function jsonable(): string $driverName = DB::connection()->getPdo()->getAttribute(PDO::ATTR_DRIVER_NAME); $dbVersion = DB::connection()->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION); $isOldVersion = version_compare($dbVersion, '5.7.8', 'lt'); - - if ($driverName === 'mysql' && $isOldVersion) { - return 'text'; - } - - return 'json'; + + return $driverName === 'mysql' && $isOldVersion ? 'text' : 'json'; } } From 616452e2ac31714c48900294d06392f1e56fe013 Mon Sep 17 00:00:00 2001 From: Abdelrahman Omran Date: Sun, 23 Dec 2018 19:02:58 +0200 Subject: [PATCH 2/9] Rename environment variable QUEUE_DRIVER to QUEUE_CONNECTION --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 57730e9..5471025 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -37,7 +37,7 @@ - + From a2f17b40731cee482e6f1935a67486df9f084857 Mon Sep 17 00:00:00 2001 From: Abdelrahman Omran Date: Thu, 3 Jan 2019 08:05:03 +0200 Subject: [PATCH 3/9] Tweak and simplify FormRequest validations --- .travis.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 827f59f..76032b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,32 +1,32 @@ language: php php: - - 7.1 - - 7.2 - - 7.3 +- 7.1 +- 7.2 +- 7.3 env: matrix: - - COMPOSER_FLAGS="--prefer-lowest" - - COMPOSER_FLAGS="" + - COMPOSER_FLAGS="--prefer-lowest" + - COMPOSER_FLAGS="" cache: directories: - - $HOME/.composer/cache + - $HOME/.composer/cache before_script: - - travis_retry composer self-update - - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source +- travis_retry composer self-update +- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source script: - - vendor/phpunit/phpunit/phpunit --coverage-text --coverage-clover=coverage.clover +- vendor/phpunit/phpunit/phpunit --coverage-text --coverage-clover=coverage.clover after_script: - - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover coverage.clover +- wget https://scrutinizer-ci.com/ocular.phar +- php ocular.phar code-coverage:upload --format=php-clover coverage.clover notifications: email: false slack: rooms: - - secure: H+TE/kZPvRXXO1gvQYlAzgDnal/Cdvr83PUA60HUHWFvPBrBzR8ION8mzVPorl3PLCuDs7d6Afb8iUe6Rf3jGeOuVo9znJ/Ilpf3l2jPWpBL5JHaH9/G+3kDQbbMCxApWWTDkzBLsP4phDNDjJMT07buHYw57iF+OWvtu1rOU7o9pd+ARw3teshmLDcKNg26rJQMOEAghtxz33NfCDrSltpKGSrZXyUrbMw7NAYccpRGTZFFwMbEqxEmSnwDXGWuImr7ovZgP/BZ+xlY3Vt4v3pNCKFXayn+NpdR5aRYBXMLjHVeIciZ9YVGpsX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505736cfed77217c248c91fcf424acf Mon Sep 17 00:00:00 2001 From: Abdelrahman Omran Date: Sat, 2 Mar 2019 00:23:36 +0400 Subject: [PATCH 4/9] Update slack link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a42e28e..2f3580e 100644 --- a/README.md +++ b/README.md @@ -376,7 +376,7 @@ Refer to the [Changelog](CHANGELOG.md) for a full history of the project. The following support channels are available at your fingertips: -- [Chat on Slack](http://chat.rinvex.com) +- [Chat on Slack](https://bit.ly/rinvex-slack) - [Help on Email](mailto:help@rinvex.com) - [Follow on Twitter](https://twitter.com/rinvex) From 6c466e17fcc744e965ac99feafeebb9763706233 Mon Sep 17 00:00:00 2001 From: Abdelrahman Omran Date: Sat, 2 Mar 2019 16:12:31 +0400 Subject: [PATCH 5/9] Add support for Larastan --- phpstan.neon.dist | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 phpstan.neon.dist diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 0000000..72e57f4 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,6 @@ +includes: +- ./vendor/nunomaduro/larastan/extension.neon +parameters: + level: 5 + paths: + - src From 75ab47abed48e43faff51d62b7205d3b9c3c262b Mon Sep 17 00:00:00 2001 From: Abdelrahman Omran Date: Sat, 2 Mar 2019 16:12:38 +0400 Subject: [PATCH 6/9] Utilize support helpers --- src/Traits/Attributable.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Traits/Attributable.php b/src/Traits/Attributable.php index cb811d1..dca367a 100644 --- a/src/Traits/Attributable.php +++ b/src/Traits/Attributable.php @@ -6,7 +6,6 @@ use Schema; use Closure; -use Illuminate\Support\Arr; use SuperClosure\Serializer; use Rinvex\Attributes\Models\Value; use Rinvex\Attributes\Models\Attribute; @@ -99,7 +98,7 @@ public function relationsToArray() if (is_null($namespace = $this->getEntityAttributesNamespace())) { $attributes = array_merge($attributes, $eavAttributes); } else { - Arr::set($attributes, $namespace, $eavAttributes); + array_set($attributes, $namespace, $eavAttributes); } return $attributes; From 6ddc2124aa4babcac182d5f11cf09729ec2b407b Mon Sep 17 00:00:00 2001 From: Abdelrahman Omran Date: Sun, 3 Mar 2019 20:09:11 +0400 Subject: [PATCH 7/9] Require PHP 7.2 & Laravel 5.8 --- composer.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 8da2d51..103b109 100644 --- a/composer.json +++ b/composer.json @@ -48,23 +48,23 @@ } ], "require": { - "php": "^7.1.3", - "illuminate/console": "~5.7.0", - "illuminate/database": "~5.7.0", - "illuminate/support": "~5.7.0", + "php": "^7.2.0", + "illuminate/console": "~5.8.0", + "illuminate/database": "~5.8.0", + "illuminate/support": "~5.8.0", "jeremeamia/superclosure": "^2.4.0", - "rinvex/laravel-cacheable": "^1.0.0", - "rinvex/laravel-support": "^1.0.0", + "rinvex/laravel-cacheable": "^2.0.0", + "rinvex/laravel-support": "^2.0.0", "spatie/eloquent-sortable": "^3.4.0", "spatie/laravel-sluggable": "^2.1.0", "spatie/laravel-translatable": "^3.1.0", - "watson/validating": "^3.1.0" + "watson/validating": "^3.2.0" }, "require-dev": { - "codedungeon/phpunit-result-printer": "^0.23.0", - "illuminate/container": "~5.7.0", + "codedungeon/phpunit-result-printer": "^0.26.0", + "illuminate/container": "~5.8.0", "orchestra/testbench": "^3.6", - "phpunit/phpunit": "^7.0.0" + "phpunit/phpunit": "^8.0.0" }, "autoload": { "classmap": [ From abf673dc8a214d5709839216ee23fb0381a018b6 Mon Sep 17 00:00:00 2001 From: Abdelrahman Omran Date: Sun, 3 Mar 2019 20:09:22 +0400 Subject: [PATCH 8/9] Apply PHPUnit 8 updates --- tests/Feature/ServiceProviderTest.php | 2 +- tests/Feature/TestCase.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Feature/ServiceProviderTest.php b/tests/Feature/ServiceProviderTest.php index 29c59a9..17a00b2 100644 --- a/tests/Feature/ServiceProviderTest.php +++ b/tests/Feature/ServiceProviderTest.php @@ -43,6 +43,6 @@ public function it_has_provides_method() $msg = "Expected class '{$class}' to provide a valid list of services."; - $this->assertInternalType('array', $method->invoke(new $class(new Container())), $msg); + $this->assertIsArray($method->invoke(new $class(new Container())), $msg); } } diff --git a/tests/Feature/TestCase.php b/tests/Feature/TestCase.php index 8624ef0..1e80e3f 100644 --- a/tests/Feature/TestCase.php +++ b/tests/Feature/TestCase.php @@ -10,7 +10,7 @@ class TestCase extends \Orchestra\Testbench\TestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); From 1a3448905250cba15d99392c14481a50a7257f67 Mon Sep 17 00:00:00 2001 From: Abdelrahman Omran Date: Sun, 3 Mar 2019 20:55:58 +0400 Subject: [PATCH 9/9] Bump version --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce7ea38..48a0dc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](CONTRIBUTING.md). +## [v2.0.0] - 2019-03-03 +- Rename environment variable QUEUE_DRIVER to QUEUE_CONNECTION +- Require PHP 7.2 & Laravel 5.8 +- Apply PHPUnit 8 updates +- Tweak and simplify FormRequest validations +- Fix MySQL / PostgreSQL json column compatibility + ## [v1.0.1] - 2018-12-22 - Update composer dependencies - Add PHP 7.3 support to travis @@ -85,6 +92,7 @@ This project adheres to [Semantic Versioning](CONTRIBUTING.md). ## v0.0.1 - 2017-04-08 - Rename package to "rinvex/attributable" from "rinvex/sparse" based on 715a831 +[v2.0.0]: https://github.com/rinvex/laravel-attributes/compare/v1.0.1...v2.0.0 [v1.0.1]: https://github.com/rinvex/laravel-attributes/compare/v1.0.0...v1.0.1 [v1.0.0]: https://github.com/rinvex/laravel-attributes/compare/v0.0.7...v1.0.0 [v0.0.7]: https://github.com/rinvex/laravel-attributes/compare/v0.0.6...v0.0.7