Skip to content

Commit

Permalink
Remove form model (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Dec 1, 2023
1 parent 6b3bd52 commit b249fae
Show file tree
Hide file tree
Showing 80 changed files with 1,506 additions and 5,622 deletions.
9 changes: 1 addition & 8 deletions composer.json
Expand Up @@ -20,14 +20,8 @@
"prefer-stable": true,
"require": {
"php": "^8.1",
"ext-mbstring": "*",
"yiisoft/friendly-exception": "^1.0",
"yiisoft/html": "^3.3",
"yiisoft/http": "^1.2",
"yiisoft/hydrator": "dev-master",
"yiisoft/hydrator-validator": "dev-master",
"yiisoft/strings": "^2.0",
"yiisoft/validator": "^1.0",
"yiisoft/widget": "^2.1"
},
"require-dev": {
Expand Down Expand Up @@ -58,8 +52,7 @@
},
"config-plugin": {
"params": "params.php",
"bootstrap": "bootstrap.php",
"di": "di.php"
"bootstrap": "bootstrap.php"
}
},
"config": {
Expand Down
15 changes: 0 additions & 15 deletions config/di.php

This file was deleted.

22 changes: 16 additions & 6 deletions src/Field/Base/InputData/PureInputData.php
Expand Up @@ -6,9 +6,19 @@

final class PureInputData implements InputDataInterface
{
/**
* @param string[] $validationErrors
*
* @psalm-param list<string> $validationErrors
*/
public function __construct(
private ?string $name = null,
private mixed $value = null,
private ?string $label = null,
private ?string $hint = null,
private ?string $placeholder = null,
private ?string $id = null,
private ?array $validationErrors = null,
) {
}

Expand All @@ -29,31 +39,31 @@ public function getValue(): mixed

public function getLabel(): ?string
{
return null;
return $this->label;
}

public function getHint(): ?string
{
return null;
return $this->hint;
}

public function getPlaceholder(): ?string
{
return null;
return $this->placeholder;
}

public function getId(): ?string
{
return null;
return $this->id;
}

public function isValidated(): bool
{
return false;
return $this->validationErrors !== null;
}

public function getValidationErrors(): array
{
return [];
return $this->validationErrors ?? [];
}
}

This file was deleted.

13 changes: 0 additions & 13 deletions src/YiisoftFormModel/Exception/StaticObjectPropertyException.php

This file was deleted.

13 changes: 0 additions & 13 deletions src/YiisoftFormModel/Exception/UndefinedArrayElementException.php

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions src/YiisoftFormModel/Exception/ValueNotFoundException.php

This file was deleted.

0 comments on commit b249fae

Please sign in to comment.