Skip to content

Commit

Permalink
Initial commit in oldphp branch
Browse files Browse the repository at this point in the history
  • Loading branch information
SoftCreatR committed Nov 2, 2020
1 parent 26c838e commit 3d0ac7f
Show file tree
Hide file tree
Showing 29 changed files with 435 additions and 433 deletions.
18 changes: 4 additions & 14 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,21 @@ on:
- '**.php'
- 'composer.json'
branches:
- 'main'
- 'oldphp'
pull_request:
paths:
- '**.php'
- 'composer.json'
branches:
- 'main'
- 'oldphp'
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '7.1', '7.2', '7.3', '7.4', '8.0' ]
continue-on-error: ${{ matrix.php == '8.0' }}
php: [ '5.4', '5.5', '5.6', '7.0' ]
name: PHP ${{ matrix.php }} Test

steps:
Expand All @@ -34,7 +33,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
extensions: json
coverage: pcov
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -47,14 +46,5 @@ jobs:
- name: Run phpcs
run: composer cs-check -- -v

- name: Setup PCOV
if: matrix.php == '7.1'
run: |
composer require pcov/clobber
vendor/bin/pcov clobber
- name: Execute tests
run: composer test -- -v --coverage-clover=coverage.xml

- name: Run codecov
uses: codecov/codecov-action@v1
18 changes: 0 additions & 18 deletions .github/workflows/UpdateContributors.yml

This file was deleted.

64 changes: 0 additions & 64 deletions CHANGELOG.md

This file was deleted.

53 changes: 6 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# JSONPath for PHP 7.1+

[![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)
[![Latest Release](https://img.shields.io/packagist/v/SoftCreatR/JSONPath?color=blue&label=Latest%20Release)](https://packagist.org/packages/softcreatr/jsonpath)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
[![Codecov branch](https://img.shields.io/codecov/c/github/SoftCreatR/JSONPath)](https://codecov.io/gh/SoftCreatR/JSONPath)
[![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability-percentage/SoftCreatR/JSONPath)](https://codeclimate.com/github/SoftCreatR/JSONPath)
# JSONPath for PHP 5.4 - 7.0 [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)

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

Expand All @@ -16,22 +10,20 @@ This project aims to be a clean and simple implementation with the following goa
- Expressions are parsed into tokens using code inspired by the Doctrine Lexer. The tokens are cached internally to avoid re-parsing the expressions.
- There is no `eval()` in use
- 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.

🔻 **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.**

## Installation

**PHP 7.1+**
**PHP >= 7.1+**
```bash
composer require softcreatr/jsonpath
```

**PHP < 7.1**

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:

* PHP 7.0: `"softcreatr/jsonpath": "dev-php-70"`
* PHP 5.6: `"softcreatr/jsonpath": "dev-php-56"`

🔻 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.
1. Add to the `require`-section of your composer.json: `"softcreatr/jsonpath": "dev-oldphp"`
2. Execute `composer install`

## JSONPath Examples

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

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

## Changelog

A list of changes can be found in the [CHANGELOG.md](CHANGELOG.md) file.

## License

[MIT](LICENSE)

## Contributors ✨

<table>
<tr>
<td align="center">
<a href=https://github.com/SoftCreatR>
<img src=https://avatars0.githubusercontent.com/u/81188?v=4 width="100;" alt=Sascha Greuel/>
<br />
<sub style="font-size:14px"><b>Sascha Greuel</b></sub>
</a>
</td>
<td align="center">
<a href=https://github.com/SG5>
<img src=https://avatars0.githubusercontent.com/u/3931761?v=4 width="100;" alt=Sergey/>
<br />
<sub style="font-size:14px"><b>Sergey</b></sub>
</a>
</td>
<td align="center">
<a href=https://github.com/oleg-andreyev>
<img src=https://avatars1.githubusercontent.com/u/1244112?v=4 width="100;" alt=Oleg Andreyev/>
<br />
<sub style="font-size:14px"><b>Oleg Andreyev</b></sub>
</a>
</td>
</tr>
</table>

10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "softcreatr/jsonpath",
"description": "JSONPath implementation for parsing, searching and flattening arrays",
"version": "0.7.2",
"license": "MIT",
"authors": [
{
Expand All @@ -18,17 +17,17 @@
}
],
"require": {
"php": ">=7.1",
"php": ">=5.4,<7.1",
"ext-json": "*"
},
"replace": {
"flow/jsonpath": "*"
},
"conflict": {
"phpunit/phpunit": "<7.0 || >= 10.0"
"phpunit/phpunit": "<4.0,>=7.0"
},
"require-dev": {
"phpunit/phpunit": ">=7.0",
"phpunit/phpunit": "^4.0 || ^5.7 || ^6.5",
"roave/security-advisories": "dev-master",
"squizlabs/php_codesniffer": "^3.5"
},
Expand All @@ -42,6 +41,9 @@
}
},
"autoload-dev": {
"files": [
"tests/bootstrap.php"
],
"psr-4": {
"Flow\\JSONPath\\Test\\": "tests/"
}
Expand Down
7 changes: 1 addition & 6 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"
>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<arg name="basepath" value="."/>
<arg name="cache" value=".phpcs-cache"/>
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="10"/>

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

<!-- Paths to check -->
<file>src</file>
<file>tests</file>

<!-- Include all rules from the Zend Coding Standard -->
<rule ref="PSR12"/>
</ruleset>
11 changes: 4 additions & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="Unit">
<directory>./tests</directory>
<directory>tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">./src/</directory>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
Loading

0 comments on commit 3d0ac7f

Please sign in to comment.