Skip to content

Commit

Permalink
Dropped PHP 8.0, supported PHP 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
remorhaz committed Feb 12, 2024
1 parent 3bb3706 commit 35e1b35
Show file tree
Hide file tree
Showing 107 changed files with 582 additions and 887 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform-reqs:
- use-platform-reqs
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
dependencies:
- lowest
- highest
Expand All @@ -32,6 +33,9 @@ jobs:
with:
php-version: ${{ matrix.php-version }}

- name: Install PHIVE
uses: szepeviktor/phive@v1

- name: Install lowest dependencies
if: ${{ matrix.dependencies == 'lowest' && matrix.platform-reqs == 'use-platform-reqs' }}
run: composer update --no-interaction --prefer-lowest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/build
/vendor
/composer.lock
/tools/
/vendor-bin/**/vendor/
/vendor-bin/**/composer.lock
/phpunit.xml
/infection.json
.phpunit.result.cache
4 changes: 4 additions & 0 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="infection" version="^0.27.9" installed="0.27.9" location="./tools/infection" copy="true"/>
</phive>
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ 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]
### Removed
- Dropped support for PHP 8.0.
### Added
- Added support for PHP 8.3.

## [0.5.2] - 2023-06-16
### Fixed
- Attribute list works correctly with NULL values now.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018-2020 Edward Surov
Copyright (c) 2018-2024 Edward Surov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
42 changes: 26 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,17 @@
"bin/unilex"
],
"require": {
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"phpdocumentor/reflection-docblock": "^4.3 || ^5",
"nikic/php-parser": "^4.12",
"remorhaz/int-rangesets": "^0.2.1",
"remorhaz/ucd": "^0.2",
"symfony/console": "^5 || ^6",
"nikic/php-parser": "^4.12 || ^5",
"remorhaz/int-rangesets": "^0.3",
"remorhaz/ucd": "^0.3",
"symfony/console": "^6.1 || ^7",
"thecodingmachine/safe": "^1.3.1 || ^2"
},
"require-dev": {
"infection/infection": "^0.26 || ^0.27",
"phpunit/phpunit": "^9.5 || ^10",
"squizlabs/php_codesniffer": "^3.7.2",
"symplify/coding-standard": "^11"
"bamarni/composer-bin-plugin": "^1.8",
"phpunit/phpunit": "^10.1 || ^11"
},
"autoload": {
"psr-4": {
Expand All @@ -50,22 +48,27 @@
}
},
"scripts": {
"post-update-cmd": ["@phive-install"],
"post-install-cmd": ["@phive-install"],
"phive-install": [
"`if [ -f tools/phive ]; then echo 'tools/'; fi`phive install --trust-gpg-keys C5095986493B4AA0"
],
"build-example-brainfuck": [
"php bin/unilex build-token-matcher examples/Brainfuck/spec/LexerSpec.php examples/Brainfuck/src/Grammar/TokenMatcher.php --desc='Brainfuck token matcher.'",
"php bin/unilex build-lookup-table examples/Brainfuck/src/Grammar/Config.php examples/Brainfuck/src/Grammar/LookupTable.php --type=ll-1 --desc='Brainfuck LL(1) parser lookup table.' --symbol=Remorhaz\\\\UniLex\\\\Example\\\\Brainfuck\\\\Grammar\\\\SymbolType --token=Remorhaz\\\\UniLex\\\\Example\\\\Brainfuck\\\\Grammar\\\\TokenType",
"vendor/bin/phpcbf -p examples/Brainfuck/src/Grammar/LookupTable.php examples/Brainfuck/src/Grammar/TokenMatcher.php; if [ $? -eq 1 ]; then exit 0; fi"
"vendor-bin/cs/vendor/bin/phpcbf -p examples/Brainfuck/src/Grammar/LookupTable.php examples/Brainfuck/src/Grammar/TokenMatcher.php; if [ $? -eq 1 ]; then exit 0; fi"
],
"build-examples": [
"@build-example-brainfuck"
],
"build-regexp": [
"php bin/unilex build-token-matcher spec/RegExp/LexerSpec.php src/RegExp/Grammar/TokenMatcher.php --desc='RegExp token matcher.'",
"php bin/unilex build-lookup-table src/RegExp/Grammar/Config.php src/RegExp/Grammar/LookupTable.php --type=ll-1 --desc='RegExp LL(1) parser lookup table.' --symbol=Remorhaz\\\\UniLex\\\\RegExp\\\\Grammar\\\\SymbolType --token=Remorhaz\\\\UniLex\\\\RegExp\\\\Grammar\\\\TokenType",
"vendor/bin/phpcbf -p src/RegExp/Grammar/LookupTable.php src/RegExp/Grammar/TokenMatcher.php; if [ $? -eq 1 ]; then exit 0; fi"
"vendor-bin/cs/vendor/bin/phpcbf -p src/RegExp/Grammar/LookupTable.php src/RegExp/Grammar/TokenMatcher.php; if [ $? -eq 1 ]; then exit 0; fi"
],
"build-unicode": [
"php bin/unilex build-token-matcher spec/Unicode/Utf8LexerSpec.php src/Unicode/Grammar/Utf8TokenMatcher.php --desc='Unicode UTF-8 token matcher.'",
"vendor/bin/phpcbf -p src/Unicode/Grammar/Utf8TokenMatcher.php; if [ $? -eq 1 ]; then exit 0; fi"
"vendor-bin/cs/vendor/bin/phpcbf -p src/Unicode/Grammar/Utf8TokenMatcher.php; if [ $? -eq 1 ]; then exit 0; fi"
],
"build-core": [
"@build-regexp",
Expand All @@ -76,7 +79,7 @@
"@build-examples"
],
"test-cs": [
"vendor/bin/phpcs -sp"
"vendor-bin/cs/vendor/bin/phpcs -sp"
],
"test-unit": [
"vendor/bin/phpunit --coverage-xml=build/logs/coverage-xml --coverage-clover=build/logs/clover.xml --log-junit=build/logs/junit.xml"
Expand All @@ -87,17 +90,24 @@
],
"infection": [
"mkdir -p build/logs/infection",
"vendor/bin/infection --threads=4 --coverage=build/logs --no-progress --skip-initial-tests"
"tools/infection --threads=4 --coverage=build/logs --no-progress --skip-initial-tests"
],
"test-infection": [
"@test-unit",
"@infection"
]
},
"config": {
"process-timeout": 0,
"allow-plugins": {
"infection/*": true
"bamarni/composer-bin-plugin": true
},
"process-timeout": 0,
"sort-packages": true
},
"extra": {
"bamarni-bin": {
"bin-links": false,
"forward-command": true
}
}
}
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ services:
php:
build:
context: .
dockerfile: php-8.0.Dockerfile
dockerfile: php-8.1.Dockerfile
volumes:
- .:/app
- ./docker/php.ini:/usr/local/etc/php/conf.d/memory_limit.ini
working_dir: /app
php8.1:
php8.2:
build:
context: .
dockerfile: php-8.1.Dockerfile
dockerfile: php-8.2.Dockerfile
volumes:
- .:/app
- ./docker/php.ini:/usr/local/etc/php/conf.d/memory_limit.ini
working_dir: /app
php8.2:
php8.3:
build:
context: .
dockerfile: php-8.2.Dockerfile
dockerfile: php-8.3.Dockerfile
volumes:
- .:/app
- ./docker/php.ini:/usr/local/etc/php/conf.d/memory_limit.ini
Expand Down
16 changes: 0 additions & 16 deletions php-8.0.Dockerfile

This file was deleted.

21 changes: 16 additions & 5 deletions php-8.1.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
FROM php:8.1-cli

RUN apt-get update && apt-get install -y \
zip \
git \
libicu-dev && \
zip \
git \
wget \
gpg \
libicu-dev && \
pecl install -o -f 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"

ENV COMPOSER_ALLOW_SUPERUSER=1
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
--install-dir=/usr/bin --filename=composer && \
git config --global --add safe.directory "*"

RUN wget -O phive.phar https://phar.io/releases/phive.phar && \
wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc && \
gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79 && \
gpg --verify phive.phar.asc phive.phar && \
chmod +x phive.phar && \
mv phive.phar /usr/local/bin/phive
21 changes: 16 additions & 5 deletions php-8.2.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
FROM php:8.2-cli

RUN apt-get update && apt-get install -y \
zip \
git \
libicu-dev && \
zip \
git \
wget \
gpg \
libicu-dev && \
pecl install -o -f 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"

ENV COMPOSER_ALLOW_SUPERUSER=1
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
--install-dir=/usr/bin --filename=composer && \
git config --global --add safe.directory "*"

RUN wget -O phive.phar https://phar.io/releases/phive.phar && \
wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc && \
gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79 && \
gpg --verify phive.phar.asc phive.phar && \
chmod +x phive.phar && \
mv phive.phar /usr/local/bin/phive
27 changes: 27 additions & 0 deletions php-8.3.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM php:8.3-cli

RUN apt-get update && apt-get install -y \
zip \
git \
wget \
gpg \
libicu-dev && \
pecl install -o -f 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"

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 && \
git config --global --add safe.directory "*"

RUN wget -O phive.phar https://phar.io/releases/phive.phar && \
wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc && \
gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79 && \
gpg --verify phive.phar.asc phive.phar && \
chmod +x phive.phar && \
mv phive.phar /usr/local/bin/phive
65 changes: 33 additions & 32 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
backupGlobals="true"
forceCoversAnnotation="true"
defaultTestSuite="all">
<testsuites>
<testsuite name="all">
<directory>tests/</directory>
<directory>examples/Brainfuck/tests/</directory>
<directory>examples/SimpleExpr/tests/</directory>
</testsuite>
<testsuite name="examples">
<directory>examples/Brainfuck/tests/</directory>
<directory>examples/SimpleExpr/tests/</directory>
</testsuite>
<testsuite name="library">
<directory>tests/</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src/</directory>
<directory suffix=".php">examples/Brainfuck/src/</directory>
<directory suffix=".php">examples/SimpleExpr/src/</directory>
</include>
<exclude>
<file>src/RegExp/PropertyIndex.php</file>
<directory>src/RegExp/Properties/</directory>
</exclude>
</coverage>
</phpunit>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
backupGlobals="true"
defaultTestSuite="all"
cacheDirectory="build/.phpunit.cache"
requireCoverageMetadata="true">
<testsuites>
<testsuite name="all">
<directory>tests/</directory>
<directory>examples/Brainfuck/tests/</directory>
<directory>examples/SimpleExpr/tests/</directory>
</testsuite>
<testsuite name="examples">
<directory>examples/Brainfuck/tests/</directory>
<directory>examples/SimpleExpr/tests/</directory>
</testsuite>
<testsuite name="library">
<directory>tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>src/</directory>
<directory>examples/Brainfuck/src/</directory>
<directory>examples/SimpleExpr/src/</directory>
</include>
<exclude>
<file>src/RegExp/PropertyIndex.php</file>
<directory>src/RegExp/Properties/</directory>
</exclude>
</source>
</phpunit>
Loading

0 comments on commit 35e1b35

Please sign in to comment.