From 3d9ce9123574bf049b77fce273ad68bc6b6efe92 Mon Sep 17 00:00:00 2001 From: Vasily Belosloodcev Date: Sat, 30 Dec 2023 18:22:00 +0500 Subject: [PATCH] Supporting of PHP 8.3. --- .github/workflows/build.yml | 26 ++++++++++++++++++++++---- .gitignore | 1 + CHANGELOG.md | 5 +++++ LICENSE.md | 2 +- README.md | 2 +- phpcs.php | 2 +- phpunit.legacy.xml | 27 +++++++++++++++++++++++++++ phpunit.xml | 28 +++++++++++++++++----------- tests/FormBuilderTest.php | 2 +- workenv/Dockerfile | 4 ++-- 10 files changed, 78 insertions(+), 21 deletions(-) create mode 100644 phpunit.legacy.xml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8e68cd..00d9622 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,8 +21,26 @@ jobs: - 8.0 - 8.1 - 8.2 + - 8.3 + include: + - phpunit: phpunit.xml + - php: 5.6 + phpunit: phpunit.legacy.xml + - php: 7.0 + phpunit: phpunit.legacy.xml + - php: 7.1 + phpunit: phpunit.legacy.xml + - php: 7.2 + phpunit: phpunit.legacy.xml + - php: 7.3 + phpunit: phpunit.legacy.xml + - php: 7.4 + phpunit: phpunit.legacy.xml + - php: 8.0 + phpunit: phpunit.legacy.xml + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install PHP uses: shivammathur/setup-php@v2 @@ -34,10 +52,10 @@ jobs: - name: Get Composer Cache Directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache Composer packages - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} @@ -47,7 +65,7 @@ jobs: run: composer install --no-plugins - name: Run test suite - run: XDEBUG_MODE=coverage ./vendor/bin/phpunit + run: XDEBUG_MODE=coverage ./vendor/bin/phpunit --configuration ${{ matrix.phpunit }} - name: Upload coverage results to Coveralls env: diff --git a/.gitignore b/.gitignore index 45a160c..e7f7257 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /.php-cs-fixer.cache /docker-compose.yml /.phpunit.result.cache +/.phpunit.cache diff --git a/CHANGELOG.md b/CHANGELOG.md index 0968052..1c3e644 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,11 @@ php-html-form - *Dep*: Deprecated. - *Fix*: Fixed. +2.0.3 [2023-12-30] +------------------ + +- Add: Supporting of PHP 8.3. + 2.0.2 [2022-12-12] ------------------ diff --git a/LICENSE.md b/LICENSE.md index ec7000b..6ce98b0 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -2,7 +2,7 @@ The MIT License (MIT) Copyright (c) 2016 Adam Wathan -Copyright (c) 2022 Vasily Belosloodcev +Copyright (c) 2023 Vasily Belosloodcev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 5118b81..bbf027e 100644 --- a/README.md +++ b/README.md @@ -372,7 +372,7 @@ You have to install [PHP CS Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) don't use build-in Docker image: ``` -composer global require friendsofphp/php-cs-fixer "^3.13.0" +composer global require friendsofphp/php-cs-fixer ``` License diff --git a/phpcs.php b/phpcs.php index e5bd648..6c18256 100644 --- a/phpcs.php +++ b/phpcs.php @@ -2,7 +2,7 @@ /** * Configuration of code style fixer and checker for this library. - * This configuration compatible with friendsofphp/php-cs-fixer "^3.13.0". + * This configuration compatible with friendsofphp/php-cs-fixer "^3.43.1". */ use PhpCsFixer\Finder; diff --git a/phpunit.legacy.xml b/phpunit.legacy.xml new file mode 100644 index 0000000..abddbe5 --- /dev/null +++ b/phpunit.legacy.xml @@ -0,0 +1,27 @@ + + + + + + tests + tests/TestCase.php + tests/bootstrap.php + tests/InputContractTest.php + tests/TextSubclassContractTest.php + + + + + src + + + + + + + diff --git a/phpunit.xml b/phpunit.xml index abddbe5..0d944ea 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,10 +1,17 @@ + colors="true" + cacheDirectory=".phpunit.cache" +> + + + + + + @@ -15,13 +22,12 @@ tests/TextSubclassContractTest.php - - + + + + + src - - - - - - + + diff --git a/tests/FormBuilderTest.php b/tests/FormBuilderTest.php index 164af98..ce94cbd 100644 --- a/tests/FormBuilderTest.php +++ b/tests/FormBuilderTest.php @@ -114,7 +114,7 @@ public function testButton($value, $name, $expected) $this->assertEquals($expected, $result); } - public function buttonProvider() + public static function buttonProvider() { return [ ['Click Me', 'click-me', ''], diff --git a/workenv/Dockerfile b/workenv/Dockerfile index 5e60317..17ea256 100644 --- a/workenv/Dockerfile +++ b/workenv/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2-cli-alpine +FROM php:8.3-cli-alpine RUN apk add --no-cache $PHPIZE_DEPS && apk add --update --no-cache linux-headers @@ -13,6 +13,6 @@ RUN if [ ${GITHUB_OAUTH_TOKEN} != false ]; then \ ;fi RUN export COMPOSER_DISABLE_XDEBUG_WARN=1 -RUN composer global require friendsofphp/php-cs-fixer "^3.13.0" +RUN composer global require friendsofphp/php-cs-fixer "^3.43.1" CMD ["php", "-a"]