diff --git a/typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php b/typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php index 51e15a564c2a810aa42f4b8683b535f2fd7f9def..2616b3e6d12bb5017125ac394714aa0aa7d251d6 100644 --- a/typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php +++ b/typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php @@ -1550,7 +1550,7 @@ TCAdefaults.sys_note.email = ' . $this->user['email']; ) ->setMaxResults(1) ->execute() - ->fetch(\PDO::FETCH_ASSOC); + ->fetchAssociative(); $readOnlyMountPointArray = GeneralUtility::trimExplode(',', $readOnlyMountPoints); foreach ($readOnlyMountPointArray as $readOnlyMountPoint) { @@ -1977,7 +1977,7 @@ TCAdefaults.sys_note.email = ' . $this->user['email']; ->orderBy('title') ->setMaxResults(1) ->execute() - ->fetch(\PDO::FETCH_ASSOC); + ->fetchAssociative(); } } } diff --git a/typo3/sysext/core/Classes/Database/Query/Expression/ExpressionBuilder.php b/typo3/sysext/core/Classes/Database/Query/Expression/ExpressionBuilder.php index 6d384c682146697a9cfc647a4a882c77aaca1bb9..545b66d3fb954c5d0870cb0f3f9c7c62220f1a4b 100644 --- a/typo3/sysext/core/Classes/Database/Query/Expression/ExpressionBuilder.php +++ b/typo3/sysext/core/Classes/Database/Query/Expression/ExpressionBuilder.php @@ -17,7 +17,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\Database\Query\Expression; -use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Platforms\TrimMode; use TYPO3\CMS\Core\Database\Connection; /** @@ -511,7 +511,7 @@ class ExpressionBuilder * @param string $char Character to be trimmed (defaults to space) * @return string */ - public function trim(string $fieldName, int $position = AbstractPlatform::TRIM_UNSPECIFIED, string $char = null) + public function trim(string $fieldName, int $position = TrimMode::UNSPECIFIED, string $char = null) { return $this->connection->getDatabasePlatform()->getTrimExpression( $this->connection->quoteIdentifier($fieldName), diff --git a/typo3/sysext/core/Classes/Database/Schema/EventListener/SchemaColumnDefinitionListener.php b/typo3/sysext/core/Classes/Database/Schema/EventListener/SchemaColumnDefinitionListener.php index c2fcfbcd3c6140bc418d4c54baba5e8df71663e6..f493b96d8fcc26b436a174ea68ac9eaf99e9a4db 100644 --- a/typo3/sysext/core/Classes/Database/Schema/EventListener/SchemaColumnDefinitionListener.php +++ b/typo3/sysext/core/Classes/Database/Schema/EventListener/SchemaColumnDefinitionListener.php @@ -47,7 +47,7 @@ class SchemaColumnDefinitionListener $column = $this->getEnumerationTableColumnDefinition( $tableColumn, - $event->getDatabasePlatform() + $event->getConnection()->getDatabasePlatform() ); $event->setColumn($column); diff --git a/typo3/sysext/core/Classes/Utility/RootlineUtility.php b/typo3/sysext/core/Classes/Utility/RootlineUtility.php index 5d192414abe6be6892f2099ddd5dce11b120b5a4..ed95b81a9851a125b9164e960a3812d3dd9d6a22 100644 --- a/typo3/sysext/core/Classes/Utility/RootlineUtility.php +++ b/typo3/sysext/core/Classes/Utility/RootlineUtility.php @@ -16,7 +16,6 @@ namespace TYPO3\CMS\Core\Utility; use Doctrine\DBAL\Exception as DBALException; -use Doctrine\DBAL\FetchMode; use TYPO3\CMS\Core\Cache\CacheManager; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Database\Connection; @@ -529,7 +528,7 @@ class RootlineUtility ->setMaxResults(1) ->execute(); - $record = $statement->fetch(FetchMode::ASSOCIATIVE); + $record = $statement->fetchAssociative(); return $record ?: null; } diff --git a/typo3/sysext/core/Tests/Unit/Database/Query/Expression/ExpressionBuilderTest.php b/typo3/sysext/core/Tests/Unit/Database/Query/Expression/ExpressionBuilderTest.php index 234f22525994b71e0e929e9fde1b881f3ae229d3..2d7b9e594aa1ad1246d42a1293e43c6c63dfedaa 100644 --- a/typo3/sysext/core/Tests/Unit/Database/Query/Expression/ExpressionBuilderTest.php +++ b/typo3/sysext/core/Tests/Unit/Database/Query/Expression/ExpressionBuilderTest.php @@ -17,7 +17,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\Tests\Unit\Database\Query\Expression; -use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Platforms\TrimMode; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; use TYPO3\CMS\Core\Database\Connection; @@ -585,22 +585,22 @@ class ExpressionBuilderTest extends UnitTestCase { return [ 'trim leading character' => [ - AbstractPlatform::TRIM_LEADING, + TrimMode::LEADING, 'x', 'TRIM(LEADING "x" FROM "tableName"."fieldName")' ], 'trim trailing character' => [ - AbstractPlatform::TRIM_TRAILING, + TrimMode::TRAILING, 'x', 'TRIM(TRAILING "x" FROM "tableName"."fieldName")', ], 'trim character' => [ - AbstractPlatform::TRIM_BOTH, + TrimMode::BOTH, 'x', 'TRIM(BOTH "x" FROM "tableName"."fieldName")', ], 'trim space' => [ - AbstractPlatform::TRIM_BOTH, + TrimMode::BOTH, ' ', 'TRIM(BOTH " " FROM "tableName"."fieldName")', ] diff --git a/typo3/sysext/felogin/Classes/Domain/Repository/FrontendUserRepository.php b/typo3/sysext/felogin/Classes/Domain/Repository/FrontendUserRepository.php index 848806f46c2b918970595ed3495317438f0e42aa..eed606621f5519a05494d45b251765570c876453 100644 --- a/typo3/sysext/felogin/Classes/Domain/Repository/FrontendUserRepository.php +++ b/typo3/sysext/felogin/Classes/Domain/Repository/FrontendUserRepository.php @@ -17,7 +17,6 @@ declare(strict_types=1); namespace TYPO3\CMS\FrontendLogin\Domain\Repository; -use Doctrine\DBAL\FetchMode; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; @@ -149,7 +148,7 @@ class FrontendUserRepository ) ) ; - $result = $query->execute()->fetch(FetchMode::ASSOCIATIVE); + $result = $query->execute()->fetchAssociative(); if (!is_array($result)) { $result = []; } diff --git a/typo3/sysext/install/Classes/SystemEnvironment/DatabaseCheck/Platform/MySql.php b/typo3/sysext/install/Classes/SystemEnvironment/DatabaseCheck/Platform/MySql.php index 32fd6e8c7f9fb4cf2f7a54d5e7e3a23e96972053..d0c9fce21101e05a88e333323ac66d17fe96dd3b 100644 --- a/typo3/sysext/install/Classes/SystemEnvironment/DatabaseCheck/Platform/MySql.php +++ b/typo3/sysext/install/Classes/SystemEnvironment/DatabaseCheck/Platform/MySql.php @@ -188,8 +188,7 @@ class MySql extends AbstractPlatform */ protected function getIncompatibleSqlModes(Connection $connection): array { - $sqlModes = explode(',', $connection->executeQuery('SELECT @@SESSION.sql_mode;') - ->fetch(0)['@@SESSION.sql_mode']); + $sqlModes = explode(',', (string)$connection->executeQuery('SELECT @@SESSION.sql_mode;')->fetchOne()); return array_intersect($this->incompatibleSqlModes, $sqlModes); } diff --git a/typo3/sysext/install/Classes/SystemEnvironment/DatabaseCheck/Platform/SqlSrv.php b/typo3/sysext/install/Classes/SystemEnvironment/DatabaseCheck/Platform/SqlSrv.php index e4416245ff4b6963b3d1a3c6fa9e1c25a4964682..6a23c809d7aef8bac8b4568992ba0117a7f1eb1f 100644 --- a/typo3/sysext/install/Classes/SystemEnvironment/DatabaseCheck/Platform/SqlSrv.php +++ b/typo3/sysext/install/Classes/SystemEnvironment/DatabaseCheck/Platform/SqlSrv.php @@ -95,7 +95,7 @@ class SqlSrv extends AbstractPlatform [$connection->getDatabase()], [\PDO::PARAM_STR] ) - ->fetch(\PDO::FETCH_NUM); + ->fetchNumeric(); foreach ($this->databaseCharsetToCheck as $databaseCharsetToCheck) { if (!stripos($defaultDatabaseCharset[0], $databaseCharsetToCheck)) { @@ -125,7 +125,7 @@ class SqlSrv extends AbstractPlatform public function checkDefaultDatabaseServerCharset(Connection $connection): void { $defaultServerCharset = $connection->executeQuery('SELECT SERVERPROPERTY(\'Collation\')') - ->fetch(\PDO::FETCH_NUM); + ->fetchNumeric(); foreach ($this->databaseServerCharsetToCheck as $databaseServerCharsetToCheck) { // is charset part of collation diff --git a/typo3/sysext/workspaces/Classes/Authentication/PreviewUserAuthentication.php b/typo3/sysext/workspaces/Classes/Authentication/PreviewUserAuthentication.php index e1c1ef7743dd3f66b905e24bf533cd7170832f9c..e968a7a0de16876510bab3a2f6a55793ed4ad596 100644 --- a/typo3/sysext/workspaces/Classes/Authentication/PreviewUserAuthentication.php +++ b/typo3/sysext/workspaces/Classes/Authentication/PreviewUserAuthentication.php @@ -77,7 +77,7 @@ class PreviewUserAuthentication extends BackendUserAuthentication ->orderBy('title') ->setMaxResults(1) ->execute() - ->fetch(\PDO::FETCH_ASSOC); + ->fetchAssociative(); } } // If the workspace exists in the database, the preview user is automatically a member to that workspace