From 6cc418188cb45c5b27585c92a0ae3da8d8ea65b2 Mon Sep 17 00:00:00 2001 From: Jamiel <20553479+jamielsharief@users.noreply.github.com> Date: Mon, 4 Jan 2021 10:45:31 +0100 Subject: [PATCH] Bumped min PHP version to 7.3 and PHPUnit 9.2 --- .coveralls.yml | 2 +- .gitattributes | 22 ++++++++--------- .github/workflows/ci.yml | 47 +++++++++++++++++++++++++++++++++++++ .gitignore | 2 +- .travis.yml | 18 -------------- CHANGELOG.md | 9 ++++++- LICENSE.md | 4 ++-- README.md | 4 ++-- composer.json | 6 ++--- src/ValidateTrait.php | 5 ++-- src/Validation.php | 2 +- src/Validator.php | 2 +- tests/ValidateTraitTest.php | 2 +- tests/ValidationTest.php | 2 +- tests/ValidatorTest.php | 2 +- 15 files changed, 81 insertions(+), 48 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.coveralls.yml b/.coveralls.yml index fa53839..4224888 100644 --- a/.coveralls.yml +++ b/.coveralls.yml @@ -1,3 +1,3 @@ service_name: travis-ci coverage_clover: clover.xml # file generated by phpunit -json_path: coverage.json # file generated by php-coveralls \ No newline at end of file +json_path: coverage.json # file generated by php-coveralls diff --git a/.gitattributes b/.gitattributes index 51bfd4b..b20cb92 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,12 +1,10 @@ -/tests export-ignore -/phpunit.xml.dist export-ignore -/phpcs.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore -/.travis.yml export-ignore -/.coveralls.yml export-ignore -/phpunit.xml.dist export-ignore -/phpcs.xml.dist export-ignore -/LICENSE.md export-ignore -/CHANGELOG.md export-ignore -/README.md export-ignore \ No newline at end of file +tests export-ignore +phpunit.xml.dist export-ignore +phpcs.xml.dist export-ignore +.gitattributes export-ignore +.gitignore export-ignore +.coveralls.yml export-ignore +phpunit.xml.dist export-ignore +phpcs.xml.dist export-ignore +CHANGELOG.md export-ignore +README.md export-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e1bf205 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +# +# OriginPHP Framework +# Copyright 2021 Jamiel Sharief. +# +# Licensed under The MIT License +# The above copyright notice and this permission notice shall be included in all copies or substantial +# portions of the Software. +# +# @copyright Copyright (c) Jamiel Sharief +# @link https://www.originphp.com +# @license https://opensource.org/licenses/mit-license.php MIT License +# +name: CI +on: + push: +jobs: + tests: + name: "PHP ${{ matrix.php-version }}" + runs-on: "ubuntu-latest" + strategy: + matrix: + php-version: + - "7.3" + - "7.4" + - "8.0" + steps: + - name: Checkout source code + uses: "actions/checkout@v2" + - name: Install PHP + uses: "shivammathur/setup-php@v2" + with: + coverage: "xdebug" + php-version: "${{ matrix.php-version }}" + tools: composer:v2 + - name: Install dependencies + run: | + composer require php-coveralls/php-coveralls:^2.4 --dev --no-update + composer update --no-progress --prefer-dist + - name: Run PHPUnit + run: "php vendor/bin/phpunit --coverage-clover=clover.xml" + - name: Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: "php vendor/bin/php-coveralls --verbose" + if: ${{ success() }} + - name: Run PHPStan + run: "vendor/bin/phpstan analyse src --error-format=github" diff --git a/.gitignore b/.gitignore index 39c3ae8..76367ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ vendor/ composer.lock phpunit.xml -.phpunit.result.cache \ No newline at end of file +.phpunit.result.cache diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a28a0f4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: php -php: - - 7.2 - - 7.3 - - 7.4snapshot -dist: xenial -before_script: - - composer install --prefer-source --no-interaction -script: - - vendor/bin/phpunit --coverage-clover=clover.xml -after_script: - - wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar - - php php-coveralls.phar --verbose -cache: - directories: - - $HOME/.composer/cache/files -after_success: - - bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 91e8620..0bb811f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.0] - 2021-01-04 + +### Changed + +- Changed minimum PHP version to 7.3 +- Change minimum PHPUnit to 9.2 + ## [1.6.0] - 2020-12-27 ### Changed @@ -70,4 +77,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.1.0] - 2019-12-13 -This is a new component for the [OriginPHP framework](https://www.originphp.com/). \ No newline at end of file +This is a new component for the [OriginPHP framework](https://www.originphp.com/). diff --git a/LICENSE.md b/LICENSE.md index 1c1cd7b..bd9d449 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019-2020 Jamiel Sharief +Copyright (c) 2019-2021 Jamiel Sharief Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/README.md b/README.md index 1efc6eb..69a0e8a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Validation ![license](https://img.shields.io/badge/license-MIT-brightGreen.svg) -[![build](https://travis-ci.org/originphp/validation.svg?branch=master)](https://travis-ci.org/originphp/validation) +[![build](https://github.com/originphp/validation/workflows/CI/badge.svg)](https://github.com/validation/collection/actions) [![coverage](https://coveralls.io/repos/github/originphp/validation/badge.svg?branch=master)](https://coveralls.io/github/originphp/validation?branch=master) This provides a `Validation` library and the `Validator` class for setting up and running validation rules on arrays of data. @@ -586,4 +586,4 @@ You can also allow uppercase ```php Validation::uuid('86E6E3FC-4924-4B5F-8BCA-E4C07F7CDDF9',true); -``` \ No newline at end of file +``` diff --git a/composer.json b/composer.json index ccda026..299e676 100644 --- a/composer.json +++ b/composer.json @@ -31,10 +31,10 @@ } }, "require": { - "php": ">=7.2.0" + "php": ">=7.3.0" }, "require-dev": { - "phpunit/phpunit": "^8.0", - "phpstan/phpstan": "^0.12.33" + "phpunit/phpunit": "^9.2", + "phpstan/phpstan": "^0.12.64" } } diff --git a/src/ValidateTrait.php b/src/ValidateTrait.php index 2017544..15f221c 100644 --- a/src/ValidateTrait.php +++ b/src/ValidateTrait.php @@ -1,7 +1,7 @@ validator()->remove($field); - $this->validator()->add($field, $name, $options); + $this->validator()->remove($field)->add($field, $name, $options); } /** diff --git a/src/Validation.php b/src/Validation.php index 1fe8ed7..5f84a82 100644 --- a/src/Validation.php +++ b/src/Validation.php @@ -1,7 +1,7 @@