Skip to content

Commit

Permalink
Merge pull request #1 from verasminsk/php-7.4-fix
Browse files Browse the repository at this point in the history
PHP 7.4 fix
  • Loading branch information
verasminsk authored Nov 19, 2020
2 parents dc0c2d8 + 42da044 commit de72e0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Twig/DataGridExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class DataGridExtension extends AbstractExtension implements GlobalsInterface
/**
* @var array
*/
protected $names;
protected $names = [];

/**
* @var array
Expand Down Expand Up @@ -241,7 +241,7 @@ public function getGridCell(Environment $environment, $column, $row, $grid)
{
$value = $column->renderCell($row->getField($column->getId()), $row, $this->router);

$id = $this->names[$grid->getHash()];
$id = $this->names[$grid->getHash()] ?? '';

if (($id != '' && ($this->hasBlock($environment, $block = 'grid_' . $id . '_column_' . $column->getRenderBlockId() . '_cell')
|| $this->hasBlock($environment, $block = 'grid_' . $id . '_column_' . $column->getType() . '_cell')
Expand Down Expand Up @@ -273,7 +273,7 @@ public function getGridCell(Environment $environment, $column, $row, $grid)
*/
public function getGridFilter(Environment $environment, $column, $grid, $submitOnChange = true)
{
$id = $this->names[$grid->getHash()];
$id = $this->names[$grid->getHash()] ?? '';

if ((('' != $id && ($this->hasBlock(
$environment,
Expand Down

0 comments on commit de72e0c

Please sign in to comment.