Skip to content

Commit

Permalink
Compatibility with Nette 3 - type hints & dependencies (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-31 authored and hrach committed May 29, 2019
1 parent ef541bf commit c2f2a68
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
}
],
"require": {
"php": ">=5.6",
"nette/application": "~2.4",
"nette/component-model": "~2.3",
"nette/forms": "~2.4",
"nette/utils": "~2.4",
"latte/latte": "~2.4"
"php": ">=7.2",
"nette/application": "~3.0",
"nette/component-model": "~3.0",
"nette/forms": "~3.0",
"nette/utils": "~3.0",
"latte/latte": "~2.5"
},
"extra": {
"branch-alias": {
Expand Down
11 changes: 6 additions & 5 deletions src/Datagrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use Nette\Application\UI;
use Nette\Bridges\ApplicationLatte\Template;
use Nette\ComponentModel\IComponent;
use Nette\Forms\Container;
use Nette\Forms\Controls\Button;
use Nette\Forms\Controls\Checkbox;
Expand Down Expand Up @@ -307,7 +308,7 @@ public function redrawRow($primaryValue)
}


public function redrawControl($snippet = null, $redraw = true)
public function redrawControl(string $snippet = null, $redraw = true): void
{
parent::redrawControl($snippet, $redraw);
if ($snippet === null || $snippet === 'rows') {
Expand All @@ -327,7 +328,7 @@ function invalidateRow($primaryValue)
/*******************************************************************************/


protected function attached($presenter)
protected function attached(IComponent $presenter): void
{
parent::attached($presenter);
$this->filterDataSource = $this->filter;
Expand Down Expand Up @@ -545,7 +546,7 @@ public function processForm(UI\Form $form)
}


public function loadState(array $params)
public function loadState(array $params): void
{
parent::loadState($params);
if ($this->paginator) {
Expand All @@ -554,9 +555,9 @@ public function loadState(array $params)
}


protected function createTemplate($class = null)
protected function createTemplate(): UI\ITemplate
{
$template = parent::createTemplate($class);
$template = parent::createTemplate();
if ($translator = $this->getTranslator()) {
$template->setTranslator($translator);
}
Expand Down

0 comments on commit c2f2a68

Please sign in to comment.