Skip to content

Commit 32c0a5a

Browse files
committed
update
1 parent 03c29a3 commit 32c0a5a

File tree

10 files changed

+32
-32
lines changed

10 files changed

+32
-32
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
namespace MintyPHP\Form\Bulma;
44

55
use DOMElement;
6-
use MintyPHP\Form\FormCheckboxes as Base;
6+
use MintyPHP\Form\Checkboxes as Base;
77

8-
class FormCheckboxes extends Base
8+
class Checkboxes extends Base
99
{
1010
public function __construct()
1111
{
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace MintyPHP\Form\Bulma;
44

5-
use MintyPHP\Form\FormError as Base;
5+
use MintyPHP\Form\Error as Base;
66

7-
class FormError extends Base
7+
class Error extends Base
88
{
99
public function __construct()
1010
{

src/Bulma/FormField.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace MintyPHP\Form\Bulma;
44

5-
use MintyPHP\Form\FormCheckbox;
6-
use MintyPHP\Form\FormCheckboxes;
5+
use MintyPHP\Form\Checkbox;
6+
use MintyPHP\Form\Checkboxes;
77
use MintyPHP\Form\FormField as Base;
88

99
class FormField extends Base
@@ -22,7 +22,7 @@ public function setError(string $message): void
2222

2323
public function renderDom(\DOMDocument $doc): \DOMElement
2424
{
25-
if ($this->control instanceof FormCheckbox && $this->label) {
25+
if ($this->control instanceof Checkbox && $this->label) {
2626
$this->label->removeClass('label');
2727
$this->label->addClass('checkbox');
2828
$control = $this->control->renderDom($doc);
@@ -38,7 +38,7 @@ public function renderDom(\DOMDocument $doc): \DOMElement
3838
}
3939
return $field;
4040
}
41-
if ($this->control instanceof FormCheckboxes && $this->label) {
41+
if ($this->control instanceof Checkboxes && $this->label) {
4242
$field = $this->renderElement($doc);
4343
$field->appendChild($this->label->renderDom($doc));
4444
$field->appendChild($this->control->renderDom($doc));
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use DOMElement;
66
use MintyPHP\Form\Validator\Validator;
77

8-
class FormCheckbox extends Input
8+
class Checkbox extends Input
99
{
1010
use HtmlElement;
1111

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use DOMElement;
66
use MintyPHP\Form\Validator\Validator;
77

8-
class FormCheckboxes implements FormControl
8+
class Checkboxes implements FormControl
99
{
1010
use HtmlElement;
1111

src/Elements.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ public static function textarea(string $name = '', string $placeholder = ''): Te
138138
return $textarea;
139139
}
140140

141-
public static function checkbox(string $name = '', string $value = 'on'): FormCheckbox
141+
public static function checkbox(string $name = '', string $value = 'on'): Checkbox
142142
{
143-
/** @var FormCheckbox */
144-
$input = self::create('FormCheckbox');
143+
/** @var Checkbox */
144+
$input = self::create('Checkbox');
145145
if ($name) {
146146
$input->name($name);
147147
}
@@ -170,10 +170,10 @@ public static function select(string $name = '', array $options = []): Select
170170
/**
171171
* @param array<string, string> $options
172172
*/
173-
public static function checkboxes(string $name = '', array $options = []): FormCheckboxes
173+
public static function checkboxes(string $name = '', array $options = []): Checkboxes
174174
{
175-
/** @var FormCheckboxes */
176-
$checkboxes = self::create('FormCheckboxes');
175+
/** @var Checkboxes */
176+
$checkboxes = self::create('Checkboxes');
177177
if ($name) {
178178
$checkboxes->name($name);
179179
}
@@ -207,17 +207,17 @@ public static function legend(): FormLegend
207207
return $legend;
208208
}
209209

210-
public static function error(): FormError
210+
public static function error(): Error
211211
{
212-
/** @var FormError */
213-
$error = self::create('FormError');
212+
/** @var Error */
213+
$error = self::create('Error');
214214
return $error;
215215
}
216216

217-
public static function fieldset(): FormFieldset
217+
public static function fieldset(): Fieldset
218218
{
219-
/** @var FormFieldset */
220-
$fieldset = self::create('FormFieldset');
219+
/** @var Fieldset */
220+
$fieldset = self::create('Fieldset');
221221
return $fieldset;
222222
}
223223
}

src/FormError.php renamed to src/Error.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use DOMElement;
66

7-
class FormError
7+
class Error
88
{
99
use HtmlElement;
1010

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use MintyPHP\Form\HtmlElement;
66
use DOMElement;
77

8-
class FormFieldset
8+
class Fieldset
99
{
1010
use HtmlElement;
1111

src/Form.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Form
99
protected string $action = '';
1010
protected string $method = 'POST';
1111
protected string $enctype = 'application/x-www-form-urlencoded';
12-
/** @var FormFieldset[] */
12+
/** @var Fieldset[] */
1313
protected array $fieldsets = [];
1414

1515
protected bool $hideFieldsets = false;
@@ -68,14 +68,14 @@ public function attributes(array $attributes): self
6868
return $this;
6969
}
7070

71-
public function fieldset(FormFieldset $fieldset): self
71+
public function fieldset(Fieldset $fieldset): self
7272
{
7373
$this->fieldsets[] = $fieldset;
7474
return $this;
7575
}
7676

7777
/**
78-
* @param FormFieldset[] $fieldsets
78+
* @param Fieldset[] $fieldsets
7979
*/
8080
public function fieldsets(array $fieldsets): self
8181
{
@@ -88,7 +88,7 @@ public function fieldsets(array $fieldsets): self
8888
public function field(FormField $field): self
8989
{
9090
$this->hideFieldsets = true;
91-
$fieldset = new FormFieldset();
91+
$fieldset = new Fieldset();
9292
$fieldset->field($field);
9393
$this->fieldset($fieldset);
9494
return $this;

src/FormField.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class FormField
1111

1212
protected ?Label $label = null;
1313
protected ?FormControl $control = null;
14-
protected ?FormError $error = null;
14+
protected ?Error $error = null;
1515
/** @var Validator[] */
1616
protected array $validators = [];
1717

@@ -79,7 +79,7 @@ public function validators(array $validators): self
7979
return $this;
8080
}
8181

82-
public function error(FormError $error): self
82+
public function error(Error $error): self
8383
{
8484
$this->error = $error;
8585
return $this;
@@ -136,8 +136,8 @@ public function setError(string $message): void
136136
}
137137
if ($message) {
138138
if (!$this->error) {
139-
/** @var FormError */
140-
$error = Elements::create('FormError');
139+
/** @var Error */
140+
$error = Elements::create('Error');
141141
$this->error = $error;
142142
}
143143
} else if ($this->hideError) {

0 commit comments

Comments
 (0)