From 52f845c1646a9cd9b3445202b00f1cb64cd66aea Mon Sep 17 00:00:00 2001 From: Oliver Schupp Date: Sun, 13 Feb 2022 22:18:10 +0100 Subject: [PATCH] Enable laravel 9 (#56) * feat: Enables Laravel 9 Closes #55 --- .github/workflows/unit_test.yml | 36 +++++++++++++++++++++++++++++++++ .gitignore | 1 + .travis.yml | 25 ----------------------- README.md | 13 +++++++----- composer.json | 8 ++++---- 5 files changed, 49 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/unit_test.yml delete mode 100755 .travis.yml diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml new file mode 100644 index 0000000..25bdd74 --- /dev/null +++ b/.github/workflows/unit_test.yml @@ -0,0 +1,36 @@ +on: [push, pull_request, workflow_dispatch] +jobs: + run: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: ['ubuntu-latest'] + php-versions: ['7.4', '8.0', '8.1'] + phpunit-versions: ['latest'] + include: + - operating-system: 'ubuntu-latest' + php-versions: '7.2' + phpunit-versions: '8.5.21' + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + ini-values: post_max_size=256M, max_execution_time=180 + tools: phpunit:${{ matrix.phpunit-versions }} + coverage: xdebug + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Cache composer dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer- + - name: Install Composer dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader + - name: Test with phpunit + run: vendor/bin/phpunit --coverage-text diff --git a/.gitignore b/.gitignore index 9c10d38..c13547b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ composer.phar composer.lock .DS_Store .idea +/.phpunit.result.cache diff --git a/.travis.yml b/.travis.yml deleted file mode 100755 index ef74da0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: php - -php: - - 7.2 - - 7.3 - - 7.4 - -env: - matrix: - - LARAVEL_VERSION=5.* - - LARAVEL_VERSION=6.* - - LARAVEL_VERSION=7.* - -matrix: - fast_finish: true - -sudo: false - -install: - - travis_retry composer install --no-interaction --prefer-source --no-suggest - - if [ "$LARAVEL_VERSION" != "" ]; then composer require --dev "laravel/framework:${LARAVEL_VERSION}" --no-update; fi; - - composer update - -script: - - $TRAVIS_BUILD_DIR/vendor/bin/phpunit diff --git a/README.md b/README.md index f8ef845..e500241 100755 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ PasswordStrength Package ================ -[![Build Status](https://travis-ci.org/schuppo/PasswordStrengthPackage.png?branch=2.x)](https://travis-ci.org/schuppo/PasswordStrengthPackage) +![Build Status](https://github.com/schuppo/PasswordStrengthPackage/actions/workflows/unit_test.yml/badge.svg) [![Total Downloads](https://poser.pugx.org/schuppo/password-strength/downloads)](https://packagist.org/packages/schuppo/password-strength) [![License](https://poser.pugx.org/schuppo/password-strength/license)](https://packagist.org/packages/schuppo/password-strength) -This package provides a validator that ensures strong passwords in Laravel 4, 5 & 6 applications. It is influenced a lot by [PasswordStrengthBundle for Symfony 2](https://github.com/jbafford/PasswordStrengthBundle). +This package provides a validator that ensures strong passwords in Laravel 4 - 9 applications. It is influenced a lot by [PasswordStrengthBundle for Symfony 2](https://github.com/jbafford/PasswordStrengthBundle). It is out now for a while and since there were no complaints it very likely fulfills its purpose. @@ -21,7 +21,7 @@ The provided validations include: ### Get the package -**For Laravel 6/7 users** +**For Laravel 6 - 9 users** > Requires PHP 7.1+ Just ```composer require schuppo/password-strength:"~2.0"```. @@ -40,7 +40,7 @@ Just ```composer require schuppo/password-strength:"~0.10"```. **Caution** -I recently recognized a small conflict in the usage of this package in combination with [unique-with](https://github.com/felixkiss/uniquewith-validator): One runs into problems when adding the ```PasswordStrengthServiceProvider``` **after** ```UniqueWithValidatorServiceProvider``` to the providers array, the rules of this package stay unknown to the Laravel ```Validator```. +I recognized a small conflict in the usage of this package in combination with [unique-with](https://github.com/felixkiss/uniquewith-validator): One runs into problems when adding the ```PasswordStrengthServiceProvider``` **after** ```UniqueWithValidatorServiceProvider``` to the providers array, the rules of this package stay unknown to the Laravel ```Validator```. The problem is easy to fix though: Just add the service provider of this package in front of the service provider of *unique-with*. In that order both packages work fine. @@ -67,7 +67,10 @@ Notice that you can validate any value with the new rules. The only reason why t # History -**[Laravel 6 / 7 / 8]** +**[Laravel 6 - 9]** + +**[2.5]** +- Added support for Laravel 9 **[2.4]** diff --git a/composer.json b/composer.json index c6b50a6..e64f3ec 100755 --- a/composer.json +++ b/composer.json @@ -12,16 +12,16 @@ "authors": [ { "name": "Oliver Schupp", - "email": "oliver.schupp@yahoo.de" + "email": "post@schuppo.io" } ], "require": { "php": ">=7.1.0", - "illuminate/support": "^5.1|^6.0|^7.0|^8.0", - "illuminate/translation": "^5.1|6.*|7.*|8.*" + "illuminate/support": "^5.1|^6.0|^7.0|^8.0|^9.0", + "illuminate/translation": "^5.1|6.*|7.*|8.*|9.*" }, "require-dev": { - "illuminate/validation": "~5.1|6.*|7.*|8.*", + "illuminate/validation": "~5.1|6.*|7.*|8.*|9.*", "phpunit/phpunit": "^6.0|^7.0|^8.0", "orchestra/testbench": "^3.5|^4.0|^5.0|^6.0" },