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+NpdR5aRYBXMLjHVeIciZ9YVGpsXrj9tsxkXmanbblfI/3KSMMTIG8t+4Bw+YR/SNhQNOvB6SvTDwdaqDHNS5yXxveXnrlWO30CV+GVUncodifO5uqi4MY7yF+oC6g/3Z0D2EpyytHoG/GmhgW0Ie+J2wF6dL8lZD4RF5Crc/+l6saz7VZWMfVuieLNuiQLMfNqEq6L9c0uZ7PZ1v8kuumFPZWxunwcOAF6kArX5vzPyCj1j6FDRwqtnA8z+pmJiUUfFJVbAs96pt4BKt3pQfAQikMLBk8Bm0QM50+r0mQZX1eRDhn2iYKYm/gogyIImeo43F9nVLhtN2QqEhfIn7scRFeSqHkFRWFHYP8Q89+M5NC0zge0+hjz4ZKk/YX1Slwz0u0SRsnPY= + - secure: H+TE/kZPvRXXO1gvQYlAzgDnal/Cdvr83PUA60HUHWFvPBrBzR8ION8mzVPorl3PLCuDs7d6Afb8iUe6Rf3jGeOuVo9znJ/Ilpf3l2jPWpBL5JHaH9/G+3kDQbbMCxApWWTDkzBLsP4phDNDjJMT07buHYw57iF+OWvtu1rOU7o9pd+ARw3teshmLDcKNg26rJQMOEAghtxz33NfCDrSltpKGSrZXyUrbMw7NAYccpRGTZFFwMbEqxEmSnwDXGWuImr7ovZgP/BZ+xlY3Vt4v3pNCKFXayn+NpdR5aRYBXMLjHVeIciZ9YVGpsXrj9tsxkXmanbblfI/3KSMMTIG8t+4Bw+YR/SNhQNOvB6SvTDwdaqDHNS5yXxveXnrlWO30CV+GVUncodifO5uqi4MY7yF+oC6g/3Z0D2EpyytHoG/GmhgW0Ie+J2wF6dL8lZD4RF5Crc/+l6saz7VZWMfVuieLNuiQLMfNqEq6L9c0uZ7PZ1v8kuumFPZWxunwcOAF6kArX5vzPyCj1j6FDRwqtnA8z+pmJiUUfFJVbAs96pt4BKt3pQfAQikMLBk8Bm0QM50+r0mQZX1eRDhn2iYKYm/gogyIImeo43F9nVLhtN2QqEhfIn7scRFeSqHkFRWFHYP8Q89+M5NC0zge0+hjz4ZKk/YX1Slwz0u0SRsnPY= diff --git a/CHANGELOG.md b/CHANGELOG.md index daedb4c..48a0dc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,17 @@ 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 -- Fix MySQL / PostgreSQL data type compatibility +- Fix MySQL / PostgreSQL json column compatibility ## [v1.0.0] - 2018-10-01 - Enforce Consistency @@ -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 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) 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": [ 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'; } } 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 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 @@ - + 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; 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();