Skip to content

Commit 3d0ac7f

Browse files
committed
Initial commit in oldphp branch
1 parent 26c838e commit 3d0ac7f

29 files changed

Lines changed: 435 additions & 433 deletions

.github/workflows/Test.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,21 @@ on:
77
- '**.php'
88
- 'composer.json'
99
branches:
10-
- 'main'
10+
- 'oldphp'
1111
pull_request:
1212
paths:
1313
- '**.php'
1414
- 'composer.json'
1515
branches:
16-
- 'main'
16+
- 'oldphp'
1717
workflow_dispatch:
1818

1919
jobs:
2020
run:
2121
runs-on: ubuntu-latest
2222
strategy:
2323
matrix:
24-
php: [ '7.1', '7.2', '7.3', '7.4', '8.0' ]
25-
continue-on-error: ${{ matrix.php == '8.0' }}
24+
php: [ '5.4', '5.5', '5.6', '7.0' ]
2625
name: PHP ${{ matrix.php }} Test
2726

2827
steps:
@@ -34,7 +33,7 @@ jobs:
3433
with:
3534
php-version: ${{ matrix.php }}
3635
extensions: json
37-
coverage: pcov
36+
coverage: xdebug
3837
env:
3938
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4039

@@ -47,14 +46,5 @@ jobs:
4746
- name: Run phpcs
4847
run: composer cs-check -- -v
4948

50-
- name: Setup PCOV
51-
if: matrix.php == '7.1'
52-
run: |
53-
composer require pcov/clobber
54-
vendor/bin/pcov clobber
55-
5649
- name: Execute tests
5750
run: composer test -- -v --coverage-clover=coverage.xml
58-
59-
- name: Run codecov
60-
uses: codecov/codecov-action@v1

.github/workflows/UpdateContributors.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 0 additions & 64 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
# JSONPath for PHP 7.1+
2-
3-
[![Build Status](https://img.shields.io/github/workflow/status/SoftCreatR/JSONPath/Test/main?label=Build%20Status)](https://github.com/SoftCreatR/JSONPath/actions?query=workflow%3ATest)
4-
[![Latest Release](https://img.shields.io/packagist/v/SoftCreatR/JSONPath?color=blue&label=Latest%20Release)](https://packagist.org/packages/softcreatr/jsonpath)
5-
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
6-
[![Codecov branch](https://img.shields.io/codecov/c/github/SoftCreatR/JSONPath)](https://codecov.io/gh/SoftCreatR/JSONPath)
7-
[![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability-percentage/SoftCreatR/JSONPath)](https://codeclimate.com/github/SoftCreatR/JSONPath)
1+
# JSONPath for PHP 5.4 - 7.0 [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
82

93
This is a [JSONPath](http://goessner.net/articles/JsonPath/) implementation for PHP based on Stefan Goessner's JSONPath script.
104

@@ -16,22 +10,20 @@ This project aims to be a clean and simple implementation with the following goa
1610
- Expressions are parsed into tokens using code inspired by the Doctrine Lexer. The tokens are cached internally to avoid re-parsing the expressions.
1711
- There is no `eval()` in use
1812
- Any combination of objects/arrays/ArrayAccess-objects can be used as the data input which is great if you're de-serializing JSON in to objects or if you want to process your own data structures.
13+
14+
🔻 **Please note, that this branch (based on JSONPath 0.7.2) is protected. There are no intentions to make any updates here. Please consider upgrading to PHP 7.1 or newer.**
1915

2016
## Installation
2117

22-
**PHP 7.1+**
18+
**PHP >= 7.1+**
2319
```bash
2420
composer require softcreatr/jsonpath
2521
```
2622

2723
**PHP < 7.1**
2824

29-
Support for PHP < 7.1 has been dropped. However, legacy branches exist for PHP 5.6 and 7.0 and can be composer-installed as follows:
30-
31-
* PHP 7.0: `"softcreatr/jsonpath": "dev-php-70"`
32-
* PHP 5.6: `"softcreatr/jsonpath": "dev-php-56"`
33-
34-
🔻 Please note, that these legacy branches (based on JSONPath 0.6.2) are protected. There are no intentions to make any updates here. Please consider upgrading to PHP 7.1 or newer.
25+
1. Add to the `require`-section of your composer.json: `"softcreatr/jsonpath": "dev-oldphp"`
26+
2. Execute `composer install`
3527

3628
## JSONPath Examples
3729

@@ -137,39 +129,6 @@ So here are the types of query expressions that are supported:
137129

138130
Other / Similar implementations can be found in the [Wiki](https://github.com/SoftCreatR/JSONPath/wiki/Other-Implementations).
139131

140-
## Changelog
141-
142-
A list of changes can be found in the [CHANGELOG.md](CHANGELOG.md) file.
143-
144132
## License
145133

146134
[MIT](LICENSE)
147-
148-
## Contributors ✨
149-
150-
<table>
151-
<tr>
152-
<td align="center">
153-
<a href=https://github.com/SoftCreatR>
154-
<img src=https://avatars0.githubusercontent.com/u/81188?v=4 width="100;" alt=Sascha Greuel/>
155-
<br />
156-
<sub style="font-size:14px"><b>Sascha Greuel</b></sub>
157-
</a>
158-
</td>
159-
<td align="center">
160-
<a href=https://github.com/SG5>
161-
<img src=https://avatars0.githubusercontent.com/u/3931761?v=4 width="100;" alt=Sergey/>
162-
<br />
163-
<sub style="font-size:14px"><b>Sergey</b></sub>
164-
</a>
165-
</td>
166-
<td align="center">
167-
<a href=https://github.com/oleg-andreyev>
168-
<img src=https://avatars1.githubusercontent.com/u/1244112?v=4 width="100;" alt=Oleg Andreyev/>
169-
<br />
170-
<sub style="font-size:14px"><b>Oleg Andreyev</b></sub>
171-
</a>
172-
</td>
173-
</tr>
174-
</table>
175-

composer.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "softcreatr/jsonpath",
33
"description": "JSONPath implementation for parsing, searching and flattening arrays",
4-
"version": "0.7.2",
54
"license": "MIT",
65
"authors": [
76
{
@@ -18,17 +17,17 @@
1817
}
1918
],
2019
"require": {
21-
"php": ">=7.1",
20+
"php": ">=5.4,<7.1",
2221
"ext-json": "*"
2322
},
2423
"replace": {
2524
"flow/jsonpath": "*"
2625
},
2726
"conflict": {
28-
"phpunit/phpunit": "<7.0 || >= 10.0"
27+
"phpunit/phpunit": "<4.0,>=7.0"
2928
},
3029
"require-dev": {
31-
"phpunit/phpunit": ">=7.0",
30+
"phpunit/phpunit": "^4.0 || ^5.7 || ^6.5",
3231
"roave/security-advisories": "dev-master",
3332
"squizlabs/php_codesniffer": "^3.5"
3433
},
@@ -42,6 +41,9 @@
4241
}
4342
},
4443
"autoload-dev": {
44+
"files": [
45+
"tests/bootstrap.php"
46+
],
4547
"psr-4": {
4648
"Flow\\JSONPath\\Test\\": "tests/"
4749
}

phpcs.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
<?xml version="1.0"?>
2-
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"
4-
>
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
53
<arg name="basepath" value="."/>
64
<arg name="cache" value=".phpcs-cache"/>
75
<arg name="colors"/>
86
<arg name="extensions" value="php"/>
97
<arg name="parallel" value="10"/>
108

11-
<!-- Show progress -->
129
<arg value="p"/>
1310

14-
<!-- Paths to check -->
1511
<file>src</file>
1612
<file>tests</file>
1713

18-
<!-- Include all rules from the Zend Coding Standard -->
1914
<rule ref="PSR12"/>
2015
</ruleset>

phpunit.xml.dist

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
73
<testsuites>
84
<testsuite name="Unit">
9-
<directory>./tests</directory>
5+
<directory>tests</directory>
106
</testsuite>
117
</testsuites>
8+
129
<filter>
1310
<whitelist>
14-
<directory suffix=".php">./src/</directory>
11+
<directory suffix=".php">src</directory>
1512
</whitelist>
1613
</filter>
1714
</phpunit>

0 commit comments

Comments
 (0)