diff --git a/Grid/Column/Column.php b/Grid/Column/Column.php index 53a8d7e2..cd73ebb8 100644 --- a/Grid/Column/Column.php +++ b/Grid/Column/Column.php @@ -294,7 +294,7 @@ public function isVisible($isExported = false) { $visible = $isExported && $this->export !== null ? $this->export : $this->visible; - if ($visible && $this->authorizationChecker !== null && $this->getRole() != null) { + if ($visible && $this->authorizationChecker !== null && $this->getRole() !== null) { return $this->authorizationChecker->isGranted($this->getRole()); } diff --git a/Grid/Export/Export.php b/Grid/Export/Export.php index e732da63..a7b5d521 100644 --- a/Grid/Export/Export.php +++ b/Grid/Export/Export.php @@ -459,7 +459,7 @@ protected function getTemplatesFromString($theme) $templates = []; $template = $this->twig->loadTemplate($theme); - while ($template != null) { + while ($template !== null) { $templates[] = $template; $template = $template->getParent([]); } diff --git a/Grid/Grid.php b/Grid/Grid.php index 23530b4c..39827b3e 100644 --- a/Grid/Grid.php +++ b/Grid/Grid.php @@ -345,12 +345,12 @@ public function initialize() } // Route - if (null != $config->getRoute()) { + if (null !== $config->getRoute()) { $this->setRouteUrl($this->router->generate($config->getRoute(), $routeParameters)); } // Route - if (null != $config->getRoute()) { + if (null !== $config->getRoute()) { $this->setRouteUrl($this->router->generate($config->getRoute(), $routeParameters)); } @@ -371,14 +371,14 @@ public function initialize() // Source $source = $config->getSource(); - if (null != $source) { + if (null !== $source) { $this->source = $source; $source->initialise($this->container); if ($source instanceof Entity) { $groupBy = $config->getGroupBy(); - if (null != $groupBy) { + if (null !== $groupBy) { if (!is_array($groupBy)) { $groupBy = [$groupBy]; } @@ -390,11 +390,11 @@ public function initialize() } // Order - if (null != $config->getSortBy()) { + if (null !== $config->getSortBy()) { $this->setDefaultOrder($config->getSortBy(), $config->getOrder()); } - if (null != $config->getMaxPerPage()) { + if (null !== $config->getMaxPerPage()) { $this->setLimits($config->getMaxPerPage()); } @@ -609,7 +609,7 @@ protected function processMassActions($actionId) if (array_key_exists($actionId, $this->massActions)) { $action = $this->massActions[$actionId]; $actionAllKeys = (boolean) $this->getFromRequest(self::REQUEST_QUERY_MASS_ACTION_ALL_KEYS_SELECTED); - $actionKeys = $actionAllKeys == false ? array_keys((array) $this->getFromRequest(MassActionColumn::ID)) : []; + $actionKeys = $actionAllKeys === false ? array_keys((array) $this->getFromRequest(MassActionColumn::ID)) : []; $this->processSessionData(); if ($actionAllKeys) { @@ -619,7 +619,7 @@ protected function processMassActions($actionId) $this->prepare(); - if ($actionAllKeys == true) { + if ($actionAllKeys === true) { foreach ($this->rows as $row) { $actionKeys[] = $row->getPrimaryFieldValue(); } @@ -697,7 +697,7 @@ protected function processExports($exportId) */ protected function processTweaks($tweakId) { - if ($tweakId != null) { + if ($tweakId !== null) { if (array_key_exists($tweakId, $this->tweaks)) { $tweak = $this->tweaks[$tweakId]; $saveAsActive = false; @@ -804,12 +804,12 @@ protected function processRequestFilters() //if no item is selectd in multi select filter : simulate empty first choice if ($column->getFilterType() == 'select' - && $column->getSelectMulti() == true - && $data == null - && $this->getFromRequest(self::REQUEST_QUERY_PAGE) == null - && $this->getFromRequest(self::REQUEST_QUERY_ORDER) == null - && $this->getFromRequest(self::REQUEST_QUERY_LIMIT) == null - && ($this->getFromRequest(self::REQUEST_QUERY_MASS_ACTION) == null || $this->getFromRequest(self::REQUEST_QUERY_MASS_ACTION) == '-1')) { + && $column->getSelectMulti() === true + && $data === null + && $this->getFromRequest(self::REQUEST_QUERY_PAGE) === null + && $this->getFromRequest(self::REQUEST_QUERY_ORDER) === null + && $this->getFromRequest(self::REQUEST_QUERY_LIMIT) === null + && ($this->getFromRequest(self::REQUEST_QUERY_MASS_ACTION) === null || $this->getFromRequest(self::REQUEST_QUERY_MASS_ACTION) == '-1')) { $data = ['from' => '']; } @@ -1836,7 +1836,7 @@ public function isFiltered() */ public function isTitleSectionVisible() { - if ($this->showTitles == true) { + if ($this->showTitles === true) { foreach ($this->columns as $column) { if ($column->getTitle() != '') { return true; @@ -1852,7 +1852,7 @@ public function isTitleSectionVisible() */ public function isFilterSectionVisible() { - if ($this->showFilters == true) { + if ($this->showFilters === true) { foreach ($this->columns as $column) { if ($column->isFilterable() && $column->getType() != 'massaction' && $column->getType() != 'actions') { return true; diff --git a/Grid/GridFactory.php b/Grid/GridFactory.php index ff692de0..7be18ca2 100644 --- a/Grid/GridFactory.php +++ b/Grid/GridFactory.php @@ -124,7 +124,7 @@ private function resolveOptions(GridTypeInterface $type, Source $source = null, $type->configureOptions($resolver); - if (null != $source && !isset($options['source'])) { + if (null !== $source && !isset($options['source'])) { $options['source'] = $source; } diff --git a/Grid/Helper/ORMCountWalker.php b/Grid/Helper/ORMCountWalker.php index 0b1f1f30..9bfc3a99 100644 --- a/Grid/Helper/ORMCountWalker.php +++ b/Grid/Helper/ORMCountWalker.php @@ -68,7 +68,7 @@ public function walkSelectStatement(SelectStatement $AST) // Remove the variables which are not used by other clauses foreach ($AST->selectClause->selectExpressions as $key => $selectExpression) { - if ($selectExpression->fieldIdentificationVariable == null) { + if ($selectExpression->fieldIdentificationVariable === null) { unset($AST->selectClause->selectExpressions[$key]); } elseif ($selectExpression->expression instanceof PathExpression) { $groupByClause[] = $selectExpression->expression; diff --git a/Grid/Source/Document.php b/Grid/Source/Document.php index cf4f6c34..56020e7a 100644 --- a/Grid/Source/Document.php +++ b/Grid/Source/Document.php @@ -267,7 +267,7 @@ public function execute($columns, $page = 0, $limit = 0, $maxResults = null, $gr $this->addReferencedFields($row, $resource); //call overridden prepareRow or associated closure - if (($modifiedRow = $this->prepareRow($row)) != null) { + if (($modifiedRow = $this->prepareRow($row)) !== null) { $result->addRow($modifiedRow); } } diff --git a/Grid/Source/Entity.php b/Grid/Source/Entity.php index d5a5c252..54700a58 100644 --- a/Grid/Source/Entity.php +++ b/Grid/Source/Entity.php @@ -551,7 +551,7 @@ public function execute($columns, $page = 0, $limit = 0, $maxResults = null, $gr $row->setRepository($repository); //call overridden prepareRow or associated closure - if (($modifiedRow = $this->prepareRow($row)) != null) { + if (($modifiedRow = $this->prepareRow($row)) !== null) { $result->addRow($modifiedRow); } } @@ -582,7 +582,7 @@ public function getTotalCount($maxResults = null) $countQuery->setHint(CountWalker::HINT_DISTINCT, true); } - if ($countQuery->getHint(Query::HINT_CUSTOM_OUTPUT_WALKER) == false) { + if ($countQuery->getHint(Query::HINT_CUSTOM_OUTPUT_WALKER) === false) { $platform = $countQuery->getEntityManager()->getConnection()->getDatabasePlatform(); // law of demeter win $rsm = new ResultSetMapping(); diff --git a/Twig/DataGridExtension.php b/Twig/DataGridExtension.php index f6186287..77f37b1b 100644 --- a/Twig/DataGridExtension.php +++ b/Twig/DataGridExtension.php @@ -452,7 +452,7 @@ protected function getTemplatesFromString(Twig_Environment $environment, $theme) $this->templates = []; $template = $environment->loadTemplate($theme); - while ($template != null) { + while ($template !== null) { $this->templates[] = $template; $template = $template->getParent([]); }