From e97bef6d0f9a02e5482114b2879f40486408ea58 Mon Sep 17 00:00:00 2001 From: Sebastiaan Luca Date: Fri, 6 Sep 2019 16:57:52 +0200 Subject: [PATCH 1/2] Add support for Laravel 6.0 --- .travis.yml | 8 +++----- CHANGELOG.md | 6 +++++- composer.json | 22 +++++++++++++++++----- phpcs.xml.dist | 9 +++++++++ 4 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 phpcs.xml.dist diff --git a/.travis.yml b/.travis.yml index f3ee31c..965d110 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,8 @@ env: matrix: - LARAVEL_VERSION="5.8.*" COMPOSER_FLAGS="--prefer-lowest" - LARAVEL_VERSION="5.8.*" COMPOSER_FLAGS="--prefer-stable" + - LARAVEL_VERSION="^6.0" COMPOSER_FLAGS="--prefer-lowest" + - LARAVEL_VERSION="^6.0" COMPOSER_FLAGS="--prefer-stable" - LARAVEL_VERSION="dev-master" ORCHESTRA_VERSION="dev-master" COMPOSER_FLAGS="--prefer-lowest" MINIMUM_STABILITY="dev" - LARAVEL_VERSION="dev-master" ORCHESTRA_VERSION="dev-master" COMPOSER_FLAGS="--prefer-stable" MINIMUM_STABILITY="dev" @@ -34,13 +36,9 @@ install: - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-dist script: + - vendor/bin/phpcs --runtime-set ignore_warnings_on_exit 1 - vendor/bin/phpunit -branches: - only: - - master - - develop - notifications: email: on_failure: change diff --git a/CHANGELOG.md b/CHANGELOG.md index 6909835..00b96ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,11 @@ All Notable changes to `sebastiaanluca/laravel-boolean-dates` will be documented Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. -## Unreleased +## 3.0.0 (2019-09-06) + +### Added + +- Added support for Laravel 6.0 ## 2.0.2 (2019-03-08) diff --git a/composer.json b/composer.json index 6c8f36b..9e88b73 100644 --- a/composer.json +++ b/composer.json @@ -25,15 +25,16 @@ ], "require": { "php": "^7.2", - "dms/phpunit-arraysubset-asserts": "^0.1.0", - "laravel/framework": "5.8.*", + "laravel/framework": "5.8.*|^6.0", "nesbot/carbon": "^1.22|^2.0" }, "require-dev": { + "dms/phpunit-arraysubset-asserts": "^0.1.0", "kint-php/kint": "^3.1", "mockery/mockery": "^1.2", - "orchestra/testbench": "3.8.*", - "phpunit/phpunit": "^8.0" + "orchestra/testbench": "3.8.*|^4.0", + "phpunit/phpunit": "^8.3", + "sebastiaanluca/php-codesniffer-ruleset": "^0.4.2" }, "autoload": { "psr-4": { @@ -56,6 +57,9 @@ } }, "scripts": { + "composer-validate": "@composer validate --no-check-all --strict --ansi", + "codesniffer-check": "vendor/bin/phpcs --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1", + "codesniffer-fix": "vendor/bin/phpcbf --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 || exit 0", "test": "vendor/bin/phpunit", "test-lowest": [ "composer update --prefer-lowest --prefer-dist --no-interaction --ansi", @@ -64,6 +68,14 @@ "test-stable": [ "composer update --prefer-stable --prefer-dist --no-interaction --ansi", "@test" + ], + "check": [ + "@composer-validate", + "@codesniffer-check", + "@test" ] - } + }, + "minimum-stability": "dev", + "prefer-stable": true } + diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..5dacc60 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,9 @@ + + + + + ./src + ./tests + + + From 573596fc4a3a573c099187756cf0fb310f8d3028 Mon Sep 17 00:00:00 2001 From: Sebastiaan Luca Date: Fri, 6 Sep 2019 17:01:24 +0200 Subject: [PATCH 2/2] Fix code --- src/HasBooleanDates.php | 6 +++++- tests/TestCase.php | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/HasBooleanDates.php b/src/HasBooleanDates.php index 8d50425..615d03d 100644 --- a/src/HasBooleanDates.php +++ b/src/HasBooleanDates.php @@ -10,6 +10,8 @@ trait HasBooleanDates { /** * Initialize the trait. + * + * @return void */ public function initializeHasBooleanDates() : void { @@ -106,6 +108,8 @@ protected function getBooleanDate($key) : bool /** * @param string $key * @param mixed $value + * + * @return void */ protected function setBooleanDate(string $key, $value) : void { @@ -155,7 +159,7 @@ protected function getBooleanDateField($key) : string } /** - * @param $value + * @param mixed $value * * @return string|null */ diff --git a/tests/TestCase.php b/tests/TestCase.php index 6afa20c..0549332 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,5 +1,7 @@