Skip to content

Commit 18234ea

Browse files
committed
compatibility with nette/component-model 3.0
1 parent 8e71baf commit 18234ea

File tree

5 files changed

+6
-15
lines changed

5 files changed

+6
-15
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
],
1616
"require": {
1717
"php": ">=7.1",
18-
"nette/component-model": "^2.3",
18+
"nette/component-model": "^3.0",
1919
"nette/http": "^2.2 || ~3.0.0",
2020
"nette/utils": "^3.0"
2121
},

src/Forms/Controls/BaseControl.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,8 @@ public function __construct($caption = NULL)
9494

9595
/**
9696
* This method will be called when the component becomes attached to Form.
97-
* @param Nette\ComponentModel\IComponent
98-
* @return void
9997
*/
100-
protected function attached($form)
98+
protected function attached(Nette\ComponentModel\IComponent $form): void
10199
{
102100
if (!$this->isDisabled() && $form instanceof Form && $form->isAnchored() && $form->isSubmitted()) {
103101
$this->loadHttpData();

src/Forms/Controls/CsrfProtection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct($errorMessage)
3636
}
3737

3838

39-
protected function attached($parent)
39+
protected function attached(Nette\ComponentModel\IComponent $parent): void
4040
{
4141
parent::attached($parent);
4242
if (!$this->session && $parent instanceof Nette\Application\UI\Presenter) {

src/Forms/Controls/UploadControl.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ public function __construct($label = NULL, $multiple = FALSE)
4040
/**
4141
* This method will be called when the component (or component's parent)
4242
* becomes attached to a monitored object. Do not call this method yourself.
43-
* @param Nette\ComponentModel\IComponent
44-
* @return void
4543
*/
46-
protected function attached($form)
44+
protected function attached(Nette\ComponentModel\IComponent $form): void
4745
{
4846
if ($form instanceof Nette\Forms\Form) {
4947
if (!$form->isMethod('post')) {

src/Forms/Form.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,7 @@ public function __construct($name = NULL)
134134
}
135135

136136

137-
/**
138-
* @return void
139-
*/
140-
protected function validateParent(Nette\ComponentModel\IContainer $parent)
137+
protected function validateParent(Nette\ComponentModel\IContainer $parent): void
141138
{
142139
parent::validateParent($parent);
143140
$this->monitor(__CLASS__);
@@ -147,10 +144,8 @@ protected function validateParent(Nette\ComponentModel\IContainer $parent)
147144
/**
148145
* This method will be called when the component (or component's parent)
149146
* becomes attached to a monitored object. Do not call this method yourself.
150-
* @param Nette\ComponentModel\IComponent
151-
* @return void
152147
*/
153-
protected function attached($obj)
148+
protected function attached(Nette\ComponentModel\IComponent $obj): void
154149
{
155150
if ($obj instanceof self) {
156151
throw new Nette\InvalidStateException('Nested forms are forbidden.');

0 commit comments

Comments
 (0)