From c60f1f3cb4cc0c6b753d484c77486cc82a4c91d2 Mon Sep 17 00:00:00 2001 From: Vasily Belosloodcev Date: Mon, 12 Dec 2022 21:29:03 +0500 Subject: [PATCH] PHP 8.2, reduce package size, small fixes. --- .gitattributes | 7 +++++++ .github/workflows/build.yml | 1 + CHANGELOG.md | 7 +++++++ README.md | 16 ++++++++++++++++ composer.json | 3 --- phpcs.php | 5 +++++ src/AdamWathan/Form/Elements/Checkbox.php | 2 +- src/AdamWathan/Form/FormBuilder.php | 2 -- workenv/Dockerfile | 6 +++--- 9 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..7ab11b1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +/.gitignore export-ignore +/.gitattributes export-ignore +/phpunit.xml export-ignore +/workenv export-ignore +/tests export-ignore +/.github export-ignore +/phpcs.php diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62f3254..c8e68cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,7 @@ jobs: - 7.4 - 8.0 - 8.1 + - 8.2 steps: - uses: actions/checkout@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 27a5750..0968052 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,13 @@ php-html-form - *Dep*: Deprecated. - *Fix*: Fixed. +2.0.2 [2022-12-12] +------------------ + +- Add: Support of PHP 8.2. +- Enh: Reduce size of package. +- Fix: Small fixes. + 2.0.1 [2022-01-30] ------------------ diff --git a/README.md b/README.md index fa61937..5118b81 100644 --- a/README.md +++ b/README.md @@ -359,6 +359,22 @@ $ XDEBUG_MODE=coverage ./vendor/bin/phpunit HTML coverage path: `build/coverage/index.html` +Code style +--- + +To fix code style, run: + +``` +~/.composer/vendor/bin/php-cs-fixer fix --config=./phpcs.php --verbose +``` + +You have to install [PHP CS Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) at first, if you +don't use build-in Docker image: + +``` +composer global require friendsofphp/php-cs-fixer "^3.13.0" +``` + License --- diff --git a/composer.json b/composer.json index a8f89b5..a884327 100644 --- a/composer.json +++ b/composer.json @@ -26,8 +26,5 @@ }, "autoload-dev": { "classmap": ["tests/"] - }, - "scripts": { - "cs:fix": "~/.composer/vendor/bin/php-cs-fixer fix --config=./phpcs.php --verbose" } } diff --git a/phpcs.php b/phpcs.php index 4076086..e5bd648 100644 --- a/phpcs.php +++ b/phpcs.php @@ -1,5 +1,10 @@ check(); + $this->check(); } } diff --git a/src/AdamWathan/Form/FormBuilder.php b/src/AdamWathan/Form/FormBuilder.php index 7a48a49..7744329 100644 --- a/src/AdamWathan/Form/FormBuilder.php +++ b/src/AdamWathan/Form/FormBuilder.php @@ -5,8 +5,6 @@ use AdamWathan\Form\Binding\BoundData; use AdamWathan\Form\Elements\Button; use AdamWathan\Form\Elements\Checkbox; -use AdamWathan\Form\Elements\Date; -use AdamWathan\Form\Elements\DateTimeLocal; use AdamWathan\Form\Elements\Email; use AdamWathan\Form\Elements\File; use AdamWathan\Form\Elements\FormOpen; diff --git a/workenv/Dockerfile b/workenv/Dockerfile index 9f107c4..5e60317 100644 --- a/workenv/Dockerfile +++ b/workenv/Dockerfile @@ -1,6 +1,6 @@ -FROM php:8.1-cli-alpine +FROM php:8.2-cli-alpine -RUN apk add --no-cache $PHPIZE_DEPS +RUN apk add --no-cache $PHPIZE_DEPS && apk add --update --no-cache linux-headers RUN pecl install xdebug && docker-php-ext-enable xdebug RUN rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini @@ -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.5.0" +RUN composer global require friendsofphp/php-cs-fixer "^3.13.0" CMD ["php", "-a"]