Skip to content

Commit f30dfa2

Browse files
committed
compatibility with nette/forms 3.0
1 parent 2df8d62 commit f30dfa2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Application/UI/Form.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,26 +83,25 @@ protected function attached(Nette\ComponentModel\IComponent $presenter): void
8383
* Tells if the form is anchored.
8484
* @return bool
8585
*/
86-
public function isAnchored()
86+
public function isAnchored(): bool
8787
{
8888
return (bool) $this->getPresenter(FALSE);
8989
}
9090

9191

9292
/**
9393
* Internal: returns submitted HTTP data or NULL when form was not submitted.
94-
* @return array|NULL
9594
*/
96-
protected function receiveHttpData()
95+
protected function receiveHttpData(): ?array
9796
{
9897
$presenter = $this->getPresenter();
9998
if (!$presenter->isSignalReceiver($this, 'submit')) {
100-
return;
99+
return NULL;
101100
}
102101

103102
$request = $presenter->getRequest();
104103
if ($request->isMethod('forward') || $request->isMethod('post') !== $this->isMethod('post')) {
105-
return;
104+
return NULL;
106105
}
107106

108107
if ($this->isMethod('post')) {
@@ -119,7 +118,7 @@ protected function beforeRender()
119118
$key = ($this->isMethod('post') ? '_' : '') . Presenter::SIGNAL_KEY;
120119
if (!isset($this[$key])) {
121120
$do = $this->lookupPath(Presenter::class) . self::NAME_SEPARATOR . 'submit';
122-
$this[$key] = (new Nette\Forms\Controls\HiddenField($do))->setOmitted()->setHtmlId(FALSE);
121+
$this[$key] = (new Nette\Forms\Controls\HiddenField($do))->setOmitted();
123122
}
124123
}
125124

0 commit comments

Comments
 (0)