- Fixed a bug when an enum is given as value
This commit is contained in:
parent
94903d6f05
commit
363da77669
@ -176,18 +176,21 @@ class FormContext implements FormContextInterface
|
||||
|
||||
public function pushMessage(FormMessage $message) : void
|
||||
{
|
||||
if ($message->isError() /* && $message->isSuccess() @TODO next major v. */ ) {
|
||||
$this->formContextMessages = array_merge([ $message ], $this->formContextMessages);
|
||||
}
|
||||
else {
|
||||
$this->formContextMessages[] = $message;
|
||||
}
|
||||
}
|
||||
|
||||
public function messages() : array
|
||||
{
|
||||
return $this->formContextMessages;
|
||||
}
|
||||
|
||||
|
||||
protected function fillValues() : void
|
||||
{
|
||||
|
||||
foreach($this->formContextValues as $property => $value) {
|
||||
if ($this->canWriteProperty($property)) {
|
||||
$this->$property = $this->castValue($property, $value);
|
||||
|
||||
@ -12,4 +12,6 @@ interface FormContextInterface {
|
||||
public function requestMethod() : string;
|
||||
|
||||
public function getRequest() : ServerRequestInterface;
|
||||
|
||||
public function getExecutionStatus() : mixed;
|
||||
}
|
||||
@ -4,4 +4,5 @@ namespace Picea\Ui\Method;
|
||||
|
||||
interface FormMessage {
|
||||
public function isError() : bool;
|
||||
# public function isSuccess() : bool; # Should be added in next major version
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user