diff --git a/src/Method/FormContext.php b/src/Method/FormContext.php index 6b1feb0..78ecdda 100644 --- a/src/Method/FormContext.php +++ b/src/Method/FormContext.php @@ -25,14 +25,14 @@ class FormContext implements FormContextInterface public bool $formSkipCsrf = false; + protected array $formContextDefinedProperties = []; + protected array $formContextCatchedMethods = [ 'POST', 'PUT', 'PATCH', 'DELETE', ]; public ServerRequestInterface $formContextRequest; public ? ResponseInterface $formContextResponse = null; - public FormInterface $form; - public function __construct(ServerRequestInterface $request, ? string $formName = null) { $this->formContextRequest = $request; @@ -177,6 +177,7 @@ class FormContext implements FormContextInterface foreach($this->formContextValues as $property => $value) { if ($this->canWriteProperty($property)) { $this->$property = $value; + $this->formContextDefinedProperties[$property] = true; } } } @@ -188,4 +189,9 @@ class FormContext implements FormContextInterface return ! in_array(strtolower($property), $skipping) && property_exists($this, $property); } + + protected function definedProperty(string $property) : bool + { + return $this->formContextDefinedProperties[$property] ?? false; + } }