Skip to content

Commit c60f1f3

Browse files
committed
PHP 8.2, reduce package size, small fixes.
1 parent 9426fd6 commit c60f1f3

File tree

9 files changed

+40
-9
lines changed

9 files changed

+40
-9
lines changed

.gitattributes

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/.gitignore export-ignore
2+
/.gitattributes export-ignore
3+
/phpunit.xml export-ignore
4+
/workenv export-ignore
5+
/tests export-ignore
6+
/.github export-ignore
7+
/phpcs.php

.github/workflows/build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
- 7.4
2121
- 8.0
2222
- 8.1
23+
- 8.2
2324
steps:
2425
- uses: actions/checkout@v2
2526

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ php-html-form
99
- *Dep*: Deprecated.
1010
- *Fix*: Fixed.
1111

12+
2.0.2 [2022-12-12]
13+
------------------
14+
15+
- Add: Support of PHP 8.2.
16+
- Enh: Reduce size of package.
17+
- Fix: Small fixes.
18+
1219
2.0.1 [2022-01-30]
1320
------------------
1421

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,22 @@ $ XDEBUG_MODE=coverage ./vendor/bin/phpunit
359359
360360
HTML coverage path: `build/coverage/index.html`
361361
362+
Code style
363+
---
364+
365+
To fix code style, run:
366+
367+
```
368+
~/.composer/vendor/bin/php-cs-fixer fix --config=./phpcs.php --verbose
369+
```
370+
371+
You have to install [PHP CS Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) at first, if you
372+
don't use build-in Docker image:
373+
374+
```
375+
composer global require friendsofphp/php-cs-fixer "^3.13.0"
376+
```
377+
362378
License
363379
---
364380

composer.json

-3
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,5 @@
2626
},
2727
"autoload-dev": {
2828
"classmap": ["tests/"]
29-
},
30-
"scripts": {
31-
"cs:fix": "~/.composer/vendor/bin/php-cs-fixer fix --config=./phpcs.php --verbose"
3229
}
3330
}

phpcs.php

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?php declare(strict_types=1);
22

3+
/**
4+
* Configuration of code style fixer and checker for this library.
5+
* This configuration compatible with friendsofphp/php-cs-fixer "^3.13.0".
6+
*/
7+
38
use PhpCsFixer\Finder;
49
use PhpCsFixer\Config;
510

src/AdamWathan/Form/Elements/Checkbox.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ protected function checkBinding()
8989
$oldValue = array_map('strval', $oldValue);
9090

9191
if (in_array($currentValue, $oldValue)) {
92-
return $this->check();
92+
$this->check();
9393
}
9494
}
9595

src/AdamWathan/Form/FormBuilder.php

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
use AdamWathan\Form\Binding\BoundData;
66
use AdamWathan\Form\Elements\Button;
77
use AdamWathan\Form\Elements\Checkbox;
8-
use AdamWathan\Form\Elements\Date;
9-
use AdamWathan\Form\Elements\DateTimeLocal;
108
use AdamWathan\Form\Elements\Email;
119
use AdamWathan\Form\Elements\File;
1210
use AdamWathan\Form\Elements\FormOpen;

workenv/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM php:8.1-cli-alpine
1+
FROM php:8.2-cli-alpine
22

3-
RUN apk add --no-cache $PHPIZE_DEPS
3+
RUN apk add --no-cache $PHPIZE_DEPS && apk add --update --no-cache linux-headers
44

55
RUN pecl install xdebug && docker-php-ext-enable xdebug
66
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 \
1313
;fi
1414
RUN export COMPOSER_DISABLE_XDEBUG_WARN=1
1515

16-
RUN composer global require friendsofphp/php-cs-fixer "^3.5.0"
16+
RUN composer global require friendsofphp/php-cs-fixer "^3.13.0"
1717

1818
CMD ["php", "-a"]

0 commit comments

Comments
 (0)