Skip to content

Commit 76b60b8

Browse files
committed
v2.0.4
1 parent 3d9ce91 commit 76b60b8

17 files changed

+87
-54
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/.gitignore export-ignore
22
/.gitattributes export-ignore
33
/phpunit.xml export-ignore
4+
/phpunit.legacy.xml export-ignore
45
/workenv export-ignore
56
/tests export-ignore
67
/.github export-ignore
7-
/phpcs.php export-ignore
8+
/.php-cs-fixer.php export-ignore

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
- 8.1
2323
- 8.2
2424
- 8.3
25+
- 8.4
2526
include:
2627
- phpunit: phpunit.xml
2728
- php: 5.6

phpcs.php renamed to .php-cs-fixer.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* Configuration of code style fixer and checker for this library.
5-
* This configuration compatible with friendsofphp/php-cs-fixer "^3.43.1".
5+
* This configuration compatible with friendsofphp/php-cs-fixer "^3.65.0".
66
*/
77

88
use PhpCsFixer\Finder;
@@ -14,10 +14,8 @@
1414

1515
$config = new Config();
1616
$config->setRules([
17-
'@PSR2' => true,
18-
'array_syntax' => [
19-
'syntax' => 'short',
20-
],
17+
'@PER-CS' => true,
18+
'single_line_empty_body' => false,
2119
]);
2220
$config->setFinder($finder);
2321

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ php-html-form
99
- *Dep*: Deprecated.
1010
- *Fix*: Fixed.
1111

12+
2.0.4 [2024-12-21]
13+
------------------
14+
15+
- Add: Supporting of PHP 8.4.
16+
- Enh: Code style fixes.
17+
1218
2.0.3 [2023-12-30]
1319
------------------
1420

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ The MIT License (MIT)
22

33
Copyright (c) 2016 Adam Wathan <[email protected]>
44

5-
Copyright (c) 2023 Vasily Belosloodcev <[email protected]>
5+
Copyright (c) 2024 Vasily Belosloodcev <[email protected]>
66

77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ php-html-form
22
===
33

44
This is fork of [adamwathan/form](https://github.com/adamwathan/form). There is just HTML-elements builder
5-
without any framework support. Extension are supporting PHP from 5.6 to 8.x!
5+
without any framework support. Extension are supporting PHP from 5.6 up to newest!
66

77

88
[![Stable Version](https://poser.pugx.org/bupy7/php-html-form/v/stable)](https://packagist.org/packages/bupy7/php-html-form)
@@ -365,7 +365,7 @@ Code style
365365
To fix code style, run:
366366
367367
```
368-
~/.composer/vendor/bin/php-cs-fixer fix --config=./phpcs.php --verbose
368+
~/.composer/vendor/bin/php-cs-fixer fix --verbose
369369
```
370370
371371
You have to install [PHP CS Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) at first, if you

src/AdamWathan/Form/Elements/Element.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ public function data($attribute, $value = null)
2929
{
3030
if (is_array($attribute)) {
3131
foreach ($attribute as $key => $val) {
32-
$this->setAttribute('data-'.$key, $val);
32+
$this->setAttribute('data-' . $key, $val);
3333
}
3434
} else {
35-
$this->setAttribute('data-'.$attribute, $value);
35+
$this->setAttribute('data-' . $attribute, $value);
3636
}
3737

3838
return $this;
@@ -137,7 +137,7 @@ protected function setBooleanAttribute($attribute, $value)
137137

138138
protected function escape($value)
139139
{
140-
return htmlentities((string)$value, ENT_QUOTES, 'UTF-8');
140+
return htmlentities((string) $value, ENT_QUOTES, 'UTF-8');
141141
}
142142

143143
public function __call($method, $params)

src/AdamWathan/Form/Elements/Select.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function getOptAttribute($optValue, $name)
148148
}
149149
return null;
150150
}
151-
151+
152152
public function prompt($label = '', $value = '')
153153
{
154154
$this->options = [$value => $label] + $this->options;

src/AdamWathan/Form/FormBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function setToken($token)
3737

3838
public function open()
3939
{
40-
$open = new FormOpen;
40+
$open = new FormOpen();
4141

4242
if ($this->hasToken()) {
4343
$open->token($this->csrfToken);

tests/BindingTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class BindingTest extends TestCase
1111

1212
protected function _setUp()
1313
{
14-
$this->form = new FormBuilder;
14+
$this->form = new FormBuilder();
1515
}
1616

1717
protected function _tearDown()
@@ -128,7 +128,7 @@ public function testBindUnsetProperty()
128128

129129
public function testBindMagicProperty()
130130
{
131-
$object = new MagicGetter;
131+
$object = new MagicGetter();
132132
$this->form->bind($object);
133133

134134
$expected = '<input type="text" name="not_magic" value="foo">';
@@ -167,8 +167,8 @@ public function testBindNestedArray()
167167
'city' => 'Roswell',
168168
'tree' => [
169169
'has' => [
170-
'nested' => 'Bird'
171-
]
170+
'nested' => 'Bird',
171+
],
172172
],
173173
],
174174
];
@@ -188,7 +188,7 @@ public function testBindNestedArrayWithMissingKey()
188188
$array = [
189189
'address' => [
190190
'tree' => [
191-
'nested' => 'Bird'
191+
'nested' => 'Bird',
192192
],
193193
],
194194
];
@@ -227,8 +227,8 @@ public function testBindNestedObject()
227227
'city' => 'Roswell',
228228
'tree' => [
229229
'has' => [
230-
'nested' => 'Bird'
231-
]
230+
'nested' => 'Bird',
231+
],
232232
],
233233
],
234234
]));
@@ -250,8 +250,8 @@ public function testBindNestedMixed()
250250
'city' => 'Roswell',
251251
'tree' => json_decode(json_encode([
252252
'has' => [
253-
'nested' => 'Bird'
254-
]
253+
'nested' => 'Bird',
254+
],
255255
])),
256256
],
257257
];
@@ -407,7 +407,7 @@ public function testExplicitCheckOnRadioTakesPrecedenceOverBinding()
407407

408408
private function getStubObject()
409409
{
410-
$obj = new stdClass;
410+
$obj = new stdClass();
411411

412412
$obj->email = '[email protected]';
413413
$obj->first_name = 'John';

0 commit comments

Comments
 (0)