Skip to content

Commit

Permalink
Bumped min PHP version to 7.3 and PHPUnit 9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jamielsharief committed Jan 4, 2021
1 parent 73250f5 commit 6cc4181
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .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
json_path: coverage.json # file generated by php-coveralls
22 changes: 10 additions & 12 deletions .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
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
47 changes: 47 additions & 0 deletions .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"
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,4 +1,4 @@
vendor/
composer.lock
phpunit.xml
.phpunit.result.cache
.phpunit.result.cache
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

9 changes: 8 additions & 1 deletion CHANGELOG.md
Expand Up @@ -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
Expand Down Expand Up @@ -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/).
This is a new component for the [OriginPHP framework](https://www.originphp.com/).
4 changes: 2 additions & 2 deletions 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
Expand All @@ -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.
SOFTWARE.
4 changes: 2 additions & 2 deletions 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.
Expand Down Expand Up @@ -586,4 +586,4 @@ You can also allow uppercase

```php
Validation::uuid('86E6E3FC-4924-4B5F-8BCA-E4C07F7CDDF9',true);
```
```
6 changes: 3 additions & 3 deletions composer.json
Expand Up @@ -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"
}
}
5 changes: 2 additions & 3 deletions src/ValidateTrait.php
@@ -1,7 +1,7 @@
<?php
/**
* OriginPHP Framework
* Copyright 2018 - 2020 Jamiel Sharief.
* Copyright 2018 - 2021 Jamiel Sharief.
*
* Licensed under The MIT License
* The above copyright notice and this permission notice shall be included in all copies or substantial
Expand Down Expand Up @@ -61,8 +61,7 @@ public function errors(string $field = null): ? array
*/
public function validate(string $field, $name, array $options = []): void
{
$this->validator()->remove($field);
$this->validator()->add($field, $name, $options);
$this->validator()->remove($field)->add($field, $name, $options);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Validation.php
@@ -1,7 +1,7 @@
<?php
/**
* OriginPHP Framework
* Copyright 2018 - 2020 Jamiel Sharief.
* Copyright 2018 - 2021 Jamiel Sharief.
*
* Licensed under The MIT License
* The above copyright notice and this permission notice shall be included in all copies or substantial
Expand Down
2 changes: 1 addition & 1 deletion src/Validator.php
Expand Up @@ -2,7 +2,7 @@

/**
* OriginPHP Framework
* Copyright 2018 - 2020 Jamiel Sharief.
* Copyright 2018 - 2021 Jamiel Sharief.
*
* Licensed under The MIT License
* The above copyright notice and this permission notice shall be included in all copies or substantial
Expand Down
2 changes: 1 addition & 1 deletion tests/ValidateTraitTest.php
@@ -1,7 +1,7 @@
<?php
/**
* OriginPHP Framework
* Copyright 2018 - 2020 Jamiel Sharief.
* Copyright 2018 - 2021 Jamiel Sharief.
*
* Licensed under The MIT License
* The above copyright notice and this permission notice shall be included in all copies or substantial
Expand Down
2 changes: 1 addition & 1 deletion tests/ValidationTest.php
@@ -1,7 +1,7 @@
<?php
/**
* OriginPHP Framework
* Copyright 2018 - 2020 Jamiel Sharief.
* Copyright 2018 - 2021 Jamiel Sharief.
*
* Licensed under The MIT License
* The above copyright notice and this permission notice shall be included in all copies or substantial
Expand Down
2 changes: 1 addition & 1 deletion tests/ValidatorTest.php
@@ -1,7 +1,7 @@
<?php
/**
* OriginPHP Framework
* Copyright 2018 - 2020 Jamiel Sharief.
* Copyright 2018 - 2021 Jamiel Sharief.
*
* Licensed under The MIT License
* The above copyright notice and this permission notice shall be included in all copies or substantial
Expand Down

0 comments on commit 6cc4181

Please sign in to comment.