Skip to content

Commit 94da5b6

Browse files
authored
Introduce v3 (#41)
- Drop PHP7.4 Support - Update the code to use PHP 8.1+ features - Upgrade phpunit version
1 parent 4faf2f3 commit 94da5b6

13 files changed

Lines changed: 749 additions & 2412 deletions

.github/workflows/php.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,28 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
php-versions: ['7.4', '8.0', '8.1', '8.2']
18+
php-versions: ['8.1', '8.2', '8.3', '8.4']
1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121

22-
- name: Validate composer.json and composer.lock
23-
run: composer validate --strict
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-versions }}
26+
coverage: none
2427

2528
- name: Cache Composer packages
26-
id: composer-cache
27-
uses: actions/cache@v3
29+
uses: actions/cache@v4
2830
with:
29-
path: vendor
30-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
31+
path: ~/.composer/cache/files
32+
key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
3133
restore-keys: |
32-
${{ runner.os }}-php-
34+
${{ runner.os }}-php-${{ matrix.php-versions }}-
35+
36+
- name: Validate composer.json and composer.lock
37+
run: composer validate --strict
38+
3339
- name: Install dependencies
3440
run: composer install --prefer-dist --no-progress
35-
36-
- name: Setup PHP
37-
uses: shivammathur/setup-php@v2
38-
with:
39-
php-version: ${{ matrix.php-versions }}
4041
- name: Run Tests
4142
run: composer run-script test

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@ examples/Logs/*
4848
.phpunit.result.cache
4949
/cache.properties
5050
tests/_reports/*
51-
build/logs/*
51+
build/logs/*
52+
.phpunit.cache/test-results

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
Unstructured Text Parser [PHP]
22
===========================================
33
[![Tests](https://github.com/aymanrb/php-unstructured-text-parser/actions/workflows/php.yml/badge.svg)](https://github.com/aymanrb/php-unstructured-text-parser/actions/workflows/php.yml)
4-
[![Coverage Status](https://coveralls.io/repos/github/aymanrb/php-unstructured-text-parser/badge.svg?branch=master)](https://coveralls.io/github/aymanrb/php-unstructured-text-parser?branch=master)
54
[![Latest Stable Version](https://poser.pugx.org/aymanrb/php-unstructured-text-parser/v/stable.svg)](https://packagist.org/packages/aymanrb/php-unstructured-text-parser)
65
[![Total Downloads](https://poser.pugx.org/aymanrb/php-unstructured-text-parser/downloads)](https://packagist.org/packages/aymanrb/php-unstructured-text-parser)
76
[![License](https://poser.pugx.org/aymanrb/php-unstructured-text-parser/license.svg)](https://packagist.org/packages/aymanrb/php-unstructured-text-parser)
@@ -19,13 +18,11 @@ Useful when you want to parse data out of:
1918
Installation
2019
----------
2120
PHP Unstructured Text Parser is available on [Packagist](https://packagist.org/packages/aymanrb/php-unstructured-text-parser) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is recommended.
22-
Add the following line to your `composer.json` file:
2321

24-
```json
25-
"aymanrb/php-unstructured-text-parser": "~2.0"
26-
```
22+
Requirements:
23+
- PHP 8.1 or newer
2724

28-
or run
25+
Install it with Composer:
2926

3027
```sh
3128
composer require aymanrb/php-unstructured-text-parser

composer.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010
"form parsing",
1111
"text parse"
1212
],
13-
"config": {
14-
"platform": {
15-
"php": "7.4.0"
16-
}
17-
},
1813
"type": "library",
1914
"license": "MIT",
2015
"authors": [
@@ -47,14 +42,13 @@
4742
},
4843
"require": {
4944
"ext-json": "*",
50-
"php": ">=7.4.0",
45+
"php": "^8.1",
5146
"psr/log": "^1.0.1 || ^2.0 || ^3.0"
5247
},
5348
"require-dev": {
54-
"phpunit/phpunit": "^8.4",
55-
"php-coveralls/php-coveralls": "^2.1"
49+
"phpunit/phpunit": "^10.5"
5650
},
5751
"scripts": {
58-
"test": "phpunit tests"
52+
"test": "phpunit --configuration phpunit.xml"
5953
}
6054
}

0 commit comments

Comments
 (0)