Skip to content

Commit

Permalink
IndexMap compatibility issue fixed (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
remorhaz committed Aug 17, 2021
1 parent a7a0bf3 commit b36c26f
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 5 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build

on:
pull_request:
branches:
- '*'
push:
branches:
- 'master'

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
platform-reqs:
- use-platform-reqs
php-version:
- "7.3"
- "7.4"
- "8.0"
dependencies:
- lowest
- highest
include:
- php-version: "8.1"
platform-reqs: ignore-platform-reqs
dependencies: highest
- php-version: "8.1"
platform-reqs: ignore-platform-reqs
dependencies: lowest

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}

- name: Install lowest dependencies
if: ${{ matrix.dependencies == 'lowest' && matrix.platform-reqs == 'use-platform-reqs' }}
run: composer update --no-interaction --prefer-lowest

- name: Install lowest dependencies (ignore platform reqs)
if: ${{ matrix.dependencies == 'lowest' && matrix.platform-reqs == 'ignore-platform-reqs' }}
run: composer update --no-interaction --prefer-lowest --ignore-platform-reqs

- name: Install highest dependencies
if: ${{ matrix.dependencies == 'highest' && matrix.platform-reqs == 'use-platform-reqs' }}
run: composer update --no-interaction

- name: Install highest dependencies (ignore platform reqs)
if: ${{ matrix.dependencies == 'highest' && matrix.platform-reqs == 'ignore-platform-reqs' }}
run: composer update --no-interaction --ignore-platform-reqs

- name: Run tests
run: composer test
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- PHP 8.1 compatibility issue ([#24](./issues/24)).

## [0.7.5] - 2021-04-10
### Fixed
- Closure moved out from generated query code to prevent memory leak (see https://bugs.php.net/bug.php?id=76982).
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
}
],
"require": {
"php": "^7.3 | ^8",
"php": "^7.3 || ^8",
"ext-intl": "*",
"ext-json": "*",
"remorhaz/php-unilex": "^0.4",
"remorhaz/php-unilex": "^0.4.1",
"remorhaz/php-json-data": "^0.5.3",
"nikic/php-parser": "^4.10"
"nikic/php-parser": "^4.12"
},
"require-dev": {
"infection/infection": "^0.18 || ^0.19 || ^0.20 || ^0.21 || ^0.22 || ^0.23 || ^0.24",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.5",
"infection/infection": "^0.18"
"squizlabs/php_codesniffer": "^3.6"
},
"autoload": {
"psr-4": {
Expand Down
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@ services:
volumes:
- .:/app
working_dir: /app
php8.1:
build:
context: .
dockerfile: php-8.1.Dockerfile
volumes:
- .:/app
working_dir: /app
19 changes: 19 additions & 0 deletions php-8.1.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM php:8.1-rc-cli

RUN apt-get update && apt-get install -y \
zip \
git \
libicu-dev && \
pecl install -f -o xdebug && \
docker-php-ext-enable xdebug && \
docker-php-ext-configure intl --enable-intl && \
docker-php-ext-install intl && \
echo "xdebug.mode = develop,coverage,debug" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" && \
echo "xdebug.max_nesting_level = 1024" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini"


ENV COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_PROCESS_TIMEOUT=1200

RUN curl --silent --show-error https://getcomposer.org/installer | php -- \
--install-dir=/usr/bin --filename=composer
3 changes: 3 additions & 0 deletions src/Value/IndexMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Remorhaz\JSON\Path\Value;

use ReturnTypeWillChange;

use function array_keys;
use function count;
use function in_array;
Expand All @@ -18,6 +20,7 @@ public function __construct(?int ...$outerIndexes)
$this->outerIndexes = $outerIndexes;
}

#[ReturnTypeWillChange]
public function count()
{
return count($this->outerIndexes);
Expand Down

0 comments on commit b36c26f

Please sign in to comment.