Skip to content
This repository has been archived by the owner on Feb 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #6 from jinovak/nette-compatibility
Browse files Browse the repository at this point in the history
Compatibility with Nette 2.4
  • Loading branch information
akadlec authored Sep 25, 2017
2 parents 2ee11d3 + e59eedc commit 5badd11
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- hhvm

matrix:
Expand Down
2 changes: 1 addition & 1 deletion src/IPub/FormDateTime/Controls/BaseControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public function getControl()
$this->template->showCancelButton = $this->cancelButton ? TRUE : FALSE;

return FormDateTime\Utils\Html::el()
->add($this->template);
->insert(NULL, $this->template);
}

/**
Expand Down
5 changes: 2 additions & 3 deletions src/IPub/FormDateTime/Controls/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

use IPub;
use IPub\FormDateTime;
use Tracy\Debugger;

class Date extends BaseControl
{
Expand Down Expand Up @@ -324,9 +323,9 @@ public function getControlPart()

if ($key === static::FIELD_NAME_DATE) {
if (method_exists('Nette\Forms\Helpers', 'exportRules')) {
$exportedRules = Forms\Helpers::exportRules($this->rules);
$exportedRules = Forms\Helpers::exportRules($this->getRules());
} else {
$exportedRules = self::exportRules($this->rules);
$exportedRules = self::exportRules($this->getRules());
}

$control = Utils\Html::el('input');
Expand Down
4 changes: 2 additions & 2 deletions src/IPub/FormDateTime/Controls/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ public function getControlPart()

if ($key === static::FIELD_NAME_TIME) {
if (method_exists('Nette\Forms\Helpers', 'exportRules')) {
$exportedRules = Forms\Helpers::exportRules($this->rules);
$exportedRules = Forms\Helpers::exportRules($this->getRules());
} else {
$exportedRules = self::exportRules($this->rules);
$exportedRules = self::exportRules($this->getRules());
}

$control = Utils\Html::el('input');
Expand Down
4 changes: 2 additions & 2 deletions src/IPub/FormDateTime/Controls/Time.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ public function getControlPart()

if ($key === static::FIELD_NAME_TIME) {
if (method_exists('Nette\Forms\Helpers', 'exportRules')) {
$exportedRules = Forms\Helpers::exportRules($this->rules);
$exportedRules = Forms\Helpers::exportRules($this->getRules());
} else {
$exportedRules = self::exportRules($this->rules);
$exportedRules = self::exportRules($this->getRules());
}

$control = Utils\Html::el('input');
Expand Down
3 changes: 1 addition & 2 deletions src/IPub/FormDateTime/Utils/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Nette;
use Nette\Utils;
use Nette\Bridges;
use Tracy\Debugger;

class Html extends Utils\Html
{
Expand Down Expand Up @@ -103,4 +102,4 @@ public function render($indent = NULL)

return $s;
}
}
}
2 changes: 1 addition & 1 deletion tests/IPubTests/Forms/DatePicker/DateInputTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,4 @@ class DateInputTest extends Tester\TestCase
}
}

\run(new DateInputTest());
(new DateInputTest)->run();
2 changes: 1 addition & 1 deletion tests/IPubTests/Forms/DatePicker/DateTimeInputTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,4 @@ class DateTimeInputTest extends Tester\TestCase
}
}

\run(new DateTimeInputTest());
(new DateTimeInputTest)->run();
2 changes: 1 addition & 1 deletion tests/IPubTests/Forms/DatePicker/TimeInputTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,4 @@ class TimeInputTest extends Tester\TestCase
}
}

\run(new TimeInputTest());
(new TimeInputTest)->run();
4 changes: 0 additions & 4 deletions tests/IPubTests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,3 @@
function id($val) {
return $val;
}

function run(Tester\TestCase $testCase) {
$testCase->run(isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : NULL);
}

0 comments on commit 5badd11

Please sign in to comment.