Skip to content

Commit

Permalink
0.9.0
Browse files Browse the repository at this point in the history
Signed-off-by: Sascha Greuel <[email protected]>
  • Loading branch information
SoftCreatR committed Mar 12, 2024
1 parent fc12dee commit 25cb681
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 27 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ jobs:
- '8.0'
- '8.1'
- '8.2'
continue-on-error: ${{ matrix.php == '8.2' }}
- '8.3'
- '8.4'
continue-on-error: ${{ matrix.php == '8.4' }}
name: PHP ${{ matrix.php }} Test

steps:
- name: Git checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -58,4 +60,4 @@ jobs:
run: composer test -- -v --coverage-clover=coverage.xml

- name: Run codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
2 changes: 1 addition & 1 deletion .github/workflows/UpdateContributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

steps:
- name: Git checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Update Contributors
uses: BobAnkh/add-contributors@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup PHP with tools
uses: shivammathur/setup-php@v2
Expand Down
1 change: 0 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('*/vendor/*')
->exclude('node_modules')
->in(__DIR__);

return (new PhpCsFixer\Config())
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

### 0.9.0
🔻 Breaking changes ahead:

- Dropped support for PHP < 8.1

### 0.8.2
- AccessHelper & RecursiveFilter now return a plain `object`, rather than an `ArrayAccess` object

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "softcreatr/jsonpath",
"description": "JSONPath implementation for parsing, searching and flattening arrays",
"license": "MIT",
"version": "0.8.3",
"version": "0.9.0",
"authors": [
{
"name": "Stephen Frank",
Expand All @@ -24,11 +24,11 @@
"source": "https://github.com/SoftCreatR/JSONPath"
},
"require": {
"php": ">=8.0",
"php": "8.1 - 8.4",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "^9.6",
"phpunit/phpunit": "10 - 12",
"roave/security-advisories": "dev-latest"
},
"replace": {
Expand Down
21 changes: 11 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
bootstrap="vendor/autoload.php"
colors="true"
>
<coverage>
<include>
<directory suffix=".php">./src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Unit">
<directory>./tests</directory>
</testsuite>
</testsuites>
<testsuites>
<testsuite name="Unit">
<directory>./tests</directory>
</testsuite>
</testsuites>

<source>
<include>
<directory>./src/</directory>
</include>
</source>
</phpunit>
6 changes: 3 additions & 3 deletions tests/JSONPathDashedIndexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@

use Flow\JSONPath\JSONPath;
use Flow\JSONPath\JSONPathException;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

class JSONPathDashedIndexTest extends TestCase
{
/**
* @return array[]
*/
public function indexDataProvider(): array
public static function indexDataProvider(): array
{
return [
[
Expand All @@ -36,10 +37,9 @@ public function indexDataProvider(): array
}

/**
* @dataProvider indexDataProvider
*
* @throws JSONPathException
*/
#[DataProvider('indexDataProvider')]
public function testSlice(string $path, array $data, array $expected): void
{
$results = (new JSONPath($data))
Expand Down
6 changes: 3 additions & 3 deletions tests/JSONPathSliceAccessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@

use Flow\JSONPath\JSONPath;
use Flow\JSONPath\JSONPathException;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

class JSONPathSliceAccessTest extends TestCase
{
public function sliceDataProvider(): array
public static function sliceDataProvider(): array
{
return [
[
Expand Down Expand Up @@ -78,10 +79,9 @@ public function sliceDataProvider(): array
}

/**
* @dataProvider sliceDataProvider
*
* @throws JSONPathException
*/
#[DataProvider('sliceDataProvider')]
public function testSlice(string $path, array $data, array $expected): void
{
$result = (new JSONPath($data))
Expand Down
5 changes: 3 additions & 2 deletions tests/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

use Flow\JSONPath\JSONPath;
use Flow\JSONPath\JSONPathException;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\ExpectationFailedException;
use PHPUnit\Framework\TestCase;
use RuntimeException;
Expand All @@ -28,10 +29,10 @@ class QueryTest extends TestCase
* a message will be printed to STDERR, so we know, what's going on.
*
* @see https://cburgmer.github.io/json-path-comparison
* @dataProvider queryDataProvider
*
* @noinspection JsonEncodingApiUsageInspection
*/
#[DataProvider('queryDataProvider')]
public function testQueries(
string $id,
string $selector,
Expand Down Expand Up @@ -109,7 +110,7 @@ public function testQueries(
*
* @return string[]
*/
public function queryDataProvider(): array
public static function queryDataProvider(): array
{
return [
[ // data set #0
Expand Down

0 comments on commit 25cb681

Please sign in to comment.