Skip to content

Commit f49f8cf

Browse files
committed
Merge pull request #93 from JanTvrdik/php56
5.6
2 parents a948207 + f48f5d8 commit f49f8cf

32 files changed

+60
-62
lines changed

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
language: php
22
php:
3-
- 5.4
4-
- 5.5
53
- 5.6
64
- 7.0
75
- hhvm
@@ -12,7 +10,7 @@ matrix:
1210
- php: hhvm
1311

1412
include:
15-
- php: 5.5
13+
- php: 5.6
1614
env: dependencies="--prefer-lowest --prefer-stable"
1715

1816
script:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515
],
1616
"require": {
17-
"php": ">=5.4.4",
17+
"php": ">=5.6.0",
1818
"nette/component-model": "~2.2",
1919
"nette/http": "~2.2",
2020
"nette/utils": "~2.2"

src/Bridges/FormsLatte/Runtime.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ public static function renderFormEnd(Form $form, $withTags = TRUE)
5656
}
5757
}
5858

59-
foreach ($form->getComponents(TRUE, 'Nette\Forms\Controls\HiddenField') as $control) {
59+
foreach ($form->getComponents(TRUE, Nette\Forms\Controls\HiddenField::class) as $control) {
6060
if (!$control->getOption('rendered')) {
6161
$s .= $control->getControl();
6262
}
6363
}
6464

65-
if (iterator_count($form->getComponents(TRUE, 'Nette\Forms\Controls\TextInput')) < 2) {
65+
if (iterator_count($form->getComponents(TRUE, Nette\Forms\Controls\TextInput::class)) < 2) {
6666
$s .= "<!--[if IE]><input type=IEbug disabled style=\"display:none\"><![endif]-->\n";
6767
}
6868

src/Forms/Container.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public function addComponent(Nette\ComponentModel\IComponent $component, $name,
207207
*/
208208
public function getControls()
209209
{
210-
return $this->getComponents(TRUE, 'Nette\Forms\IControl');
210+
return $this->getComponents(TRUE, IControl::class);
211211
}
212212

213213

@@ -218,7 +218,7 @@ public function getControls()
218218
*/
219219
public function getForm($need = TRUE)
220220
{
221-
return $this->lookup('Nette\Forms\Form', $need);
221+
return $this->lookup(Form::class, $need);
222222
}
223223

224224

src/Forms/Controls/BaseControl.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ abstract class BaseControl extends Nette\ComponentModel\Component implements ICo
7575
*/
7676
public function __construct($caption = NULL)
7777
{
78-
$this->monitor('Nette\Forms\Form');
78+
$this->monitor(Form::class);
7979
parent::__construct();
8080
$this->control = Html::el('input', ['type' => NULL, 'name' => NULL]);
8181
$this->label = Html::el('label');
@@ -105,7 +105,7 @@ protected function attached($form)
105105
*/
106106
public function getForm($need = TRUE)
107107
{
108-
return $this->lookup('Nette\Forms\Form', $need);
108+
return $this->lookup(Form::class, $need);
109109
}
110110

111111

@@ -135,7 +135,7 @@ public function getHttpData($type, $htmlTail = NULL)
135135
*/
136136
public function getHtmlName()
137137
{
138-
return Nette\Forms\Helpers::generateHtmlName($this->lookupPath('Nette\Forms\Form'));
138+
return Nette\Forms\Helpers::generateHtmlName($this->lookupPath(Form::class));
139139
}
140140

141141

src/Forms/Controls/CsrfProtection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct($message)
2929
{
3030
parent::__construct();
3131
$this->setOmitted()->addRule(self::PROTECTION, $message);
32-
$this->monitor('Nette\Application\UI\Presenter');
32+
$this->monitor(Nette\Application\UI\Presenter::class);
3333
}
3434

3535

src/Forms/Controls/HiddenField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct($persistentValue = NULL)
2424
parent::__construct();
2525
$this->control->type = 'hidden';
2626
if ($persistentValue !== NULL) {
27-
$this->unmonitor('Nette\Forms\Form');
27+
$this->unmonitor(Nette\Forms\Form::class);
2828
$this->persistValue = TRUE;
2929
$this->value = (string) $persistentValue;
3030
}

src/Forms/Controls/SubmitButton.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function getControl($caption = NULL)
112112
{
113113
$scope = [];
114114
foreach ((array) $this->validationScope as $control) {
115-
$scope[] = $control->lookupPath('Nette\Forms\Form');
115+
$scope[] = $control->lookupPath(Nette\Forms\Form::class);
116116
}
117117
return parent::getControl($caption)->addAttributes([
118118
'formnovalidate' => $this->validationScope !== NULL,

src/Forms/Rendering/DefaultFormRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function renderEnd()
193193
$s .= $control->getControl();
194194
}
195195
}
196-
if (iterator_count($this->form->getComponents(TRUE, 'Nette\Forms\Controls\TextInput')) < 2) {
196+
if (iterator_count($this->form->getComponents(TRUE, Nette\Forms\Controls\TextInput::class)) < 2) {
197197
$s .= '<!--[if IE]><input type=IEbug disabled style="display:none"><![endif]-->';
198198
}
199199
if ($s) {

tests/Forms.DI/FormsExtension.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ Assert::exception(function () {
4949
', 'neon'));
5050

5151
eval($compiler->compile($config, 'Container2'));
52-
}, 'Nette\InvalidArgumentException', 'Constant Nette\Forms\Form::Foo\Bar or constant Foo\Bar does not exist.');
52+
}, Nette\InvalidArgumentException::class, 'Constant Nette\Forms\Form::Foo\Bar or constant Foo\Bar does not exist.');

0 commit comments

Comments
 (0)