Skip to content

Commit

Permalink
Fix psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
zonky2 committed Jan 18, 2023
1 parent c1713b7 commit b74264d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Listener/SubSelectPalettesListener.php
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of contao-community-alliance/meta-palettes.
*
* (c) 2015-2022 Contao Community Alliance.
* (c) 2015-2023 Contao Community Alliance.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -17,7 +17,7 @@
* @author Sven Baumann <baumann.sv@gmail.com>
* @author Ingolf Steinhardt <info@e-spin.de>
* @copyright 2013-2014 bit3 UG
* @copyright 2015-2022 Contao Community Alliance.
* @copyright 2015-2023 Contao Community Alliance.
* @license https://github.com/contao-community-alliance/meta-palettes/license LGPL-3.0-or-later
* @filesource
*/
Expand All @@ -34,6 +34,8 @@
use ContaoCommunityAlliance\DcGeneral\Data\ModelInterface;
use ContaoCommunityAlliance\MetaPalettes\MetaPalettes;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Exception;

use const E_USER_DEPRECATED;
use const E_USER_ERROR;

Expand Down Expand Up @@ -163,6 +165,7 @@ protected function triggerSubselectPaletteError($strTable, $strSelector, $arrPal
* @return mixed|null
*
* @SuppressWarnings(PHPMD.Superglobals)
* @throws Exception
*/
private function getValue($dataContainer, $strTable, $strSelector)
{
Expand Down Expand Up @@ -190,7 +193,7 @@ private function getValue($dataContainer, $strTable, $strSelector)

// or break, when unable to handle data container
if ($dataContainer instanceof DC_Table
&& $this->connection->getSchemaManager()->tablesExist([$dataContainer->table])
&& $this->connection->createSchemaManager()()->tablesExist([$dataContainer->table])
) {
return $this->fetchValueFromDatabase($dataContainer, $strSelector);
}
Expand Down Expand Up @@ -331,7 +334,7 @@ private function fetchValueFromDatabase($dataContainer, $strSelector)
->where('id=:value')
->setParameter('value', $dataContainer->id)
->setMaxResults(1)
->execute();
->executeQuery();

assert(! is_int($statement));

Expand Down

0 comments on commit b74264d

Please sign in to comment.