Skip to content

Commit 43bfb6a

Browse files
committed
0.9.0
Signed-off-by: Sascha Greuel <[email protected]>
1 parent fc12dee commit 43bfb6a

12 files changed

+42
-31
lines changed

.github/workflows/Test.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@ jobs:
1919
strategy:
2020
matrix:
2121
php:
22-
- '8.0'
2322
- '8.1'
2423
- '8.2'
25-
continue-on-error: ${{ matrix.php == '8.2' }}
24+
- '8.3'
25+
- '8.4'
26+
continue-on-error: ${{ matrix.php == '8.4' }}
2627
name: PHP ${{ matrix.php }} Test
2728

2829
steps:
2930
- name: Git checkout
30-
uses: actions/checkout@v3
31+
uses: actions/checkout@v4
3132

3233
- name: Setup PHP
3334
uses: shivammathur/setup-php@v2
@@ -55,7 +56,7 @@ jobs:
5556
run: phpcs -- -v
5657

5758
- name: Execute tests
58-
run: composer test -- -v --coverage-clover=coverage.xml
59+
run: composer test -- --coverage-clover=coverage.xml
5960

6061
- name: Run codecov
61-
uses: codecov/codecov-action@v3
62+
uses: codecov/codecov-action@v4

.github/workflows/UpdateContributors.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
steps:
1010
- name: Git checkout
11-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
1212

1313
- name: Update Contributors
1414
uses: BobAnkh/add-contributors@master

.github/workflows/codestyle.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818

1919
- name: Setup PHP with tools
2020
uses: shivammathur/setup-php@v2

.php-cs-fixer.dist.php

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22
$finder = PhpCsFixer\Finder::create()
33
->exclude('*/vendor/*')
4-
->exclude('node_modules')
54
->in(__DIR__);
65

76
return (new PhpCsFixer\Config())

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
### 0.9.0
4+
🔻 Breaking changes ahead:
5+
6+
- Dropped support for PHP < 8.1
7+
8+
### 0.8.3
9+
- Change `getData()` so that it can be mixed instead of array
10+
311
### 0.8.2
412
- AccessHelper & RecursiveFilter now return a plain `object`, rather than an `ArrayAccess` object
513

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# JSONPath for PHP 8.0+
1+
# JSONPath for PHP 8.1+
22

33
[![Build](https://img.shields.io/github/actions/workflow/status/SoftCreatR/JSONPath/.github/workflows/Test.yml?branch=main)](https://github.com/SoftCreatR/JSONPath/actions/workflows/Test.yml) [![Latest Release](https://img.shields.io/packagist/v/SoftCreatR/JSONPath?color=blue&label=Latest%20Release)](https://packagist.org/packages/softcreatr/jsonpath)
44
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE) [![Plant Tree](https://img.shields.io/badge/dynamic/json?color=brightgreen&label=Plant%20Tree&query=%24.total&url=https%3A%2F%2Fpublic.offset.earth%2Fusers%2Fsoftcreatr%2Ftrees)](https://ecologi.com/softcreatr?r=61212ab3fc69b8eb8a2014f4)
@@ -19,7 +19,7 @@ This project aims to be a clean and simple implementation with the following goa
1919
## Installation
2020

2121
```bash
22-
composer require softcreatr/jsonpath:"^0.5 || ^0.7 || ^0.8"
22+
composer require softcreatr/jsonpath:"^0.9"
2323
```
2424

2525
## JSONPath Examples

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "softcreatr/jsonpath",
33
"description": "JSONPath implementation for parsing, searching and flattening arrays",
44
"license": "MIT",
5-
"version": "0.8.3",
5+
"version": "0.9.0",
66
"authors": [
77
{
88
"name": "Stephen Frank",
@@ -24,11 +24,11 @@
2424
"source": "https://github.com/SoftCreatR/JSONPath"
2525
},
2626
"require": {
27-
"php": ">=8.0",
27+
"php": "8.1 - 8.4",
2828
"ext-json": "*"
2929
},
3030
"require-dev": {
31-
"phpunit/phpunit": "^9.6",
31+
"phpunit/phpunit": "10 - 12",
3232
"roave/security-advisories": "dev-latest"
3333
},
3434
"replace": {

phpunit.xml.dist

+11-10
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
bootstrap="vendor/autoload.php"
55
colors="true"
66
>
7-
<coverage>
8-
<include>
9-
<directory suffix=".php">./src/</directory>
10-
</include>
11-
</coverage>
12-
<testsuites>
13-
<testsuite name="Unit">
14-
<directory>./tests</directory>
15-
</testsuite>
16-
</testsuites>
7+
<testsuites>
8+
<testsuite name="Unit">
9+
<directory>./tests</directory>
10+
</testsuite>
11+
</testsuites>
12+
13+
<source>
14+
<include>
15+
<directory>./src/</directory>
16+
</include>
17+
</source>
1718
</phpunit>

src/JSONPathException.php

+1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212

1313
class JSONPathException extends Exception
1414
{
15+
// does nothing
1516
}

tests/JSONPathDashedIndexTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212

1313
use Flow\JSONPath\JSONPath;
1414
use Flow\JSONPath\JSONPathException;
15+
use PHPUnit\Framework\Attributes\DataProvider;
1516
use PHPUnit\Framework\TestCase;
1617

1718
class JSONPathDashedIndexTest extends TestCase
1819
{
1920
/**
2021
* @return array[]
2122
*/
22-
public function indexDataProvider(): array
23+
public static function indexDataProvider(): array
2324
{
2425
return [
2526
[
@@ -36,10 +37,9 @@ public function indexDataProvider(): array
3637
}
3738

3839
/**
39-
* @dataProvider indexDataProvider
40-
*
4140
* @throws JSONPathException
4241
*/
42+
#[DataProvider('indexDataProvider')]
4343
public function testSlice(string $path, array $data, array $expected): void
4444
{
4545
$results = (new JSONPath($data))

tests/JSONPathSliceAccessTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212

1313
use Flow\JSONPath\JSONPath;
1414
use Flow\JSONPath\JSONPathException;
15+
use PHPUnit\Framework\Attributes\DataProvider;
1516
use PHPUnit\Framework\TestCase;
1617

1718
class JSONPathSliceAccessTest extends TestCase
1819
{
19-
public function sliceDataProvider(): array
20+
public static function sliceDataProvider(): array
2021
{
2122
return [
2223
[
@@ -78,10 +79,9 @@ public function sliceDataProvider(): array
7879
}
7980

8081
/**
81-
* @dataProvider sliceDataProvider
82-
*
8382
* @throws JSONPathException
8483
*/
84+
#[DataProvider('sliceDataProvider')]
8585
public function testSlice(string $path, array $data, array $expected): void
8686
{
8787
$result = (new JSONPath($data))

tests/QueryTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
use Flow\JSONPath\JSONPath;
1414
use Flow\JSONPath\JSONPathException;
15+
use PHPUnit\Framework\Attributes\DataProvider;
1516
use PHPUnit\Framework\ExpectationFailedException;
1617
use PHPUnit\Framework\TestCase;
1718
use RuntimeException;
@@ -28,10 +29,10 @@ class QueryTest extends TestCase
2829
* a message will be printed to STDERR, so we know, what's going on.
2930
*
3031
* @see https://cburgmer.github.io/json-path-comparison
31-
* @dataProvider queryDataProvider
3232
*
3333
* @noinspection JsonEncodingApiUsageInspection
3434
*/
35+
#[DataProvider('queryDataProvider')]
3536
public function testQueries(
3637
string $id,
3738
string $selector,
@@ -109,7 +110,7 @@ public function testQueries(
109110
*
110111
* @return string[]
111112
*/
112-
public function queryDataProvider(): array
113+
public static function queryDataProvider(): array
113114
{
114115
return [
115116
[ // data set #0

0 commit comments

Comments
 (0)