From 9e56a0d14f334fed46f80da395970640764357f7 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Fri, 26 Aug 2022 00:40:03 +0200 Subject: [PATCH] slevomat/coding-standard 8.4 --- composer.json | 2 +- src/ArrayParameters/Exception.php | 4 +- .../Exception/MissingNamedParameter.php | 4 +- src/Cache/ArrayResult.php | 12 +- src/Cache/CacheException.php | 12 +- src/Cache/QueryCacheProfile.php | 4 +- src/Configuration.php | 4 +- src/Connection.php | 8 +- src/ConnectionException.php | 20 +-- src/Driver/API/MySQL/ExceptionConverter.php | 4 +- src/Driver/API/OCI/ExceptionConverter.php | 8 +- .../API/PostgreSQL/ExceptionConverter.php | 8 +- src/Driver/API/SQLite/ExceptionConverter.php | 8 +- .../EasyConnectString.php | 8 +- src/Driver/Exception.php | 4 +- src/Driver/Exception/UnknownParameterType.php | 4 +- src/Driver/FetchUtils.php | 4 +- src/Driver/IBMDB2/Connection.php | 4 +- .../Exception/CannotCopyStreamToStream.php | 4 +- .../Exception/CannotCreateTemporaryFile.php | 4 +- .../IBMDB2/Exception/ConnectionError.php | 4 +- src/Driver/IBMDB2/Exception/PrepareFailed.php | 4 +- .../IBMDB2/Exception/StatementError.php | 4 +- .../AbstractConnectionMiddleware.php | 4 +- src/Driver/Mysqli/Connection.php | 4 +- src/Driver/Mysqli/Exception/InvalidOption.php | 4 +- src/Driver/Mysqli/Initializer.php | 4 +- src/Driver/Mysqli/Initializer/Options.php | 4 +- src/Driver/Mysqli/Statement.php | 4 +- src/Driver/OCI8/Connection.php | 8 +- .../ConvertPositionalToNamedPlaceholders.php | 4 +- src/Driver/OCI8/Exception/Error.php | 4 +- src/Driver/OCI8/Result.php | 4 +- src/Driver/PDO/Connection.php | 8 +- src/Driver/PDO/Result.php | 4 +- src/Driver/PDO/SQLSrv/Connection.php | 4 +- src/Driver/PDO/SQLSrv/Statement.php | 4 +- src/Driver/PDO/Statement.php | 4 +- src/Driver/SQLSrv/Connection.php | 4 +- src/Driver/SQLSrv/Result.php | 4 +- src/Event/ConnectionEventArgs.php | 4 +- src/Event/Listeners/OracleSessionInit.php | 4 +- src/Event/Listeners/SQLSessionInit.php | 4 +- .../SchemaAlterTableAddColumnEventArgs.php | 16 +-- .../SchemaAlterTableChangeColumnEventArgs.php | 16 +-- src/Event/SchemaAlterTableEventArgs.php | 12 +- .../SchemaAlterTableRemoveColumnEventArgs.php | 16 +-- .../SchemaAlterTableRenameColumnEventArgs.php | 24 +--- src/Event/SchemaColumnDefinitionEventArgs.php | 20 +-- .../SchemaCreateTableColumnEventArgs.php | 16 +-- src/Event/SchemaCreateTableEventArgs.php | 20 +-- src/Event/SchemaDropTableEventArgs.php | 12 +- src/Event/SchemaEventArgs.php | 8 +- src/Event/SchemaIndexDefinitionEventArgs.php | 16 +-- src/Exception.php | 16 +-- src/Exception/ConnectionLost.php | 4 +- src/Exception/DatabaseDoesNotExist.php | 4 +- src/Exception/DatabaseRequired.php | 4 +- src/Exception/InvalidArgumentException.php | 4 +- src/Exception/InvalidLockMode.php | 4 +- src/Exception/SchemaDoesNotExist.php | 4 +- src/ExpandArrayParameters.php | 8 +- src/Id/TableGeneratorSchemaVisitor.php | 8 +- src/Logging/Connection.php | 4 +- src/Logging/Driver.php | 4 +- src/Logging/LoggerChain.php | 4 +- src/Logging/Statement.php | 4 +- src/Platforms/AbstractMySQLPlatform.php | 4 +- src/Platforms/AbstractPlatform.php | 16 +-- src/Platforms/DB2Platform.php | 4 +- src/Platforms/DateIntervalUnit.php | 4 +- src/Platforms/Keywords/KeywordList.php | 4 +- src/Platforms/Keywords/MariaDBKeywords.php | 4 +- src/Platforms/Keywords/MariaDb102Keywords.php | 4 +- .../Keywords/PostgreSQL100Keywords.php | 4 +- .../Keywords/ReservedKeywordsValidator.php | 12 +- src/Platforms/MariaDBPlatform.php | 4 +- .../MySQL/CollationMetadataProvider.php | 4 +- .../CachingCollationMetadataProvider.php | 4 +- .../ConnectionCollationMetadataProvider.php | 8 +- src/Platforms/MySQL/Comparator.php | 4 +- src/Platforms/OraclePlatform.php | 4 +- src/Platforms/PostgreSQL100Platform.php | 4 +- src/Platforms/PostgreSQLPlatform.php | 12 +- src/Platforms/SQLServer/Comparator.php | 4 +- src/Platforms/SQLServerPlatform.php | 8 +- src/Platforms/SQLite/Comparator.php | 4 +- src/Platforms/SqlitePlatform.php | 16 +-- src/Platforms/TrimMode.php | 4 +- src/Portability/Result.php | 4 +- src/Query.php | 8 +- src/Query/QueryBuilder.php | 28 ++--- src/Query/QueryException.php | 4 +- src/Result.php | 16 +-- src/Schema/AbstractSchemaManager.php | 16 +-- src/Schema/Column.php | 56 +++------ src/Schema/ColumnDiff.php | 4 +- src/Schema/Comparator.php | 20 +-- src/Schema/Constraint.php | 8 +- src/Schema/Exception/InvalidTableName.php | 4 +- src/Schema/Exception/UnknownColumnOption.php | 4 +- src/Schema/Index.php | 20 +-- src/Schema/MySQLSchemaManager.php | 8 +- src/Schema/SQLServerSchemaManager.php | 8 +- src/Schema/Schema.php | 8 +- src/Schema/SchemaConfig.php | 4 +- src/Schema/SchemaDiff.php | 4 +- src/Schema/SchemaException.php | 8 +- src/Schema/Sequence.php | 12 +- src/Schema/SqliteSchemaManager.php | 4 +- src/Schema/Table.php | 24 +--- src/Schema/TableDiff.php | 4 +- src/Schema/UniqueConstraint.php | 12 +- src/Schema/View.php | 4 +- .../Visitor/CreateSchemaSqlCollector.php | 8 +- src/Schema/Visitor/DropSchemaSqlCollector.php | 8 +- src/Schema/Visitor/Visitor.php | 16 +-- .../Console/Command/ReservedWordsCommand.php | 4 +- src/Tools/Console/Command/RunSqlCommand.php | 8 +- src/Tools/Console/ConnectionProvider.php | 4 +- src/Tools/Console/ConsoleRunner.php | 4 +- src/TransactionIsolationLevel.php | 4 +- src/Types/Type.php | 4 +- src/Types/TypeRegistry.php | 4 +- src/Types/Types.php | 12 +- tests/Connection/CachedQueryTest.php | 8 +- .../Connection/ExpandArrayParametersTest.php | 12 +- tests/ConnectionTest.php | 28 ++--- tests/Driver/AbstractDB2DriverTest.php | 4 +- tests/Driver/AbstractDriverTest.php | 12 +- tests/Driver/AbstractMySQLDriverTest.php | 4 +- .../EasyConnectStringTest.php | 4 +- tests/Driver/AbstractOracleDriverTest.php | 4 +- tests/Driver/AbstractPostgreSQLDriverTest.php | 4 +- tests/Driver/AbstractSQLServerDriverTest.php | 4 +- tests/Driver/AbstractSQLiteDriverTest.php | 4 +- tests/Driver/IBMDB2/DataSourceNameTest.php | 4 +- .../AbstractConnectionMiddlewareTest.php | 4 +- tests/Driver/Mysqli/ConnectionTest.php | 4 +- ...nvertPositionalToNamedPlaceholdersTest.php | 4 +- tests/Driver/PDO/ExceptionTest.php | 4 +- tests/Driver/PDO/PgSQL/DriverTest.php | 4 +- tests/DriverManagerTest.php | 20 +-- tests/Events/OracleSessionInitTest.php | 8 +- tests/Functional/BlobTest.php | 4 +- tests/Functional/DataAccessTest.php | 4 +- tests/Functional/Driver/IBMDB2/DriverTest.php | 4 +- .../Driver/IBMDB2/StatementTest.php | 4 +- .../Driver/Mysqli/ConnectionTest.php | 8 +- tests/Functional/Driver/Mysqli/DriverTest.php | 4 +- .../Functional/Driver/OCI8/ConnectionTest.php | 4 +- tests/Functional/Driver/OCI8/DriverTest.php | 4 +- tests/Functional/Driver/OCI8/ResultTest.php | 4 +- .../Functional/Driver/OCI8/StatementTest.php | 8 +- .../Driver/PDO/MySQL/DriverTest.php | 4 +- .../Functional/Driver/PDO/OCI/DriverTest.php | 4 +- .../Driver/PDO/PgSQL/ConnectionTest.php | 12 +- .../Driver/PDO/PgSQL/DriverTest.php | 12 +- .../Driver/PDO/SQLSrv/DriverTest.php | 8 +- .../Driver/PDO/SQLite/DriverTest.php | 4 +- tests/Functional/Driver/SQLSrv/DriverTest.php | 4 +- .../Driver/SQLSrv/StatementTest.php | 4 +- tests/Functional/ExceptionTest.php | 8 +- tests/Functional/FetchBooleanTest.php | 8 +- tests/Functional/ModifyLimitQueryTest.php | 4 +- tests/Functional/NamedParametersTest.php | 4 +- .../Platform/ConcatExpressionTest.php | 4 +- .../Platform/DateExpressionTest.php | 8 +- .../Platform/LengthExpressionTest.php | 4 +- tests/Functional/Platform/QuotingTest.php | 20 +-- .../Functional/Platform/RenameColumnTest.php | 8 +- tests/Functional/PortabilityTest.php | 16 +-- .../PrimaryReadReplicaConnectionTest.php | 4 +- tests/Functional/ResultTest.php | 8 +- tests/Functional/Schema/ComparatorTest.php | 4 +- .../Functional/Schema/ComparatorTestUtils.php | 4 +- .../Schema/MySQL/ComparatorTest.php | 20 +-- .../Schema/PostgreSQLSchemaManagerTest.php | 16 +-- .../SchemaManagerFunctionalTestCase.php | 48 ++------ tests/Functional/StatementTest.php | 16 +-- tests/Functional/TypeConversionTest.php | 32 ++--- tests/Functional/Types/BinaryTest.php | 4 +- tests/Functional/Types/DecimalTest.php | 8 +- tests/FunctionalTestCase.php | 8 +- tests/Logging/LoggerChainTest.php | 8 +- .../AbstractMySQLPlatformTestCase.php | 76 +++--------- tests/Platforms/AbstractPlatformTestCase.php | 116 +++++------------- tests/Platforms/DB2PlatformTest.php | 12 +- .../CachingCollationMetadataProviderTest.php | 8 +- tests/Platforms/MySQL57PlatformTest.php | 16 +-- tests/Platforms/OraclePlatformTest.php | 48 ++------ tests/Platforms/PostgreSQLPlatformTest.php | 28 ++--- tests/Platforms/SQLServerPlatformTestCase.php | 20 +-- tests/Platforms/SqlitePlatformTest.php | 12 +- tests/Portability/ConnectionTest.php | 4 +- tests/Portability/ConverterTest.php | 24 +--- tests/Portability/ResultTest.php | 4 +- tests/Portability/StatementTest.php | 4 +- .../Expression/CompositeExpressionTest.php | 4 +- .../Expression/ExpressionBuilderTest.php | 16 +-- tests/Query/QueryBuilderTest.php | 8 +- tests/SQL/ParserTest.php | 44 ++----- tests/Schema/ColumnTest.php | 8 +- tests/Schema/ComparatorTest.php | 12 +- tests/Schema/ForeignKeyConstraintTest.php | 8 +- tests/Schema/IndexTest.php | 8 +- tests/Schema/MySQLInheritCharsetTest.php | 4 +- tests/Schema/Platforms/MySQLSchemaTest.php | 12 +- tests/Schema/SqliteSchemaManagerTest.php | 16 +-- tests/Schema/TableTest.php | 8 +- .../Visitor/CreateSchemaSqlCollectorTest.php | 12 +- .../Visitor/DropSchemaSqlCollectorTest.php | 4 +- tests/TestUtil.php | 20 +-- tests/Types/BaseDateTypeTestCase.php | 4 +- tests/Types/BinaryTest.php | 4 +- tests/Types/ConversionExceptionTest.php | 8 +- tests/Types/DateIntervalTest.php | 4 +- tests/Types/JsonTest.php | 4 +- tests/Types/TypeTest.php | 8 +- 219 files changed, 519 insertions(+), 1555 deletions(-) diff --git a/composer.json b/composer.json index 2f645866fe9..8eb7440240f 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "psr/log": "^1|^2|^3" }, "require-dev": { - "doctrine/coding-standard": "9.0.0", + "doctrine/coding-standard": "9.0.1", "jetbrains/phpstorm-stubs": "2022.2", "phpstan/phpstan": "1.8.2", "phpstan/phpstan-strict-rules": "^1.3", diff --git a/src/ArrayParameters/Exception.php b/src/ArrayParameters/Exception.php index cce84b25bf0..7fc0f70603e 100644 --- a/src/ArrayParameters/Exception.php +++ b/src/ArrayParameters/Exception.php @@ -4,9 +4,7 @@ use Throwable; -/** - * @internal - */ +/** @internal */ interface Exception extends Throwable { } diff --git a/src/ArrayParameters/Exception/MissingNamedParameter.php b/src/ArrayParameters/Exception/MissingNamedParameter.php index 73803e2bd87..3f69681f5f0 100644 --- a/src/ArrayParameters/Exception/MissingNamedParameter.php +++ b/src/ArrayParameters/Exception/MissingNamedParameter.php @@ -7,9 +7,7 @@ use function sprintf; -/** - * @psalm-immutable - */ +/** @psalm-immutable */ class MissingNamedParameter extends LogicException implements Exception { public static function new(string $name): self diff --git a/src/Cache/ArrayResult.php b/src/Cache/ArrayResult.php index 996900776e1..93b93d176fa 100644 --- a/src/Cache/ArrayResult.php +++ b/src/Cache/ArrayResult.php @@ -9,9 +9,7 @@ use function count; use function reset; -/** - * @internal The class is internal to the caching layer implementation. - */ +/** @internal The class is internal to the caching layer implementation. */ final class ArrayResult implements Result { /** @var list> */ @@ -20,9 +18,7 @@ final class ArrayResult implements Result private int $columnCount = 0; private int $num = 0; - /** - * @param list> $data - */ + /** @param list> $data */ public function __construct(array $data) { $this->data = $data; @@ -108,9 +104,7 @@ public function free(): void $this->data = []; } - /** - * @return array|false - */ + /** @return array|false */ private function fetch() { if (! isset($this->data[$this->num])) { diff --git a/src/Cache/CacheException.php b/src/Cache/CacheException.php index 3db115bdfae..18e95d6bed8 100644 --- a/src/Cache/CacheException.php +++ b/src/Cache/CacheException.php @@ -4,22 +4,16 @@ use Doctrine\DBAL\Exception; -/** - * @psalm-immutable - */ +/** @psalm-immutable */ class CacheException extends Exception { - /** - * @return CacheException - */ + /** @return CacheException */ public static function noCacheKey() { return new self('No cache key was set.'); } - /** - * @return CacheException - */ + /** @return CacheException */ public static function noResultDriverConfigured() { return new self('Trying to cache a query but no result driver is configured.'); diff --git a/src/Cache/QueryCacheProfile.php b/src/Cache/QueryCacheProfile.php index 61652eaa12c..a0f1a26e5f4 100644 --- a/src/Cache/QueryCacheProfile.php +++ b/src/Cache/QueryCacheProfile.php @@ -85,9 +85,7 @@ public function getResultCacheDriver() return $this->resultCache !== null ? DoctrineProvider::wrap($this->resultCache) : null; } - /** - * @return int - */ + /** @return int */ public function getLifetime() { return $this->lifetime; diff --git a/src/Configuration.php b/src/Configuration.php index 1c25959f642..c18eddb3922 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -220,9 +220,7 @@ public function setMiddlewares(array $middlewares): self return $this; } - /** - * @return Middleware[] - */ + /** @return Middleware[] */ public function getMiddlewares(): array { return $this->middlewares; diff --git a/src/Connection.php b/src/Connection.php index f587b6207cd..8778d176306 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -1533,9 +1533,7 @@ public function getWrappedConnection() return $this->_conn; } - /** - * @return resource|object - */ + /** @return resource|object */ public function getNativeConnection() { $this->connect(); @@ -1763,9 +1761,7 @@ final public function convertExceptionDuringQuery( return $this->handleDriverException($e, new Query($sql, $params, $types)); } - /** - * @internal - */ + /** @internal */ final public function convertException(Driver\Exception $e): DriverException { return $this->handleDriverException($e, null); diff --git a/src/ConnectionException.php b/src/ConnectionException.php index 8426ca28891..f1e18987b61 100644 --- a/src/ConnectionException.php +++ b/src/ConnectionException.php @@ -2,38 +2,28 @@ namespace Doctrine\DBAL; -/** - * @psalm-immutable - */ +/** @psalm-immutable */ class ConnectionException extends Exception { - /** - * @return ConnectionException - */ + /** @return ConnectionException */ public static function commitFailedRollbackOnly() { return new self('Transaction commit failed because the transaction has been marked for rollback only.'); } - /** - * @return ConnectionException - */ + /** @return ConnectionException */ public static function noActiveTransaction() { return new self('There is no active transaction.'); } - /** - * @return ConnectionException - */ + /** @return ConnectionException */ public static function savepointsNotSupported() { return new self('Savepoints are not supported by this driver.'); } - /** - * @return ConnectionException - */ + /** @return ConnectionException */ public static function mayNotAlterNestedTransactionWithSavepointsInTransaction() { return new self('May not alter the nested transaction with savepoints behavior while a transaction is open.'); diff --git a/src/Driver/API/MySQL/ExceptionConverter.php b/src/Driver/API/MySQL/ExceptionConverter.php index c851949be38..87d50aff9e3 100644 --- a/src/Driver/API/MySQL/ExceptionConverter.php +++ b/src/Driver/API/MySQL/ExceptionConverter.php @@ -22,9 +22,7 @@ use Doctrine\DBAL\Exception\UniqueConstraintViolationException; use Doctrine\DBAL\Query; -/** - * @internal - */ +/** @internal */ final class ExceptionConverter implements ExceptionConverterInterface { /** diff --git a/src/Driver/API/OCI/ExceptionConverter.php b/src/Driver/API/OCI/ExceptionConverter.php index 727a605d771..4703a57d513 100644 --- a/src/Driver/API/OCI/ExceptionConverter.php +++ b/src/Driver/API/OCI/ExceptionConverter.php @@ -20,14 +20,10 @@ use Doctrine\DBAL\Exception\UniqueConstraintViolationException; use Doctrine\DBAL\Query; -/** - * @internal - */ +/** @internal */ final class ExceptionConverter implements ExceptionConverterInterface { - /** - * @link http://www.dba-oracle.com/t_error_code_list.htm - */ + /** @link http://www.dba-oracle.com/t_error_code_list.htm */ public function convert(Exception $exception, ?Query $query): DriverException { switch ($exception->getCode()) { diff --git a/src/Driver/API/PostgreSQL/ExceptionConverter.php b/src/Driver/API/PostgreSQL/ExceptionConverter.php index ffd2c1deb6a..2baca1ee232 100644 --- a/src/Driver/API/PostgreSQL/ExceptionConverter.php +++ b/src/Driver/API/PostgreSQL/ExceptionConverter.php @@ -23,14 +23,10 @@ use function strpos; -/** - * @internal - */ +/** @internal */ final class ExceptionConverter implements ExceptionConverterInterface { - /** - * @link http://www.postgresql.org/docs/9.4/static/errcodes-appendix.html - */ + /** @link http://www.postgresql.org/docs/9.4/static/errcodes-appendix.html */ public function convert(Exception $exception, ?Query $query): DriverException { switch ($exception->getSQLState()) { diff --git a/src/Driver/API/SQLite/ExceptionConverter.php b/src/Driver/API/SQLite/ExceptionConverter.php index e19b3ab8cef..9e67155ad5c 100644 --- a/src/Driver/API/SQLite/ExceptionConverter.php +++ b/src/Driver/API/SQLite/ExceptionConverter.php @@ -22,14 +22,10 @@ use function strpos; -/** - * @internal - */ +/** @internal */ final class ExceptionConverter implements ExceptionConverterInterface { - /** - * @link http://www.sqlite.org/c3ref/c_abort.html - */ + /** @link http://www.sqlite.org/c3ref/c_abort.html */ public function convert(Exception $exception, ?Query $query): DriverException { if (strpos($exception->getMessage(), 'database is locked') !== false) { diff --git a/src/Driver/AbstractOracleDriver/EasyConnectString.php b/src/Driver/AbstractOracleDriver/EasyConnectString.php index 1ea6226bbff..91bc6a7e1b0 100644 --- a/src/Driver/AbstractOracleDriver/EasyConnectString.php +++ b/src/Driver/AbstractOracleDriver/EasyConnectString.php @@ -86,9 +86,7 @@ public static function fromConnectionParameters(array $params): self ]); } - /** - * @param mixed[] $params - */ + /** @param mixed[] $params */ private static function renderParams(array $params): string { $chunks = []; @@ -106,9 +104,7 @@ private static function renderParams(array $params): string return implode('', $chunks); } - /** - * @param mixed $value - */ + /** @param mixed $value */ private static function renderValue($value): string { if (is_array($value)) { diff --git a/src/Driver/Exception.php b/src/Driver/Exception.php index 0b108963a0f..f963563b83c 100644 --- a/src/Driver/Exception.php +++ b/src/Driver/Exception.php @@ -6,9 +6,7 @@ use Throwable; -/** - * @psalm-immutable - */ +/** @psalm-immutable */ interface Exception extends Throwable { /** diff --git a/src/Driver/Exception/UnknownParameterType.php b/src/Driver/Exception/UnknownParameterType.php index c989184d6b6..01a9b3d0c54 100644 --- a/src/Driver/Exception/UnknownParameterType.php +++ b/src/Driver/Exception/UnknownParameterType.php @@ -15,9 +15,7 @@ */ final class UnknownParameterType extends AbstractException { - /** - * @param mixed $type - */ + /** @param mixed $type */ public static function new($type): self { return new self(sprintf('Unknown parameter type, %d given.', $type)); diff --git a/src/Driver/FetchUtils.php b/src/Driver/FetchUtils.php index 240cef4a001..50e02b1a29c 100644 --- a/src/Driver/FetchUtils.php +++ b/src/Driver/FetchUtils.php @@ -4,9 +4,7 @@ namespace Doctrine\DBAL\Driver; -/** - * @internal - */ +/** @internal */ final class FetchUtils { /** diff --git a/src/Driver/IBMDB2/Connection.php b/src/Driver/IBMDB2/Connection.php index aca2a02ce92..198b697af14 100644 --- a/src/Driver/IBMDB2/Connection.php +++ b/src/Driver/IBMDB2/Connection.php @@ -143,9 +143,7 @@ public function rollBack(): bool return $result; } - /** - * @return resource - */ + /** @return resource */ public function getNativeConnection() { return $this->connection; diff --git a/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php b/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php index 86821688c41..231c9d47316 100644 --- a/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php +++ b/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php @@ -13,9 +13,7 @@ */ final class CannotCopyStreamToStream extends AbstractException { - /** - * @psalm-param array{message: string}|null $error - */ + /** @psalm-param array{message: string}|null $error */ public static function new(?array $error): self { $message = 'Could not copy source stream to temporary file'; diff --git a/src/Driver/IBMDB2/Exception/CannotCreateTemporaryFile.php b/src/Driver/IBMDB2/Exception/CannotCreateTemporaryFile.php index 587ae65f42a..63f7ca1e26f 100644 --- a/src/Driver/IBMDB2/Exception/CannotCreateTemporaryFile.php +++ b/src/Driver/IBMDB2/Exception/CannotCreateTemporaryFile.php @@ -13,9 +13,7 @@ */ final class CannotCreateTemporaryFile extends AbstractException { - /** - * @psalm-param array{message: string}|null $error - */ + /** @psalm-param array{message: string}|null $error */ public static function new(?array $error): self { $message = 'Could not create temporary file'; diff --git a/src/Driver/IBMDB2/Exception/ConnectionError.php b/src/Driver/IBMDB2/Exception/ConnectionError.php index a27a99a1858..b7bd8be6932 100644 --- a/src/Driver/IBMDB2/Exception/ConnectionError.php +++ b/src/Driver/IBMDB2/Exception/ConnectionError.php @@ -16,9 +16,7 @@ */ final class ConnectionError extends AbstractException { - /** - * @param resource $connection - */ + /** @param resource $connection */ public static function new($connection): self { $message = db2_conn_errormsg($connection); diff --git a/src/Driver/IBMDB2/Exception/PrepareFailed.php b/src/Driver/IBMDB2/Exception/PrepareFailed.php index 035fd67f9c2..42df5e15c85 100644 --- a/src/Driver/IBMDB2/Exception/PrepareFailed.php +++ b/src/Driver/IBMDB2/Exception/PrepareFailed.php @@ -13,9 +13,7 @@ */ final class PrepareFailed extends AbstractException { - /** - * @psalm-param array{message: string}|null $error - */ + /** @psalm-param array{message: string}|null $error */ public static function new(?array $error): self { if ($error === null) { diff --git a/src/Driver/IBMDB2/Exception/StatementError.php b/src/Driver/IBMDB2/Exception/StatementError.php index 5c30d1cab72..6bf8511317d 100644 --- a/src/Driver/IBMDB2/Exception/StatementError.php +++ b/src/Driver/IBMDB2/Exception/StatementError.php @@ -16,9 +16,7 @@ */ final class StatementError extends AbstractException { - /** - * @param resource|null $statement - */ + /** @param resource|null $statement */ public static function new($statement = null): self { if ($statement !== null) { diff --git a/src/Driver/Middleware/AbstractConnectionMiddleware.php b/src/Driver/Middleware/AbstractConnectionMiddleware.php index e88c194ea40..7f1cc2cee08 100644 --- a/src/Driver/Middleware/AbstractConnectionMiddleware.php +++ b/src/Driver/Middleware/AbstractConnectionMiddleware.php @@ -98,9 +98,7 @@ public function getServerVersion() return $this->wrappedConnection->getServerVersion(); } - /** - * @return resource|object - */ + /** @return resource|object */ public function getNativeConnection() { if (! method_exists($this->wrappedConnection, 'getNativeConnection')) { diff --git a/src/Driver/Mysqli/Connection.php b/src/Driver/Mysqli/Connection.php index db9fd5244ee..7c951b491f5 100644 --- a/src/Driver/Mysqli/Connection.php +++ b/src/Driver/Mysqli/Connection.php @@ -20,9 +20,7 @@ final class Connection implements ServerInfoAwareConnection private mysqli $connection; - /** - * @internal The connection can be only instantiated by its driver. - */ + /** @internal The connection can be only instantiated by its driver. */ public function __construct(mysqli $connection) { $this->connection = $connection; diff --git a/src/Driver/Mysqli/Exception/InvalidOption.php b/src/Driver/Mysqli/Exception/InvalidOption.php index 962175679c2..c5d90385e1a 100644 --- a/src/Driver/Mysqli/Exception/InvalidOption.php +++ b/src/Driver/Mysqli/Exception/InvalidOption.php @@ -15,9 +15,7 @@ */ final class InvalidOption extends AbstractException { - /** - * @param mixed $value - */ + /** @param mixed $value */ public static function fromOption(int $option, $value): self { return new self( diff --git a/src/Driver/Mysqli/Initializer.php b/src/Driver/Mysqli/Initializer.php index 9966da46bcd..efab67e22d2 100644 --- a/src/Driver/Mysqli/Initializer.php +++ b/src/Driver/Mysqli/Initializer.php @@ -9,8 +9,6 @@ interface Initializer { - /** - * @throws Exception - */ + /** @throws Exception */ public function initialize(mysqli $connection): void; } diff --git a/src/Driver/Mysqli/Initializer/Options.php b/src/Driver/Mysqli/Initializer/Options.php index d2edf9381ed..2e66f8d6984 100644 --- a/src/Driver/Mysqli/Initializer/Options.php +++ b/src/Driver/Mysqli/Initializer/Options.php @@ -15,9 +15,7 @@ final class Options implements Initializer /** @var array */ private array $options; - /** - * @param array $options - */ + /** @param array $options */ public function __construct(array $options) { $this->options = $options; diff --git a/src/Driver/Mysqli/Statement.php b/src/Driver/Mysqli/Statement.php index 4714d80b929..d3f59b825b0 100644 --- a/src/Driver/Mysqli/Statement.php +++ b/src/Driver/Mysqli/Statement.php @@ -52,9 +52,7 @@ final class Statement implements StatementInterface */ private array $values = []; - /** - * @internal The statement can be only instantiated by its driver connection. - */ + /** @internal The statement can be only instantiated by its driver connection. */ public function __construct(mysqli_stmt $stmt) { $this->stmt = $stmt; diff --git a/src/Driver/OCI8/Connection.php b/src/Driver/OCI8/Connection.php index 26663fed5df..6870af21c68 100644 --- a/src/Driver/OCI8/Connection.php +++ b/src/Driver/OCI8/Connection.php @@ -58,9 +58,7 @@ public function getServerVersion(): string return $matches[1]; } - /** - * @throws Parser\Exception - */ + /** @throws Parser\Exception */ public function prepare(string $sql): DriverStatement { $visitor = new ConvertPositionalToNamedPlaceholders(); @@ -164,9 +162,7 @@ public function rollBack(): bool return true; } - /** - * @return resource - */ + /** @return resource */ public function getNativeConnection() { return $this->connection; diff --git a/src/Driver/OCI8/ConvertPositionalToNamedPlaceholders.php b/src/Driver/OCI8/ConvertPositionalToNamedPlaceholders.php index ebf2235503e..e2a1126297d 100644 --- a/src/Driver/OCI8/ConvertPositionalToNamedPlaceholders.php +++ b/src/Driver/OCI8/ConvertPositionalToNamedPlaceholders.php @@ -48,9 +48,7 @@ public function getSQL(): string return implode('', $this->buffer); } - /** - * @return array - */ + /** @return array */ public function getParameterMap(): array { return $this->parameterMap; diff --git a/src/Driver/OCI8/Exception/Error.php b/src/Driver/OCI8/Exception/Error.php index 7a27141fe5e..6abdf233c11 100644 --- a/src/Driver/OCI8/Exception/Error.php +++ b/src/Driver/OCI8/Exception/Error.php @@ -16,9 +16,7 @@ */ final class Error extends AbstractException { - /** - * @param resource $resource - */ + /** @param resource $resource */ public static function new($resource): self { $error = oci_error($resource); diff --git a/src/Driver/OCI8/Result.php b/src/Driver/OCI8/Result.php index 8f77da75905..a75b97f2a5c 100644 --- a/src/Driver/OCI8/Result.php +++ b/src/Driver/OCI8/Result.php @@ -129,9 +129,7 @@ private function fetch(int $mode) return $result; } - /** - * @return array - */ + /** @return array */ private function fetchAll(int $mode, int $fetchStructure): array { oci_fetch_all( diff --git a/src/Driver/PDO/Connection.php b/src/Driver/PDO/Connection.php index 857efa1eb9e..08b79a9e91d 100644 --- a/src/Driver/PDO/Connection.php +++ b/src/Driver/PDO/Connection.php @@ -17,9 +17,7 @@ final class Connection implements ServerInfoAwareConnection { private PDO $connection; - /** - * @internal The connection can be only instantiated by its driver. - */ + /** @internal The connection can be only instantiated by its driver. */ public function __construct(PDO $connection) { $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); @@ -127,9 +125,7 @@ public function getNativeConnection(): PDO return $this->connection; } - /** - * @deprecated Call {@see getNativeConnection()} instead. - */ + /** @deprecated Call {@see getNativeConnection()} instead. */ public function getWrappedConnection(): PDO { Deprecation::triggerIfCalledFromOutside( diff --git a/src/Driver/PDO/Result.php b/src/Driver/PDO/Result.php index a388b2a6c9f..88957d23ca8 100644 --- a/src/Driver/PDO/Result.php +++ b/src/Driver/PDO/Result.php @@ -13,9 +13,7 @@ final class Result implements ResultInterface { private PDOStatement $statement; - /** - * @internal The result can be only instantiated by its driver connection or statement. - */ + /** @internal The result can be only instantiated by its driver connection or statement. */ public function __construct(PDOStatement $statement) { $this->statement = $statement; diff --git a/src/Driver/PDO/SQLSrv/Connection.php b/src/Driver/PDO/SQLSrv/Connection.php index cc9b571e932..ef64ab2f673 100644 --- a/src/Driver/PDO/SQLSrv/Connection.php +++ b/src/Driver/PDO/SQLSrv/Connection.php @@ -55,9 +55,7 @@ public function getNativeConnection(): PDO return $this->connection->getNativeConnection(); } - /** - * @deprecated Call {@see getNativeConnection()} instead. - */ + /** @deprecated Call {@see getNativeConnection()} instead. */ public function getWrappedConnection(): PDO { Deprecation::trigger( diff --git a/src/Driver/PDO/SQLSrv/Statement.php b/src/Driver/PDO/SQLSrv/Statement.php index e4ab5e119fa..ff1ce409491 100644 --- a/src/Driver/PDO/SQLSrv/Statement.php +++ b/src/Driver/PDO/SQLSrv/Statement.php @@ -14,9 +14,7 @@ final class Statement extends AbstractStatementMiddleware { private PDOStatement $statement; - /** - * @internal The statement can be only instantiated by its driver connection. - */ + /** @internal The statement can be only instantiated by its driver connection. */ public function __construct(PDOStatement $statement) { parent::__construct($statement); diff --git a/src/Driver/PDO/Statement.php b/src/Driver/PDO/Statement.php index cdc1cf6a519..f37fa87a62d 100644 --- a/src/Driver/PDO/Statement.php +++ b/src/Driver/PDO/Statement.php @@ -30,9 +30,7 @@ final class Statement implements StatementInterface private PDOStatement $stmt; - /** - * @internal The statement can be only instantiated by its driver connection. - */ + /** @internal The statement can be only instantiated by its driver connection. */ public function __construct(PDOStatement $stmt) { $this->stmt = $stmt; diff --git a/src/Driver/SQLSrv/Connection.php b/src/Driver/SQLSrv/Connection.php index 0295db7e5b0..93de932d846 100644 --- a/src/Driver/SQLSrv/Connection.php +++ b/src/Driver/SQLSrv/Connection.php @@ -136,9 +136,7 @@ public function rollBack(): bool return true; } - /** - * @return resource - */ + /** @return resource */ public function getNativeConnection() { return $this->connection; diff --git a/src/Driver/SQLSrv/Result.php b/src/Driver/SQLSrv/Result.php index 0e24002cc26..db17e928d08 100644 --- a/src/Driver/SQLSrv/Result.php +++ b/src/Driver/SQLSrv/Result.php @@ -110,9 +110,7 @@ public function free(): void } } - /** - * @return mixed|false - */ + /** @return mixed|false */ private function fetch(int $fetchType) { return sqlsrv_fetch_array($this->statement, $fetchType) ?? false; diff --git a/src/Event/ConnectionEventArgs.php b/src/Event/ConnectionEventArgs.php index ee5ae961d78..aa52ce89db3 100644 --- a/src/Event/ConnectionEventArgs.php +++ b/src/Event/ConnectionEventArgs.php @@ -17,9 +17,7 @@ public function __construct(Connection $connection) $this->connection = $connection; } - /** - * @return Connection - */ + /** @return Connection */ public function getConnection() { return $this->connection; diff --git a/src/Event/Listeners/OracleSessionInit.php b/src/Event/Listeners/OracleSessionInit.php index d6d1fd9d169..6949f6e544c 100644 --- a/src/Event/Listeners/OracleSessionInit.php +++ b/src/Event/Listeners/OracleSessionInit.php @@ -35,9 +35,7 @@ class OracleSessionInit implements EventSubscriber 'NLS_NUMERIC_CHARACTERS' => '.,', ]; - /** - * @param string[] $oracleSessionVars - */ + /** @param string[] $oracleSessionVars */ public function __construct(array $oracleSessionVars = []) { $this->_defaultSessionVars = array_merge($this->_defaultSessionVars, $oracleSessionVars); diff --git a/src/Event/Listeners/SQLSessionInit.php b/src/Event/Listeners/SQLSessionInit.php index f7a4e9129d3..09e0b19ce2f 100644 --- a/src/Event/Listeners/SQLSessionInit.php +++ b/src/Event/Listeners/SQLSessionInit.php @@ -15,9 +15,7 @@ class SQLSessionInit implements EventSubscriber /** @var string */ protected $sql; - /** - * @param string $sql - */ + /** @param string $sql */ public function __construct($sql) { $this->sql = $sql; diff --git a/src/Event/SchemaAlterTableAddColumnEventArgs.php b/src/Event/SchemaAlterTableAddColumnEventArgs.php index ef040176091..1243ae891ce 100644 --- a/src/Event/SchemaAlterTableAddColumnEventArgs.php +++ b/src/Event/SchemaAlterTableAddColumnEventArgs.php @@ -30,25 +30,19 @@ public function __construct(Column $column, TableDiff $tableDiff, AbstractPlatfo $this->platform = $platform; } - /** - * @return Column - */ + /** @return Column */ public function getColumn() { return $this->column; } - /** - * @return TableDiff - */ + /** @return TableDiff */ public function getTableDiff() { return $this->tableDiff; } - /** - * @return AbstractPlatform - */ + /** @return AbstractPlatform */ public function getPlatform() { return $this->platform; @@ -77,9 +71,7 @@ public function addSql($sql) return $this; } - /** - * @return string[] - */ + /** @return string[] */ public function getSql() { return $this->sql; diff --git a/src/Event/SchemaAlterTableChangeColumnEventArgs.php b/src/Event/SchemaAlterTableChangeColumnEventArgs.php index 4c9d457c8ea..f9fa09618d8 100644 --- a/src/Event/SchemaAlterTableChangeColumnEventArgs.php +++ b/src/Event/SchemaAlterTableChangeColumnEventArgs.php @@ -29,25 +29,19 @@ public function __construct(ColumnDiff $columnDiff, TableDiff $tableDiff, Abstra $this->platform = $platform; } - /** - * @return ColumnDiff - */ + /** @return ColumnDiff */ public function getColumnDiff() { return $this->columnDiff; } - /** - * @return TableDiff - */ + /** @return TableDiff */ public function getTableDiff() { return $this->tableDiff; } - /** - * @return AbstractPlatform - */ + /** @return AbstractPlatform */ public function getPlatform() { return $this->platform; @@ -67,9 +61,7 @@ public function addSql($sql) return $this; } - /** - * @return string[] - */ + /** @return string[] */ public function getSql() { return $this->sql; diff --git a/src/Event/SchemaAlterTableEventArgs.php b/src/Event/SchemaAlterTableEventArgs.php index 26ba94194e9..ca7133b8d31 100644 --- a/src/Event/SchemaAlterTableEventArgs.php +++ b/src/Event/SchemaAlterTableEventArgs.php @@ -26,17 +26,13 @@ public function __construct(TableDiff $tableDiff, AbstractPlatform $platform) $this->platform = $platform; } - /** - * @return TableDiff - */ + /** @return TableDiff */ public function getTableDiff() { return $this->tableDiff; } - /** - * @return AbstractPlatform - */ + /** @return AbstractPlatform */ public function getPlatform() { return $this->platform; @@ -56,9 +52,7 @@ public function addSql($sql) return $this; } - /** - * @return string[] - */ + /** @return string[] */ public function getSql() { return $this->sql; diff --git a/src/Event/SchemaAlterTableRemoveColumnEventArgs.php b/src/Event/SchemaAlterTableRemoveColumnEventArgs.php index 58ec9086ce0..751fb5c8e01 100644 --- a/src/Event/SchemaAlterTableRemoveColumnEventArgs.php +++ b/src/Event/SchemaAlterTableRemoveColumnEventArgs.php @@ -29,25 +29,19 @@ public function __construct(Column $column, TableDiff $tableDiff, AbstractPlatfo $this->platform = $platform; } - /** - * @return Column - */ + /** @return Column */ public function getColumn() { return $this->column; } - /** - * @return TableDiff - */ + /** @return TableDiff */ public function getTableDiff() { return $this->tableDiff; } - /** - * @return AbstractPlatform - */ + /** @return AbstractPlatform */ public function getPlatform() { return $this->platform; @@ -67,9 +61,7 @@ public function addSql($sql) return $this; } - /** - * @return string[] - */ + /** @return string[] */ public function getSql() { return $this->sql; diff --git a/src/Event/SchemaAlterTableRenameColumnEventArgs.php b/src/Event/SchemaAlterTableRenameColumnEventArgs.php index c64c3389b57..e26634f7b5a 100644 --- a/src/Event/SchemaAlterTableRenameColumnEventArgs.php +++ b/src/Event/SchemaAlterTableRenameColumnEventArgs.php @@ -25,9 +25,7 @@ class SchemaAlterTableRenameColumnEventArgs extends SchemaEventArgs /** @var string[] */ private array $sql = []; - /** - * @param string $oldColumnName - */ + /** @param string $oldColumnName */ public function __construct($oldColumnName, Column $column, TableDiff $tableDiff, AbstractPlatform $platform) { $this->oldColumnName = $oldColumnName; @@ -36,33 +34,25 @@ public function __construct($oldColumnName, Column $column, TableDiff $tableDiff $this->platform = $platform; } - /** - * @return string - */ + /** @return string */ public function getOldColumnName() { return $this->oldColumnName; } - /** - * @return Column - */ + /** @return Column */ public function getColumn() { return $this->column; } - /** - * @return TableDiff - */ + /** @return TableDiff */ public function getTableDiff() { return $this->tableDiff; } - /** - * @return AbstractPlatform - */ + /** @return AbstractPlatform */ public function getPlatform() { return $this->platform; @@ -82,9 +72,7 @@ public function addSql($sql) return $this; } - /** - * @return string[] - */ + /** @return string[] */ public function getSql() { return $this->sql; diff --git a/src/Event/SchemaColumnDefinitionEventArgs.php b/src/Event/SchemaColumnDefinitionEventArgs.php index 0a55c71f1bf..922639ba881 100644 --- a/src/Event/SchemaColumnDefinitionEventArgs.php +++ b/src/Event/SchemaColumnDefinitionEventArgs.php @@ -53,41 +53,31 @@ public function setColumn(?Column $column = null) return $this; } - /** - * @return Column|null - */ + /** @return Column|null */ public function getColumn() { return $this->column; } - /** - * @return mixed[] - */ + /** @return mixed[] */ public function getTableColumn() { return $this->tableColumn; } - /** - * @return string - */ + /** @return string */ public function getTable() { return $this->table; } - /** - * @return string - */ + /** @return string */ public function getDatabase() { return $this->database; } - /** - * @return Connection - */ + /** @return Connection */ public function getConnection() { return $this->connection; diff --git a/src/Event/SchemaCreateTableColumnEventArgs.php b/src/Event/SchemaCreateTableColumnEventArgs.php index 25831e064fd..7161652d3ec 100644 --- a/src/Event/SchemaCreateTableColumnEventArgs.php +++ b/src/Event/SchemaCreateTableColumnEventArgs.php @@ -29,25 +29,19 @@ public function __construct(Column $column, Table $table, AbstractPlatform $plat $this->platform = $platform; } - /** - * @return Column - */ + /** @return Column */ public function getColumn() { return $this->column; } - /** - * @return Table - */ + /** @return Table */ public function getTable() { return $this->table; } - /** - * @return AbstractPlatform - */ + /** @return AbstractPlatform */ public function getPlatform() { return $this->platform; @@ -67,9 +61,7 @@ public function addSql($sql) return $this; } - /** - * @return string[] - */ + /** @return string[] */ public function getSql() { return $this->sql; diff --git a/src/Event/SchemaCreateTableEventArgs.php b/src/Event/SchemaCreateTableEventArgs.php index 964ce6e65bd..b0844c61d80 100644 --- a/src/Event/SchemaCreateTableEventArgs.php +++ b/src/Event/SchemaCreateTableEventArgs.php @@ -39,33 +39,25 @@ public function __construct(Table $table, array $columns, array $options, Abstra $this->platform = $platform; } - /** - * @return Table - */ + /** @return Table */ public function getTable() { return $this->table; } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public function getColumns() { return $this->columns; } - /** - * @return mixed[] - */ + /** @return mixed[] */ public function getOptions() { return $this->options; } - /** - * @return AbstractPlatform - */ + /** @return AbstractPlatform */ public function getPlatform() { return $this->platform; @@ -85,9 +77,7 @@ public function addSql($sql) return $this; } - /** - * @return string[] - */ + /** @return string[] */ public function getSql() { return $this->sql; diff --git a/src/Event/SchemaDropTableEventArgs.php b/src/Event/SchemaDropTableEventArgs.php index a02ea97c03e..e6f1eebc8a5 100644 --- a/src/Event/SchemaDropTableEventArgs.php +++ b/src/Event/SchemaDropTableEventArgs.php @@ -30,17 +30,13 @@ public function __construct($table, AbstractPlatform $platform) $this->platform = $platform; } - /** - * @return string|Table - */ + /** @return string|Table */ public function getTable() { return $this->table; } - /** - * @return AbstractPlatform - */ + /** @return AbstractPlatform */ public function getPlatform() { return $this->platform; @@ -58,9 +54,7 @@ public function setSql($sql) return $this; } - /** - * @return string|null - */ + /** @return string|null */ public function getSql() { return $this->sql; diff --git a/src/Event/SchemaEventArgs.php b/src/Event/SchemaEventArgs.php index 8ca32e24b35..18cb49f380a 100644 --- a/src/Event/SchemaEventArgs.php +++ b/src/Event/SchemaEventArgs.php @@ -11,9 +11,7 @@ class SchemaEventArgs extends EventArgs { private bool $preventDefault = false; - /** - * @return SchemaEventArgs - */ + /** @return SchemaEventArgs */ public function preventDefault() { $this->preventDefault = true; @@ -21,9 +19,7 @@ public function preventDefault() return $this; } - /** - * @return bool - */ + /** @return bool */ public function isDefaultPrevented() { return $this->preventDefault; diff --git a/src/Event/SchemaIndexDefinitionEventArgs.php b/src/Event/SchemaIndexDefinitionEventArgs.php index b1b33a3c82f..d9290aaec7e 100644 --- a/src/Event/SchemaIndexDefinitionEventArgs.php +++ b/src/Event/SchemaIndexDefinitionEventArgs.php @@ -47,33 +47,25 @@ public function setIndex(?Index $index = null) return $this; } - /** - * @return Index|null - */ + /** @return Index|null */ public function getIndex() { return $this->index; } - /** - * @return mixed[] - */ + /** @return mixed[] */ public function getTableIndex() { return $this->tableIndex; } - /** - * @return string - */ + /** @return string */ public function getTable() { return $this->table; } - /** - * @return Connection - */ + /** @return Connection */ public function getConnection() { return $this->connection; diff --git a/src/Exception.php b/src/Exception.php index b8d7804d5d3..6beb0a578e8 100644 --- a/src/Exception.php +++ b/src/Exception.php @@ -12,9 +12,7 @@ use function spl_object_hash; use function sprintf; -/** - * @psalm-immutable - */ +/** @psalm-immutable */ class Exception extends \Exception { public static function notSupported(string $method): self @@ -22,9 +20,7 @@ public static function notSupported(string $method): self return new self(sprintf("Operation '%s' is not supported by platform.", $method)); } - /** - * @param mixed $invalidPlatform - */ + /** @param mixed $invalidPlatform */ public static function invalidPlatformType($invalidPlatform): self { if (is_object($invalidPlatform)) { @@ -64,9 +60,7 @@ public static function invalidPlatformVersionSpecified(string $version, string $ ); } - /** - * @param string|null $url The URL that was provided in the connection parameters (if any). - */ + /** @param string|null $url The URL that was provided in the connection parameters (if any). */ public static function driverRequired(?string $url = null): self { if ($url !== null) { @@ -83,9 +77,7 @@ public static function driverRequired(?string $url = null): self 'instance is given to DriverManager::getConnection().'); } - /** - * @param string[] $knownDrivers - */ + /** @param string[] $knownDrivers */ public static function unknownDriver(string $unknownDriverName, array $knownDrivers): self { return new self("The given 'driver' " . $unknownDriverName . ' is unknown, ' . diff --git a/src/Exception/ConnectionLost.php b/src/Exception/ConnectionLost.php index 46a4247576e..c45085839c6 100644 --- a/src/Exception/ConnectionLost.php +++ b/src/Exception/ConnectionLost.php @@ -2,9 +2,7 @@ namespace Doctrine\DBAL\Exception; -/** - * @psalm-immutable - */ +/** @psalm-immutable */ final class ConnectionLost extends ConnectionException { } diff --git a/src/Exception/DatabaseDoesNotExist.php b/src/Exception/DatabaseDoesNotExist.php index 87eb1381acb..dc71c82cbaf 100644 --- a/src/Exception/DatabaseDoesNotExist.php +++ b/src/Exception/DatabaseDoesNotExist.php @@ -2,9 +2,7 @@ namespace Doctrine\DBAL\Exception; -/** - * @psalm-immutable - */ +/** @psalm-immutable */ class DatabaseDoesNotExist extends DatabaseObjectNotFoundException { } diff --git a/src/Exception/DatabaseRequired.php b/src/Exception/DatabaseRequired.php index d87ad3e655d..49b7326cd1f 100644 --- a/src/Exception/DatabaseRequired.php +++ b/src/Exception/DatabaseRequired.php @@ -8,9 +8,7 @@ use function sprintf; -/** - * @psalm-immutable - */ +/** @psalm-immutable */ class DatabaseRequired extends Exception { public static function new(string $methodName): self diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php index 0b06140740f..7f58510f01b 100644 --- a/src/Exception/InvalidArgumentException.php +++ b/src/Exception/InvalidArgumentException.php @@ -11,9 +11,7 @@ */ class InvalidArgumentException extends Exception { - /** - * @return self - */ + /** @return self */ public static function fromEmptyCriteria() { return new self('Empty criteria was used, expected non-empty criteria'); diff --git a/src/Exception/InvalidLockMode.php b/src/Exception/InvalidLockMode.php index 9a4d6c77bc9..cf32f4d0d0b 100644 --- a/src/Exception/InvalidLockMode.php +++ b/src/Exception/InvalidLockMode.php @@ -6,9 +6,7 @@ use function sprintf; -/** - * @psalm-immutable - */ +/** @psalm-immutable */ class InvalidLockMode extends Exception { public static function fromLockMode(int $lockMode): self diff --git a/src/Exception/SchemaDoesNotExist.php b/src/Exception/SchemaDoesNotExist.php index cbb0658b840..de6fa5c006d 100644 --- a/src/Exception/SchemaDoesNotExist.php +++ b/src/Exception/SchemaDoesNotExist.php @@ -2,9 +2,7 @@ namespace Doctrine\DBAL\Exception; -/** - * @psalm-immutable - */ +/** @psalm-immutable */ class SchemaDoesNotExist extends DatabaseObjectNotFoundException { } diff --git a/src/ExpandArrayParameters.php b/src/ExpandArrayParameters.php index 9aa9a6e23d7..3d7046817d1 100644 --- a/src/ExpandArrayParameters.php +++ b/src/ExpandArrayParameters.php @@ -76,9 +76,7 @@ public function getSQL(): string return implode('', $this->convertedSQL); } - /** - * @return list - */ + /** @return list */ public function getParameters(): array { return $this->convertedParameteres; @@ -118,9 +116,7 @@ private function acceptParameter($key, $value): void $this->appendTypedParameter($value, $type - Connection::ARRAY_PARAM_OFFSET); } - /** - * @return array - */ + /** @return array */ public function getTypes(): array { return $this->convertedTypes; diff --git a/src/Id/TableGeneratorSchemaVisitor.php b/src/Id/TableGeneratorSchemaVisitor.php index f47c9a914be..9b4724ddfde 100644 --- a/src/Id/TableGeneratorSchemaVisitor.php +++ b/src/Id/TableGeneratorSchemaVisitor.php @@ -11,17 +11,13 @@ use Doctrine\DBAL\Schema\Visitor\Visitor; use Doctrine\Deprecations\Deprecation; -/** - * @deprecated - */ +/** @deprecated */ class TableGeneratorSchemaVisitor implements Visitor { /** @var string */ private $generatorTableName; - /** - * @param string $generatorTableName - */ + /** @param string $generatorTableName */ public function __construct($generatorTableName = 'sequences') { Deprecation::trigger( diff --git a/src/Logging/Connection.php b/src/Logging/Connection.php index 9ef5a661744..4a523f2c5a3 100644 --- a/src/Logging/Connection.php +++ b/src/Logging/Connection.php @@ -14,9 +14,7 @@ final class Connection extends AbstractConnectionMiddleware { private LoggerInterface $logger; - /** - * @internal This connection can be only instantiated by its driver. - */ + /** @internal This connection can be only instantiated by its driver. */ public function __construct(ConnectionInterface $connection, LoggerInterface $logger) { parent::__construct($connection); diff --git a/src/Logging/Driver.php b/src/Logging/Driver.php index 0ba2aef6265..6660db6155b 100644 --- a/src/Logging/Driver.php +++ b/src/Logging/Driver.php @@ -12,9 +12,7 @@ final class Driver extends AbstractDriverMiddleware { private LoggerInterface $logger; - /** - * @internal This driver can be only instantiated by its middleware. - */ + /** @internal This driver can be only instantiated by its middleware. */ public function __construct(DriverInterface $driver, LoggerInterface $logger) { parent::__construct($driver); diff --git a/src/Logging/LoggerChain.php b/src/Logging/LoggerChain.php index c9c51bfbcbc..8062585e2d6 100644 --- a/src/Logging/LoggerChain.php +++ b/src/Logging/LoggerChain.php @@ -14,9 +14,7 @@ class LoggerChain implements SQLLogger /** @var iterable */ private iterable $loggers; - /** - * @param iterable $loggers - */ + /** @param iterable $loggers */ public function __construct(iterable $loggers = []) { Deprecation::trigger( diff --git a/src/Logging/Statement.php b/src/Logging/Statement.php index 55d1d628c2b..f2b9972fa06 100644 --- a/src/Logging/Statement.php +++ b/src/Logging/Statement.php @@ -26,9 +26,7 @@ final class Statement extends AbstractStatementMiddleware /** @var array|array */ private array $types = []; - /** - * @internal This statement can be only instantiated by its connection. - */ + /** @internal This statement can be only instantiated by its connection. */ public function __construct(StatementInterface $statement, LoggerInterface $logger, string $sql) { parent::__construct($statement); diff --git a/src/Platforms/AbstractMySQLPlatform.php b/src/Platforms/AbstractMySQLPlatform.php index 51c71166c9c..1c55c32ef34 100644 --- a/src/Platforms/AbstractMySQLPlatform.php +++ b/src/Platforms/AbstractMySQLPlatform.php @@ -394,9 +394,7 @@ public function getListTableColumnsSQL($table, $database = null) ' ORDER BY ORDINAL_POSITION ASC'; } - /** - * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. - */ + /** @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. */ public function getListTableMetadataSQL(string $table, ?string $database = null): string { return sprintf( diff --git a/src/Platforms/AbstractPlatform.php b/src/Platforms/AbstractPlatform.php index 1e127f8ccd9..79cce26bf28 100644 --- a/src/Platforms/AbstractPlatform.php +++ b/src/Platforms/AbstractPlatform.php @@ -2277,9 +2277,7 @@ protected function _getCreateTableSQL($name, array $columns, array $options = [] return $sql; } - /** - * @return string - */ + /** @return string */ public function getCreateTemporaryTableSnippetSQL() { return 'CREATE TEMPORARY TABLE'; @@ -2710,9 +2708,7 @@ protected function onSchemaAlterTable(TableDiff $diff, &$sql) return $eventArgs->isDefaultPrevented(); } - /** - * @return string[] - */ + /** @return string[] */ protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff) { $tableName = $diff->getName($this)->getQuotedName($this); @@ -2743,9 +2739,7 @@ protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff) return $sql; } - /** - * @return string[] - */ + /** @return string[] */ protected function getPostAlterTableIndexForeignKeySQL(TableDiff $diff) { $sql = []; @@ -4453,9 +4447,7 @@ private function columnToArray(Column $column): array ]); } - /** - * @internal - */ + /** @internal */ public function createSQLParser(): Parser { return new Parser(false); diff --git a/src/Platforms/DB2Platform.php b/src/Platforms/DB2Platform.php index f847c090637..6b22a4ca970 100644 --- a/src/Platforms/DB2Platform.php +++ b/src/Platforms/DB2Platform.php @@ -972,9 +972,7 @@ protected function getReservedKeywordsClass() return Keywords\DB2Keywords::class; } - /** - * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. - */ + /** @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. */ public function getListTableCommentsSQL(string $table): string { return sprintf( diff --git a/src/Platforms/DateIntervalUnit.php b/src/Platforms/DateIntervalUnit.php index c1f3ca59218..a95c4e28bfd 100644 --- a/src/Platforms/DateIntervalUnit.php +++ b/src/Platforms/DateIntervalUnit.php @@ -22,9 +22,7 @@ final class DateIntervalUnit public const YEAR = 'YEAR'; - /** - * @codeCoverageIgnore - */ + /** @codeCoverageIgnore */ private function __construct() { } diff --git a/src/Platforms/Keywords/KeywordList.php b/src/Platforms/Keywords/KeywordList.php index 291d4208c4a..5842773952b 100644 --- a/src/Platforms/Keywords/KeywordList.php +++ b/src/Platforms/Keywords/KeywordList.php @@ -32,9 +32,7 @@ public function isKeyword($word) return isset($this->keywords[strtoupper($word)]); } - /** - * @return void - */ + /** @return void */ protected function initializeKeywords() { $this->keywords = array_flip(array_map('strtoupper', $this->getKeywords())); diff --git a/src/Platforms/Keywords/MariaDBKeywords.php b/src/Platforms/Keywords/MariaDBKeywords.php index 97758e61c68..ede44e1a622 100644 --- a/src/Platforms/Keywords/MariaDBKeywords.php +++ b/src/Platforms/Keywords/MariaDBKeywords.php @@ -6,9 +6,7 @@ class MariaDBKeywords extends MySQLKeywords { - /** - * @deprecated - */ + /** @deprecated */ public function getName(): string { Deprecation::triggerIfCalledFromOutside( diff --git a/src/Platforms/Keywords/MariaDb102Keywords.php b/src/Platforms/Keywords/MariaDb102Keywords.php index 880fe4e0289..6463bd9f367 100644 --- a/src/Platforms/Keywords/MariaDb102Keywords.php +++ b/src/Platforms/Keywords/MariaDb102Keywords.php @@ -13,9 +13,7 @@ */ final class MariaDb102Keywords extends MariaDBKeywords { - /** - * @deprecated - */ + /** @deprecated */ public function getName(): string { Deprecation::triggerIfCalledFromOutside( diff --git a/src/Platforms/Keywords/PostgreSQL100Keywords.php b/src/Platforms/Keywords/PostgreSQL100Keywords.php index 3dfdc3327eb..4b475c1292d 100644 --- a/src/Platforms/Keywords/PostgreSQL100Keywords.php +++ b/src/Platforms/Keywords/PostgreSQL100Keywords.php @@ -13,9 +13,7 @@ */ class PostgreSQL100Keywords extends PostgreSQL94Keywords { - /** - * @deprecated - */ + /** @deprecated */ public function getName(): string { Deprecation::triggerIfCalledFromOutside( diff --git a/src/Platforms/Keywords/ReservedKeywordsValidator.php b/src/Platforms/Keywords/ReservedKeywordsValidator.php index c98f6d7a39a..5ab0a7d078e 100644 --- a/src/Platforms/Keywords/ReservedKeywordsValidator.php +++ b/src/Platforms/Keywords/ReservedKeywordsValidator.php @@ -15,9 +15,7 @@ use function implode; use function str_replace; -/** - * @deprecated Use database documentation instead. - */ +/** @deprecated Use database documentation instead. */ class ReservedKeywordsValidator implements Visitor { /** @var KeywordList[] */ @@ -26,9 +24,7 @@ class ReservedKeywordsValidator implements Visitor /** @var string[] */ private array $violations = []; - /** - * @param KeywordList[] $keywordLists - */ + /** @param KeywordList[] $keywordLists */ public function __construct(array $keywordLists) { Deprecation::triggerIfCalledFromOutside( @@ -40,9 +36,7 @@ public function __construct(array $keywordLists) $this->keywordLists = $keywordLists; } - /** - * @return string[] - */ + /** @return string[] */ public function getViolations() { return $this->violations; diff --git a/src/Platforms/MariaDBPlatform.php b/src/Platforms/MariaDBPlatform.php index 1795cc7702f..a34c5262af8 100644 --- a/src/Platforms/MariaDBPlatform.php +++ b/src/Platforms/MariaDBPlatform.php @@ -33,9 +33,7 @@ public function getJsonTypeDeclarationSQL(array $column): string return 'LONGTEXT'; } - /** - * @deprecated Implement {@see createReservedKeywordsList()} instead. - */ + /** @deprecated Implement {@see createReservedKeywordsList()} instead. */ protected function getReservedKeywordsClass(): string { Deprecation::triggerIfCalledFromOutside( diff --git a/src/Platforms/MySQL/CollationMetadataProvider.php b/src/Platforms/MySQL/CollationMetadataProvider.php index 4aa0faf6c31..d52ca74a2b2 100644 --- a/src/Platforms/MySQL/CollationMetadataProvider.php +++ b/src/Platforms/MySQL/CollationMetadataProvider.php @@ -4,9 +4,7 @@ namespace Doctrine\DBAL\Platforms\MySQL; -/** - * @internal - */ +/** @internal */ interface CollationMetadataProvider { public function getCollationCharset(string $collation): ?string; diff --git a/src/Platforms/MySQL/CollationMetadataProvider/CachingCollationMetadataProvider.php b/src/Platforms/MySQL/CollationMetadataProvider/CachingCollationMetadataProvider.php index 243a10f2ab2..513c08b6e1f 100644 --- a/src/Platforms/MySQL/CollationMetadataProvider/CachingCollationMetadataProvider.php +++ b/src/Platforms/MySQL/CollationMetadataProvider/CachingCollationMetadataProvider.php @@ -8,9 +8,7 @@ use function array_key_exists; -/** - * @internal - */ +/** @internal */ final class CachingCollationMetadataProvider implements CollationMetadataProvider { /** @var CollationMetadataProvider */ diff --git a/src/Platforms/MySQL/CollationMetadataProvider/ConnectionCollationMetadataProvider.php b/src/Platforms/MySQL/CollationMetadataProvider/ConnectionCollationMetadataProvider.php index 401c940e003..9514ea5ea63 100644 --- a/src/Platforms/MySQL/CollationMetadataProvider/ConnectionCollationMetadataProvider.php +++ b/src/Platforms/MySQL/CollationMetadataProvider/ConnectionCollationMetadataProvider.php @@ -8,9 +8,7 @@ use Doctrine\DBAL\Exception; use Doctrine\DBAL\Platforms\MySQL\CollationMetadataProvider; -/** - * @internal - */ +/** @internal */ final class ConnectionCollationMetadataProvider implements CollationMetadataProvider { /** @var Connection */ @@ -21,9 +19,7 @@ public function __construct(Connection $connection) $this->connection = $connection; } - /** - * @throws Exception - */ + /** @throws Exception */ public function getCollationCharset(string $collation): ?string { $charset = $this->connection->fetchOne( diff --git a/src/Platforms/MySQL/Comparator.php b/src/Platforms/MySQL/Comparator.php index 74e7fe3baf9..2edc2d17850 100644 --- a/src/Platforms/MySQL/Comparator.php +++ b/src/Platforms/MySQL/Comparator.php @@ -21,9 +21,7 @@ class Comparator extends BaseComparator /** @var CollationMetadataProvider */ private $collationMetadataProvider; - /** - * @internal The comparator can be only instantiated by a schema manager. - */ + /** @internal The comparator can be only instantiated by a schema manager. */ public function __construct(AbstractMySQLPlatform $platform, CollationMetadataProvider $collationMetadataProvider) { parent::__construct($platform); diff --git a/src/Platforms/OraclePlatform.php b/src/Platforms/OraclePlatform.php index cf0ae5bf839..8523870cbab 100644 --- a/src/Platforms/OraclePlatform.php +++ b/src/Platforms/OraclePlatform.php @@ -1275,9 +1275,7 @@ public function getBlobTypeDeclarationSQL(array $column) return 'BLOB'; } - /** - * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. - */ + /** @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. */ public function getListTableCommentsSQL(string $table, ?string $database = null): string { $tableCommentsName = 'user_tab_comments'; diff --git a/src/Platforms/PostgreSQL100Platform.php b/src/Platforms/PostgreSQL100Platform.php index 04e3448e669..4a08cc98bf0 100644 --- a/src/Platforms/PostgreSQL100Platform.php +++ b/src/Platforms/PostgreSQL100Platform.php @@ -15,9 +15,7 @@ */ class PostgreSQL100Platform extends PostgreSQL94Platform { - /** - * @deprecated Implement {@see createReservedKeywordsList()} instead. - */ + /** @deprecated Implement {@see createReservedKeywordsList()} instead. */ protected function getReservedKeywordsClass(): string { Deprecation::triggerIfCalledFromOutside( diff --git a/src/Platforms/PostgreSQLPlatform.php b/src/Platforms/PostgreSQLPlatform.php index 9f65b329190..2d7cd7b0876 100644 --- a/src/Platforms/PostgreSQLPlatform.php +++ b/src/Platforms/PostgreSQLPlatform.php @@ -905,9 +905,7 @@ public function convertBooleans($item) return $this->doConvertBooleans( $item, - /** - * @param mixed $value - */ + /** @param mixed $value */ static function ($value) { if ($value === null) { return 'NULL'; @@ -929,9 +927,7 @@ public function convertBooleansToDatabaseValue($item) return $this->doConvertBooleans( $item, - /** - * @param mixed $value - */ + /** @param mixed $value */ static function ($value): ?int { return $value === null ? null : (int) $value; } @@ -1326,9 +1322,7 @@ private function getOldColumnComment(ColumnDiff $columnDiff): ?string return $columnDiff->fromColumn !== null ? $this->getColumnComment($columnDiff->fromColumn) : null; } - /** - * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. - */ + /** @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. */ public function getListTableMetadataSQL(string $table, ?string $schema = null): string { if ($schema !== null) { diff --git a/src/Platforms/SQLServer/Comparator.php b/src/Platforms/SQLServer/Comparator.php index 49f170b0ac5..e231e808394 100644 --- a/src/Platforms/SQLServer/Comparator.php +++ b/src/Platforms/SQLServer/Comparator.php @@ -15,9 +15,7 @@ class Comparator extends BaseComparator { private string $databaseCollation; - /** - * @internal The comparator can be only instantiated by a schema manager. - */ + /** @internal The comparator can be only instantiated by a schema manager. */ public function __construct(SQLServerPlatform $platform, string $databaseCollation) { parent::__construct($platform); diff --git a/src/Platforms/SQLServerPlatform.php b/src/Platforms/SQLServerPlatform.php index 4c8f72b8bfe..d56ae169e2a 100644 --- a/src/Platforms/SQLServerPlatform.php +++ b/src/Platforms/SQLServerPlatform.php @@ -1697,9 +1697,7 @@ protected function getCommentOnTableSQL(string $tableName, ?string $comment): st ); } - /** - * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. - */ + /** @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. */ public function getListTableMetadataSQL(string $table): string { return sprintf( @@ -1717,9 +1715,7 @@ public function getListTableMetadataSQL(string $table): string ); } - /** - * @param string $query - */ + /** @param string $query */ private function shouldAddOrderBy($query): bool { // Find the position of the last instance of ORDER BY and ensure it is not within a parenthetical statement diff --git a/src/Platforms/SQLite/Comparator.php b/src/Platforms/SQLite/Comparator.php index d27ee86d783..263f3561e8b 100644 --- a/src/Platforms/SQLite/Comparator.php +++ b/src/Platforms/SQLite/Comparator.php @@ -15,9 +15,7 @@ */ class Comparator extends BaseComparator { - /** - * @internal The comparator can be only instantiated by a schema manager. - */ + /** @internal The comparator can be only instantiated by a schema manager. */ public function __construct(SqlitePlatform $platform) { parent::__construct($platform); diff --git a/src/Platforms/SqlitePlatform.php b/src/Platforms/SqlitePlatform.php index 66db97cf59e..70d384c8b55 100644 --- a/src/Platforms/SqlitePlatform.php +++ b/src/Platforms/SqlitePlatform.php @@ -1238,9 +1238,7 @@ private function getSimpleAlterTableSQL(TableDiff $diff) return array_merge($sql, $tableSql, $columnSql); } - /** - * @return string[] - */ + /** @return string[] */ private function getColumnNamesInAlteredTable(TableDiff $diff, Table $fromTable): array { $columns = []; @@ -1278,9 +1276,7 @@ private function getColumnNamesInAlteredTable(TableDiff $diff, Table $fromTable) return $columns; } - /** - * @return Index[] - */ + /** @return Index[] */ private function getIndexesInAlteredTable(TableDiff $diff, Table $fromTable): array { $indexes = $fromTable->getIndexes(); @@ -1346,9 +1342,7 @@ private function getIndexesInAlteredTable(TableDiff $diff, Table $fromTable): ar return $indexes; } - /** - * @return ForeignKeyConstraint[] - */ + /** @return ForeignKeyConstraint[] */ private function getForeignKeysInAlteredTable(TableDiff $diff, Table $fromTable): array { $foreignKeys = $fromTable->getForeignKeys(); @@ -1410,9 +1404,7 @@ private function getForeignKeysInAlteredTable(TableDiff $diff, Table $fromTable) return $foreignKeys; } - /** - * @return Index[] - */ + /** @return Index[] */ private function getPrimaryIndexInAlteredTable(TableDiff $diff, Table $fromTable): array { $primaryIndex = []; diff --git a/src/Platforms/TrimMode.php b/src/Platforms/TrimMode.php index eb499ee4621..01356c0d3d9 100644 --- a/src/Platforms/TrimMode.php +++ b/src/Platforms/TrimMode.php @@ -14,9 +14,7 @@ final class TrimMode public const BOTH = 3; - /** - * @codeCoverageIgnore - */ + /** @codeCoverageIgnore */ private function __construct() { } diff --git a/src/Portability/Result.php b/src/Portability/Result.php index a5ea91c4d2b..1ac45e89f39 100644 --- a/src/Portability/Result.php +++ b/src/Portability/Result.php @@ -11,9 +11,7 @@ final class Result extends AbstractResultMiddleware { private Converter $converter; - /** - * @internal The result can be only instantiated by the portability connection or statement. - */ + /** @internal The result can be only instantiated by the portability connection or statement. */ public function __construct(ResultInterface $result, Converter $converter) { parent::__construct($result); diff --git a/src/Query.php b/src/Query.php index dc24d2f363a..bfc9b14e2d3 100644 --- a/src/Query.php +++ b/src/Query.php @@ -50,17 +50,13 @@ public function getSQL(): string return $this->sql; } - /** - * @return array - */ + /** @return array */ public function getParams(): array { return $this->params; } - /** - * @return array - */ + /** @return array */ public function getTypes(): array { return $this->types; diff --git a/src/Query/QueryBuilder.php b/src/Query/QueryBuilder.php index b790cdeab46..90428b29353 100644 --- a/src/Query/QueryBuilder.php +++ b/src/Query/QueryBuilder.php @@ -38,34 +38,22 @@ */ class QueryBuilder { - /** - * @deprecated - */ + /** @deprecated */ public const SELECT = 0; - /** - * @deprecated - */ + /** @deprecated */ public const DELETE = 1; - /** - * @deprecated - */ + /** @deprecated */ public const UPDATE = 2; - /** - * @deprecated - */ + /** @deprecated */ public const INSERT = 3; - /** - * @deprecated - */ + /** @deprecated */ public const STATE_DIRTY = 0; - /** - * @deprecated - */ + /** @deprecated */ public const STATE_CLEAN = 1; /** @@ -1349,9 +1337,7 @@ public function resetQueryPart($queryPartName) return $this; } - /** - * @throws QueryException - */ + /** @throws QueryException */ private function getSQLForSelect(): string { $query = 'SELECT ' . ($this->sqlParts['distinct'] ? 'DISTINCT ' : '') . diff --git a/src/Query/QueryException.php b/src/Query/QueryException.php index 58e941e9843..90d1f47d932 100644 --- a/src/Query/QueryException.php +++ b/src/Query/QueryException.php @@ -6,9 +6,7 @@ use function implode; -/** - * @psalm-immutable - */ +/** @psalm-immutable */ class QueryException extends Exception { /** diff --git a/src/Result.php b/src/Result.php index 9ff923d1647..0426fd48f2e 100644 --- a/src/Result.php +++ b/src/Result.php @@ -18,9 +18,7 @@ class Result private DriverResult $result; private Connection $connection; - /** - * @internal The result can be only instantiated by {@see Connection} or {@see Statement}. - */ + /** @internal The result can be only instantiated by {@see Connection} or {@see Statement}. */ public function __construct(DriverResult $result, Connection $connection) { $this->result = $result; @@ -225,9 +223,7 @@ public function iterateColumn(): Traversable } } - /** - * @throws Exception - */ + /** @throws Exception */ public function rowCount(): int { try { @@ -237,9 +233,7 @@ public function rowCount(): int } } - /** - * @throws Exception - */ + /** @throws Exception */ public function columnCount(): int { try { @@ -254,9 +248,7 @@ public function free(): void $this->result->free(); } - /** - * @throws Exception - */ + /** @throws Exception */ private function ensureHasKeyValue(): void { $columnCount = $this->columnCount(); diff --git a/src/Schema/AbstractSchemaManager.php b/src/Schema/AbstractSchemaManager.php index 0359cda07da..a546500db80 100644 --- a/src/Schema/AbstractSchemaManager.php +++ b/src/Schema/AbstractSchemaManager.php @@ -49,9 +49,7 @@ abstract class AbstractSchemaManager */ protected $_platform; - /** - * @param T $platform - */ + /** @param T $platform */ public function __construct(Connection $connection, AbstractPlatform $platform) { $this->_conn = $connection; @@ -856,9 +854,7 @@ public function dropView($name) /* create*() Methods */ - /** - * @throws Exception - */ + /** @throws Exception */ public function createSchemaObjects(Schema $schema): void { $this->_execSql($schema->toSql($this->_platform)); @@ -974,9 +970,7 @@ public function createView(View $view) /* dropAndCreate*() Methods */ - /** - * @throws Exception - */ + /** @throws Exception */ public function dropSchemaObjects(Schema $schema): void { $this->_execSql($schema->toDropSql($this->_platform)); @@ -1681,9 +1675,7 @@ public function removeDoctrineTypeFromComment($comment, $type) return str_replace('(DC2Type:' . $type . ')', '', $comment); } - /** - * @throws Exception - */ + /** @throws Exception */ private function getDatabase(string $methodName): string { $database = $this->_conn->getDatabase(); diff --git a/src/Schema/Column.php b/src/Schema/Column.php index 31963461c35..0a8f1b3b75c 100644 --- a/src/Schema/Column.php +++ b/src/Schema/Column.php @@ -95,9 +95,7 @@ public function setOptions(array $options) return $this; } - /** - * @return Column - */ + /** @return Column */ public function setType(Type $type) { $this->_type = $type; @@ -238,73 +236,55 @@ public function setColumnDefinition($value) return $this; } - /** - * @return Type - */ + /** @return Type */ public function getType() { return $this->_type; } - /** - * @return int|null - */ + /** @return int|null */ public function getLength() { return $this->_length; } - /** - * @return int - */ + /** @return int */ public function getPrecision() { return $this->_precision; } - /** - * @return int - */ + /** @return int */ public function getScale() { return $this->_scale; } - /** - * @return bool - */ + /** @return bool */ public function getUnsigned() { return $this->_unsigned; } - /** - * @return bool - */ + /** @return bool */ public function getFixed() { return $this->_fixed; } - /** - * @return bool - */ + /** @return bool */ public function getNotnull() { return $this->_notnull; } - /** - * @return string|null - */ + /** @return string|null */ public function getDefault() { return $this->_default; } - /** - * @return mixed[] - */ + /** @return mixed[] */ public function getPlatformOptions() { return $this->_platformOptions; @@ -330,17 +310,13 @@ public function getPlatformOption($name) return $this->_platformOptions[$name]; } - /** - * @return string|null - */ + /** @return string|null */ public function getColumnDefinition() { return $this->_columnDefinition; } - /** - * @return bool - */ + /** @return bool */ public function getAutoincrement() { return $this->_autoincrement; @@ -370,9 +346,7 @@ public function setComment($comment) return $this; } - /** - * @return string|null - */ + /** @return string|null */ public function getComment() { return $this->_comment; @@ -471,9 +445,7 @@ public function getCustomSchemaOptions() return $this->_customSchemaOptions; } - /** - * @return mixed[] - */ + /** @return mixed[] */ public function toArray() { return array_merge([ diff --git a/src/Schema/ColumnDiff.php b/src/Schema/ColumnDiff.php index 83402fd0f3e..d2977f0be80 100644 --- a/src/Schema/ColumnDiff.php +++ b/src/Schema/ColumnDiff.php @@ -58,9 +58,7 @@ public function hasChanged($propertyName) return in_array($propertyName, $this->changedProperties, true); } - /** - * @return Identifier - */ + /** @return Identifier */ public function getOldColumnName() { $quote = $this->fromColumn !== null && $this->fromColumn->isQuoted(); diff --git a/src/Schema/Comparator.php b/src/Schema/Comparator.php index 166edcbd9ea..61473c482cd 100644 --- a/src/Schema/Comparator.php +++ b/src/Schema/Comparator.php @@ -29,9 +29,7 @@ class Comparator { private ?AbstractPlatform $platform = null; - /** - * @internal The comparator can be only instantiated by a schema manager. - */ + /** @internal The comparator can be only instantiated by a schema manager. */ public function __construct(?AbstractPlatform $platform = null) { if ($platform === null) { @@ -47,9 +45,7 @@ public function __construct(?AbstractPlatform $platform = null) $this->platform = $platform; } - /** - * @param list $args - */ + /** @param list $args */ public function __call(string $method, array $args): SchemaDiff { if ($method !== 'compareSchemas') { @@ -59,9 +55,7 @@ public function __call(string $method, array $args): SchemaDiff return $this->doCompareSchemas(...$args); } - /** - * @param list $args - */ + /** @param list $args */ public static function __callStatic(string $method, array $args): SchemaDiff { if ($method !== 'compareSchemas') { @@ -249,9 +243,7 @@ private function isAutoIncrementSequenceInSchema($schema, $sequence): bool return false; } - /** - * @return bool - */ + /** @return bool */ public function diffSequence(Sequence $sequence1, Sequence $sequence2) { if ($sequence1->getAllocationSize() !== $sequence2->getAllocationSize()) { @@ -475,9 +467,7 @@ private function detectIndexRenamings(TableDiff $tableDifferences): void } } - /** - * @return bool - */ + /** @return bool */ public function diffForeignKey(ForeignKeyConstraint $key1, ForeignKeyConstraint $key2) { if ( diff --git a/src/Schema/Constraint.php b/src/Schema/Constraint.php index 85338c783ea..f47ee1fd138 100644 --- a/src/Schema/Constraint.php +++ b/src/Schema/Constraint.php @@ -11,14 +11,10 @@ */ interface Constraint { - /** - * @return string - */ + /** @return string */ public function getName(); - /** - * @return string - */ + /** @return string */ public function getQuotedName(AbstractPlatform $platform); /** diff --git a/src/Schema/Exception/InvalidTableName.php b/src/Schema/Exception/InvalidTableName.php index 440e60785b6..50e2d3af9b9 100644 --- a/src/Schema/Exception/InvalidTableName.php +++ b/src/Schema/Exception/InvalidTableName.php @@ -8,9 +8,7 @@ use function sprintf; -/** - * @psalm-immutable - */ +/** @psalm-immutable */ final class InvalidTableName extends SchemaException { public static function new(string $tableName): self diff --git a/src/Schema/Exception/UnknownColumnOption.php b/src/Schema/Exception/UnknownColumnOption.php index 8cf5ac14872..f96143d71d7 100644 --- a/src/Schema/Exception/UnknownColumnOption.php +++ b/src/Schema/Exception/UnknownColumnOption.php @@ -8,9 +8,7 @@ use function sprintf; -/** - * @psalm-immutable - */ +/** @psalm-immutable */ final class UnknownColumnOption extends SchemaException { public static function new(string $name): self diff --git a/src/Schema/Index.php b/src/Schema/Index.php index c42c331a8a7..97ca1989d3d 100644 --- a/src/Schema/Index.php +++ b/src/Schema/Index.php @@ -77,9 +77,7 @@ public function __construct( } } - /** - * @throws InvalidArgumentException - */ + /** @throws InvalidArgumentException */ protected function _addColumn(string $column): void { $this->_columns[$column] = new Identifier($column); @@ -118,9 +116,7 @@ public function getQuotedColumns(AbstractPlatform $platform) return $columns; } - /** - * @return string[] - */ + /** @return string[] */ public function getUnquotedColumns() { return array_map([$this, 'trimQuotes'], $this->getColumns()); @@ -136,17 +132,13 @@ public function isSimpleIndex() return ! $this->_isPrimary && ! $this->_isUnique; } - /** - * @return bool - */ + /** @return bool */ public function isUnique() { return $this->_isUnique; } - /** - * @return bool - */ + /** @return bool */ public function isPrimary() { return $this->_isPrimary; @@ -326,9 +318,7 @@ public function getOption($name) return $this->options[strtolower($name)]; } - /** - * @return mixed[] - */ + /** @return mixed[] */ public function getOptions() { return $this->options; diff --git a/src/Schema/MySQLSchemaManager.php b/src/Schema/MySQLSchemaManager.php index 7a1fb629659..28d6acf1c14 100644 --- a/src/Schema/MySQLSchemaManager.php +++ b/src/Schema/MySQLSchemaManager.php @@ -31,9 +31,7 @@ */ class MySQLSchemaManager extends AbstractSchemaManager { - /** - * @see https://mariadb.com/kb/en/library/string-literals/#escape-sequences - */ + /** @see https://mariadb.com/kb/en/library/string-literals/#escape-sequences */ private const MARIADB_ESCAPE_SEQUENCES = [ '\\0' => "\0", "\\'" => "'", @@ -551,9 +549,7 @@ protected function fetchTableOptionsByTable(string $databaseName, ?string $table return $tableOptions; } - /** - * @return string[]|true[] - */ + /** @return string[]|true[] */ private function parseCreateOptions(?string $string): array { $options = []; diff --git a/src/Schema/SQLServerSchemaManager.php b/src/Schema/SQLServerSchemaManager.php index 801d9286315..39d2de04b87 100644 --- a/src/Schema/SQLServerSchemaManager.php +++ b/src/Schema/SQLServerSchemaManager.php @@ -354,17 +354,13 @@ private function getColumnConstraints(string $table, string $column): iterable ); } - /** - * @throws Exception - */ + /** @throws Exception */ public function createComparator(): Comparator { return new SQLServer\Comparator($this->_platform, $this->getDatabaseCollation()); } - /** - * @throws Exception - */ + /** @throws Exception */ private function getDatabaseCollation(): string { if ($this->databaseCollation === null) { diff --git a/src/Schema/Schema.php b/src/Schema/Schema.php index c6ef2468c5c..3703cfbe278 100644 --- a/src/Schema/Schema.php +++ b/src/Schema/Schema.php @@ -191,9 +191,7 @@ public function getTable($name) return $this->_tables[$name]; } - /** - * @param string $name - */ + /** @param string $name */ private function getFullQualifiedAssetName($name): string { $name = $this->getUnquotedAssetName($name); @@ -301,9 +299,7 @@ public function getSequence($name) return $this->_sequences[$name]; } - /** - * @return Sequence[] - */ + /** @return Sequence[] */ public function getSequences() { return $this->_sequences; diff --git a/src/Schema/SchemaConfig.php b/src/Schema/SchemaConfig.php index 92e0701f075..75768b94877 100644 --- a/src/Schema/SchemaConfig.php +++ b/src/Schema/SchemaConfig.php @@ -69,9 +69,7 @@ public function setMaxIdentifierLength($length) $this->maxIdentifierLength = (int) $length; } - /** - * @return int - */ + /** @return int */ public function getMaxIdentifierLength() { return $this->maxIdentifierLength; diff --git a/src/Schema/SchemaDiff.php b/src/Schema/SchemaDiff.php index 020abaddf50..0fa3f5fa6bf 100644 --- a/src/Schema/SchemaDiff.php +++ b/src/Schema/SchemaDiff.php @@ -95,9 +95,7 @@ public function toSaveSql(AbstractPlatform $platform) return $this->_toSql($platform, true); } - /** - * @return string[] - */ + /** @return string[] */ public function toSql(AbstractPlatform $platform) { return $this->_toSql($platform, false); diff --git a/src/Schema/SchemaException.php b/src/Schema/SchemaException.php index d4e22380ef4..a849851913b 100644 --- a/src/Schema/SchemaException.php +++ b/src/Schema/SchemaException.php @@ -7,9 +7,7 @@ use function implode; use function sprintf; -/** - * @psalm-immutable - */ +/** @psalm-immutable */ class SchemaException extends Exception { public const TABLE_DOESNT_EXIST = 10; @@ -175,9 +173,7 @@ public static function foreignKeyDoesNotExist($fkName, $table) ); } - /** - * @return SchemaException - */ + /** @return SchemaException */ public static function namedForeignKeyRequired(Table $localTable, ForeignKeyConstraint $foreignKey) { return new self( diff --git a/src/Schema/Sequence.php b/src/Schema/Sequence.php index 0790d12d8cd..8f87238f64b 100644 --- a/src/Schema/Sequence.php +++ b/src/Schema/Sequence.php @@ -36,25 +36,19 @@ public function __construct($name, $allocationSize = 1, $initialValue = 1, $cach $this->cache = $cache; } - /** - * @return int - */ + /** @return int */ public function getAllocationSize() { return $this->allocationSize; } - /** - * @return int - */ + /** @return int */ public function getInitialValue() { return $this->initialValue; } - /** - * @return int|null - */ + /** @return int|null */ public function getCache() { return $this->cache; diff --git a/src/Schema/SqliteSchemaManager.php b/src/Schema/SqliteSchemaManager.php index be42c68343c..09d1e5c2046 100644 --- a/src/Schema/SqliteSchemaManager.php +++ b/src/Schema/SqliteSchemaManager.php @@ -561,9 +561,7 @@ private function parseColumnCommentFromSQL(string $column, string $sql): ?string return $comment === '' ? null : $comment; } - /** - * @throws Exception - */ + /** @throws Exception */ private function getCreateTableSQL(string $table): string { $sql = $this->_conn->fetchOne( diff --git a/src/Schema/Table.php b/src/Schema/Table.php index c4c4f6929eb..a5c379b488d 100644 --- a/src/Schema/Table.php +++ b/src/Schema/Table.php @@ -92,17 +92,13 @@ public function __construct( $this->_options = array_merge($this->_options, $options); } - /** - * @return void - */ + /** @return void */ public function setSchemaConfig(SchemaConfig $schemaConfig) { $this->_schemaConfig = $schemaConfig; } - /** - * @return int - */ + /** @return int */ protected function _getMaxIdentifierLength() { if ($this->_schemaConfig instanceof SchemaConfig) { @@ -508,9 +504,7 @@ protected function _addIndex(Index $indexCandidate) return $this; } - /** - * @return self - */ + /** @return self */ protected function _addUniqueConstraint(UniqueConstraint $constraint): Table { $mergedNames = array_merge([$this->getName()], $constraint->getColumns()); @@ -540,9 +534,7 @@ protected function _addUniqueConstraint(UniqueConstraint $constraint): Table return $this; } - /** - * @return self - */ + /** @return self */ protected function _addForeignKeyConstraint(ForeignKeyConstraint $constraint) { $constraint->setLocalTable($this); @@ -840,9 +832,7 @@ public function getIndex($name) return $this->_indexes[$name]; } - /** - * @return Index[] - */ + /** @return Index[] */ public function getIndexes() { return $this->_indexes; @@ -888,9 +878,7 @@ public function getOption($name) return $this->_options[$name]; } - /** - * @return mixed[] - */ + /** @return mixed[] */ public function getOptions() { return $this->_options; diff --git a/src/Schema/TableDiff.php b/src/Schema/TableDiff.php index 82c912f71b1..7f29ed8c28d 100644 --- a/src/Schema/TableDiff.php +++ b/src/Schema/TableDiff.php @@ -138,9 +138,7 @@ public function getName(AbstractPlatform $platform) ); } - /** - * @return Identifier|false - */ + /** @return Identifier|false */ public function getNewName() { if ($this->newName === false) { diff --git a/src/Schema/UniqueConstraint.php b/src/Schema/UniqueConstraint.php index ca9a3810fcb..85502e714b4 100644 --- a/src/Schema/UniqueConstraint.php +++ b/src/Schema/UniqueConstraint.php @@ -78,9 +78,7 @@ public function getQuotedColumns(AbstractPlatform $platform) return $columns; } - /** - * @return string[] - */ + /** @return string[] */ public function getUnquotedColumns(): array { return array_map([$this, 'trimQuotes'], $this->getColumns()); @@ -134,17 +132,13 @@ public function hasOption(string $name): bool return isset($this->options[strtolower($name)]); } - /** - * @return mixed - */ + /** @return mixed */ public function getOption(string $name) { return $this->options[strtolower($name)]; } - /** - * @return mixed[] - */ + /** @return mixed[] */ public function getOptions(): array { return $this->options; diff --git a/src/Schema/View.php b/src/Schema/View.php index ac8d6cb5cb4..b19f2ad1fdb 100644 --- a/src/Schema/View.php +++ b/src/Schema/View.php @@ -20,9 +20,7 @@ public function __construct($name, $sql) $this->sql = $sql; } - /** - * @return string - */ + /** @return string */ public function getSql() { return $this->sql; diff --git a/src/Schema/Visitor/CreateSchemaSqlCollector.php b/src/Schema/Visitor/CreateSchemaSqlCollector.php index 1646e169c88..6fd87699d8a 100644 --- a/src/Schema/Visitor/CreateSchemaSqlCollector.php +++ b/src/Schema/Visitor/CreateSchemaSqlCollector.php @@ -10,9 +10,7 @@ use function array_merge; -/** - * @deprecated Use {@link CreateSchemaObjectsSQLBuilder} instead. - */ +/** @deprecated Use {@link CreateSchemaObjectsSQLBuilder} instead. */ class CreateSchemaSqlCollector extends AbstractVisitor { /** @var string[] */ @@ -80,9 +78,7 @@ public function acceptSequence(Sequence $sequence) $this->createSequenceQueries[] = $this->platform->getCreateSequenceSQL($sequence); } - /** - * @return void - */ + /** @return void */ public function resetQueries() { $this->createNamespaceQueries = []; diff --git a/src/Schema/Visitor/DropSchemaSqlCollector.php b/src/Schema/Visitor/DropSchemaSqlCollector.php index bb0111347be..fe26178d823 100644 --- a/src/Schema/Visitor/DropSchemaSqlCollector.php +++ b/src/Schema/Visitor/DropSchemaSqlCollector.php @@ -65,17 +65,13 @@ public function acceptSequence(Sequence $sequence) $this->sequences->attach($sequence); } - /** - * @return void - */ + /** @return void */ public function clearQueries() { $this->initializeQueries(); } - /** - * @return string[] - */ + /** @return string[] */ public function getQueries() { $sql = []; diff --git a/src/Schema/Visitor/Visitor.php b/src/Schema/Visitor/Visitor.php index 6e530647b23..8b34864c10d 100644 --- a/src/Schema/Visitor/Visitor.php +++ b/src/Schema/Visitor/Visitor.php @@ -24,14 +24,10 @@ interface Visitor */ public function acceptSchema(Schema $schema); - /** - * @return void - */ + /** @return void */ public function acceptTable(Table $table); - /** - * @return void - */ + /** @return void */ public function acceptColumn(Table $table, Column $column); /** @@ -41,13 +37,9 @@ public function acceptColumn(Table $table, Column $column); */ public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint); - /** - * @return void - */ + /** @return void */ public function acceptIndex(Table $table, Index $index); - /** - * @return void - */ + /** @return void */ public function acceptSequence(Sequence $sequence); } diff --git a/src/Tools/Console/Command/ReservedWordsCommand.php b/src/Tools/Console/Command/ReservedWordsCommand.php index d14d1c80003..444d2d0163b 100644 --- a/src/Tools/Console/Command/ReservedWordsCommand.php +++ b/src/Tools/Console/Command/ReservedWordsCommand.php @@ -31,9 +31,7 @@ use function is_array; use function is_string; -/** - * @deprecated Use database documentation instead. - */ +/** @deprecated Use database documentation instead. */ class ReservedWordsCommand extends Command { /** @var array */ diff --git a/src/Tools/Console/Command/RunSqlCommand.php b/src/Tools/Console/Command/RunSqlCommand.php index f2db29cc9fe..4692d05bb48 100644 --- a/src/Tools/Console/Command/RunSqlCommand.php +++ b/src/Tools/Console/Command/RunSqlCommand.php @@ -103,9 +103,7 @@ private function getConnection(InputInterface $input): Connection return $this->connectionProvider->getDefaultConnection(); } - /** - * @throws Exception - */ + /** @throws Exception */ private function runQuery(SymfonyStyle $io, Connection $conn, string $sql): void { $resultSet = $conn->fetchAllAssociative($sql); @@ -118,9 +116,7 @@ private function runQuery(SymfonyStyle $io, Connection $conn, string $sql): void $io->table(array_keys($resultSet[0]), $resultSet); } - /** - * @throws Exception - */ + /** @throws Exception */ private function runStatement(SymfonyStyle $io, Connection $conn, string $sql): void { $io->success(sprintf('%d rows affected.', $conn->executeStatement($sql))); diff --git a/src/Tools/Console/ConnectionProvider.php b/src/Tools/Console/ConnectionProvider.php index 9919e481f65..b203692d945 100644 --- a/src/Tools/Console/ConnectionProvider.php +++ b/src/Tools/Console/ConnectionProvider.php @@ -8,8 +8,6 @@ interface ConnectionProvider { public function getDefaultConnection(): Connection; - /** - * @throws ConnectionNotFound in case a connection with the given name does not exist. - */ + /** @throws ConnectionNotFound in case a connection with the given name does not exist. */ public function getConnection(string $name): Connection; } diff --git a/src/Tools/Console/ConsoleRunner.php b/src/Tools/Console/ConsoleRunner.php index d16b0fd839b..e8fa3c60bd7 100644 --- a/src/Tools/Console/ConsoleRunner.php +++ b/src/Tools/Console/ConsoleRunner.php @@ -40,9 +40,7 @@ public static function run(ConnectionProvider $connectionProvider, $commands = [ $cli->run(); } - /** - * @return void - */ + /** @return void */ public static function addCommands(Application $cli, ConnectionProvider $connectionProvider) { $cli->addCommands([ diff --git a/src/TransactionIsolationLevel.php b/src/TransactionIsolationLevel.php index e8dc5d91814..9020343abec 100644 --- a/src/TransactionIsolationLevel.php +++ b/src/TransactionIsolationLevel.php @@ -26,9 +26,7 @@ final class TransactionIsolationLevel */ public const SERIALIZABLE = 4; - /** - * @codeCoverageIgnore - */ + /** @codeCoverageIgnore */ private function __construct() { } diff --git a/src/Types/Type.php b/src/Types/Type.php index f189574540f..a2bf20a8a05 100644 --- a/src/Types/Type.php +++ b/src/Types/Type.php @@ -50,9 +50,7 @@ abstract class Type private static ?TypeRegistry $typeRegistry = null; - /** - * @internal Do not instantiate directly - use {@see Type::addType()} method instead. - */ + /** @internal Do not instantiate directly - use {@see Type::addType()} method instead. */ final public function __construct() { } diff --git a/src/Types/TypeRegistry.php b/src/Types/TypeRegistry.php index 42954819278..b5e800ad1b4 100644 --- a/src/Types/TypeRegistry.php +++ b/src/Types/TypeRegistry.php @@ -18,9 +18,7 @@ final class TypeRegistry /** @var array Map of type names and their corresponding flyweight objects. */ private array $instances; - /** - * @param array $instances - */ + /** @param array $instances */ public function __construct(array $instances = []) { $this->instances = $instances; diff --git a/src/Types/Types.php b/src/Types/Types.php index 7b4f93d31a7..54b0dfecc8d 100644 --- a/src/Types/Types.php +++ b/src/Types/Types.php @@ -9,9 +9,7 @@ */ final class Types { - /** - * @deprecated Use {@link Types::JSON} instead. - */ + /** @deprecated Use {@link Types::JSON} instead. */ public const ARRAY = 'array'; public const ASCII_STRING = 'ascii_string'; @@ -32,9 +30,7 @@ final class Types public const INTEGER = 'integer'; public const JSON = 'json'; - /** - * @deprecated Use {@link Types::JSON} instead. - */ + /** @deprecated Use {@link Types::JSON} instead. */ public const OBJECT = 'object'; public const SIMPLE_ARRAY = 'simple_array'; @@ -44,9 +40,7 @@ final class Types public const TIME_MUTABLE = 'time'; public const TIME_IMMUTABLE = 'time_immutable'; - /** - * @codeCoverageIgnore - */ + /** @codeCoverageIgnore */ private function __construct() { } diff --git a/tests/Connection/CachedQueryTest.php b/tests/Connection/CachedQueryTest.php index a3ca56f30ae..d6ca4100398 100644 --- a/tests/Connection/CachedQueryTest.php +++ b/tests/Connection/CachedQueryTest.php @@ -47,9 +47,7 @@ public function testCachedQueryLegacyWrapped(): void self::assertCount(1, $cache->getItem(__FUNCTION__)->get()); } - /** - * @param CacheItemPoolInterface|Cache $cache - */ + /** @param CacheItemPoolInterface|Cache $cache */ private function assertCachedQueryIsExecutedOnceAndYieldsTheSameResult(object $cache, string $cacheKey): void { $data = [['foo' => 'bar']]; @@ -82,9 +80,7 @@ public function testCachedQueryWithChangedImplementationIsExecutedTwice(): void )->fetchAllAssociative()); } - /** - * @param list> $data - */ + /** @param list> $data */ private function createConnection(int $expectedQueryCount, array $data): Connection { $connection = $this->createMock(Driver\Connection::class); diff --git a/tests/Connection/ExpandArrayParametersTest.php b/tests/Connection/ExpandArrayParametersTest.php index cd0ca7190cf..784e8d96653 100644 --- a/tests/Connection/ExpandArrayParametersTest.php +++ b/tests/Connection/ExpandArrayParametersTest.php @@ -13,9 +13,7 @@ class ExpandArrayParametersTest extends TestCase { - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function dataExpandListParameters(): iterable { return [ @@ -338,9 +336,7 @@ public function testExpandListParameters( self::assertEquals($expectedTypes, $types, 'Types dont match'); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function missingNamedParameterProvider(): iterable { return [ @@ -392,9 +388,7 @@ public function testMissingPositionalParameter(string $query, array $params): vo $this->expandArrayParameters($query, $params, []); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function missingPositionalParameterProvider(): iterable { return [ diff --git a/tests/ConnectionTest.php b/tests/ConnectionTest.php index ba5fc74c07d..e5db55d44ac 100644 --- a/tests/ConnectionTest.php +++ b/tests/ConnectionTest.php @@ -29,9 +29,7 @@ use Psr\Cache\CacheItemPoolInterface; use stdClass; -/** - * @requires extension pdo_mysql - */ +/** @requires extension pdo_mysql */ class ConnectionTest extends TestCase { use VerifyDeprecations; @@ -52,9 +50,7 @@ protected function setUp(): void $this->connection = DriverManager::getConnection($this->params); } - /** - * @return Connection&MockObject - */ + /** @return Connection&MockObject */ private function getExecuteStatementMockConnection() { $driverMock = $this->createMock(Driver::class); @@ -294,9 +290,7 @@ public function testDriverExceptionIsWrapped(callable $callback): void $callback($connection, 'MUUHAAAAHAAAA'); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function getQueryMethods(): iterable { yield 'executeQuery' => [ @@ -375,9 +369,7 @@ public function testCommitStartsTransactionInNoAutoCommitMode(): void self::assertTrue($conn->isTransactionActive()); } - /** - * @dataProvider resultProvider - */ + /** @dataProvider resultProvider */ public function testCommitReturn(bool $expectedResult): void { $driverConnection = $this->createMock(DriverConnection::class); @@ -397,9 +389,7 @@ public function testCommitReturn(bool $expectedResult): void self::assertSame($expectedResult, $conn->commit()); } - /** - * @return bool[][] - */ + /** @return bool[][] */ public function resultProvider(): array { return [[true], [false]]; @@ -635,9 +625,7 @@ public function testFetch(string $method, callable $invoke, $expected): void self::assertSame($expected, $invoke($conn, $query, $params, $types)); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function fetchModeProvider(): iterable { yield 'numeric' => [ @@ -822,9 +810,7 @@ public function testShouldNotPassPlatformInParamsToTheQueryCacheProfileInExecute (new Connection($connectionParams, $driver))->executeCacheQuery($query, [], [], $queryCacheProfileMock); } - /** - * @psalm-suppress InvalidArgument - */ + /** @psalm-suppress InvalidArgument */ public function testThrowsExceptionWhenInValidPlatformSpecified(): void { $connectionParams = $this->params; diff --git a/tests/Driver/AbstractDB2DriverTest.php b/tests/Driver/AbstractDB2DriverTest.php index 6aac5adf57a..fa99227aa7c 100644 --- a/tests/Driver/AbstractDB2DriverTest.php +++ b/tests/Driver/AbstractDB2DriverTest.php @@ -12,9 +12,7 @@ use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\DB2SchemaManager; -/** - * @extends AbstractDriverTest - */ +/** @extends AbstractDriverTest */ class AbstractDB2DriverTest extends AbstractDriverTest { protected function createDriver(): Driver diff --git a/tests/Driver/AbstractDriverTest.php b/tests/Driver/AbstractDriverTest.php index 16b4f0813aa..4c673f9dbd5 100644 --- a/tests/Driver/AbstractDriverTest.php +++ b/tests/Driver/AbstractDriverTest.php @@ -16,9 +16,7 @@ use function get_class; use function sprintf; -/** - * @template P of AbstractPlatform - */ +/** @template P of AbstractPlatform */ abstract class AbstractDriverTest extends TestCase { /** @@ -127,17 +125,13 @@ abstract protected function createSchemaManager(Connection $connection): Abstrac abstract protected function createExceptionConverter(): ExceptionConverter; - /** - * @return Connection&MockObject - */ + /** @return Connection&MockObject */ protected function getConnectionMock(): Connection { return $this->createMock(Connection::class); } - /** - * @return array> - */ + /** @return array> */ protected function getDatabasePlatformsForVersions(): array { return []; diff --git a/tests/Driver/AbstractMySQLDriverTest.php b/tests/Driver/AbstractMySQLDriverTest.php index de68e910d4e..30bc0a28596 100644 --- a/tests/Driver/AbstractMySQLDriverTest.php +++ b/tests/Driver/AbstractMySQLDriverTest.php @@ -15,9 +15,7 @@ use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\MySQLSchemaManager; -/** - * @extends AbstractDriverTest - */ +/** @extends AbstractDriverTest */ class AbstractMySQLDriverTest extends AbstractDriverTest { protected function createDriver(): Driver diff --git a/tests/Driver/AbstractOracleDriver/EasyConnectStringTest.php b/tests/Driver/AbstractOracleDriver/EasyConnectStringTest.php index a43ad731fda..45fdd49183d 100644 --- a/tests/Driver/AbstractOracleDriver/EasyConnectStringTest.php +++ b/tests/Driver/AbstractOracleDriver/EasyConnectStringTest.php @@ -19,9 +19,7 @@ public function testFromConnectionParameters(array $params, string $expected): v self::assertSame($expected, (string) $string); } - /** - * @return mixed[] - */ + /** @return mixed[] */ public static function connectionParametersProvider(): iterable { return [ diff --git a/tests/Driver/AbstractOracleDriverTest.php b/tests/Driver/AbstractOracleDriverTest.php index 967a3a9471c..4c777f9eee5 100644 --- a/tests/Driver/AbstractOracleDriverTest.php +++ b/tests/Driver/AbstractOracleDriverTest.php @@ -12,9 +12,7 @@ use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\OracleSchemaManager; -/** - * @extends AbstractDriverTest - */ +/** @extends AbstractDriverTest */ class AbstractOracleDriverTest extends AbstractDriverTest { protected function createDriver(): Driver diff --git a/tests/Driver/AbstractPostgreSQLDriverTest.php b/tests/Driver/AbstractPostgreSQLDriverTest.php index cbf0f747061..18f0bc2057e 100644 --- a/tests/Driver/AbstractPostgreSQLDriverTest.php +++ b/tests/Driver/AbstractPostgreSQLDriverTest.php @@ -14,9 +14,7 @@ use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\PostgreSQLSchemaManager; -/** - * @extends AbstractDriverTest - */ +/** @extends AbstractDriverTest */ class AbstractPostgreSQLDriverTest extends AbstractDriverTest { protected function createDriver(): Driver diff --git a/tests/Driver/AbstractSQLServerDriverTest.php b/tests/Driver/AbstractSQLServerDriverTest.php index a5a41b436ec..c7218048ac2 100644 --- a/tests/Driver/AbstractSQLServerDriverTest.php +++ b/tests/Driver/AbstractSQLServerDriverTest.php @@ -12,9 +12,7 @@ use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\SQLServerSchemaManager; -/** - * @extends AbstractDriverTest - */ +/** @extends AbstractDriverTest */ abstract class AbstractSQLServerDriverTest extends AbstractDriverTest { protected function createPlatform(): AbstractPlatform diff --git a/tests/Driver/AbstractSQLiteDriverTest.php b/tests/Driver/AbstractSQLiteDriverTest.php index fe7ee279406..faf2d2c2ef3 100644 --- a/tests/Driver/AbstractSQLiteDriverTest.php +++ b/tests/Driver/AbstractSQLiteDriverTest.php @@ -12,9 +12,7 @@ use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\SqliteSchemaManager; -/** - * @extends AbstractDriverTest - */ +/** @extends AbstractDriverTest */ class AbstractSQLiteDriverTest extends AbstractDriverTest { protected function createDriver(): Driver diff --git a/tests/Driver/IBMDB2/DataSourceNameTest.php b/tests/Driver/IBMDB2/DataSourceNameTest.php index aad029a435d..0216b65825b 100644 --- a/tests/Driver/IBMDB2/DataSourceNameTest.php +++ b/tests/Driver/IBMDB2/DataSourceNameTest.php @@ -19,9 +19,7 @@ public function testFromConnectionParameters(array $params, string $expected): v $this->assertSame($expected, $dsn->toString()); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function connectionParametersProvider(): iterable { yield 'empty-params' => [[], '']; diff --git a/tests/Driver/Middleware/AbstractConnectionMiddlewareTest.php b/tests/Driver/Middleware/AbstractConnectionMiddlewareTest.php index 80e1e34a777..50dac1ae88b 100644 --- a/tests/Driver/Middleware/AbstractConnectionMiddlewareTest.php +++ b/tests/Driver/Middleware/AbstractConnectionMiddlewareTest.php @@ -99,8 +99,6 @@ private function createMiddleware(Connection $connection): AbstractConnectionMid interface NativeDriverConnection extends ServerInfoAwareConnection { - /** - * @return object|resource - */ + /** @return object|resource */ public function getNativeConnection(); } diff --git a/tests/Driver/Mysqli/ConnectionTest.php b/tests/Driver/Mysqli/ConnectionTest.php index 9c682f006fd..e05b163da88 100644 --- a/tests/Driver/Mysqli/ConnectionTest.php +++ b/tests/Driver/Mysqli/ConnectionTest.php @@ -6,9 +6,7 @@ use Doctrine\DBAL\Driver\Mysqli\Exception\HostRequired; use Doctrine\DBAL\Tests\FunctionalTestCase; -/** - * @requires extension mysqli - */ +/** @requires extension mysqli */ class ConnectionTest extends FunctionalTestCase { public function testHostnameIsRequiredForPersistentConnection(): void diff --git a/tests/Driver/OCI8/ConvertPositionalToNamedPlaceholdersTest.php b/tests/Driver/OCI8/ConvertPositionalToNamedPlaceholdersTest.php index d3779a6419a..b26bdab6aa5 100644 --- a/tests/Driver/OCI8/ConvertPositionalToNamedPlaceholdersTest.php +++ b/tests/Driver/OCI8/ConvertPositionalToNamedPlaceholdersTest.php @@ -29,9 +29,7 @@ public function testConvertPositionalToNamedParameters( self::assertEquals($expectedOutputParamsMap, $visitor->getParameterMap()); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function positionalToNamedPlaceholdersProvider(): iterable { return [ diff --git a/tests/Driver/PDO/ExceptionTest.php b/tests/Driver/PDO/ExceptionTest.php index 98379cd598b..13b025c5650 100644 --- a/tests/Driver/PDO/ExceptionTest.php +++ b/tests/Driver/PDO/ExceptionTest.php @@ -6,9 +6,7 @@ use PDOException; use PHPUnit\Framework\TestCase; -/** - * @requires extension pdo - */ +/** @requires extension pdo */ class ExceptionTest extends TestCase { public const ERROR_CODE = 666; diff --git a/tests/Driver/PDO/PgSQL/DriverTest.php b/tests/Driver/PDO/PgSQL/DriverTest.php index 2dfb3fa1609..542707130c9 100644 --- a/tests/Driver/PDO/PgSQL/DriverTest.php +++ b/tests/Driver/PDO/PgSQL/DriverTest.php @@ -63,9 +63,7 @@ protected function createDriver(): DriverInterface return new Driver(); } - /** - * @param array $driverOptions - */ + /** @param array $driverOptions */ private function connect(array $driverOptions): Connection { return $this->createDriver()->connect( diff --git a/tests/DriverManagerTest.php b/tests/DriverManagerTest.php index cc7f4719e29..f876860e76f 100644 --- a/tests/DriverManagerTest.php +++ b/tests/DriverManagerTest.php @@ -28,9 +28,7 @@ public function testCheckParams(): void DriverManager::getConnection([]); } - /** - * @psalm-suppress InvalidArgument - */ + /** @psalm-suppress InvalidArgument */ public function testInvalidDriver(): void { $this->expectException(Exception::class); @@ -38,9 +36,7 @@ public function testInvalidDriver(): void DriverManager::getConnection(['driver' => 'invalid_driver']); } - /** - * @requires extension pdo_sqlite - */ + /** @requires extension pdo_sqlite */ public function testCustomPlatform(): void { $platform = $this->createMock(AbstractPlatform::class); @@ -53,9 +49,7 @@ public function testCustomPlatform(): void self::assertSame($platform, $conn->getDatabasePlatform()); } - /** - * @requires extension pdo_sqlite - */ + /** @requires extension pdo_sqlite */ public function testCustomWrapper(): void { $wrapper = $this->createMock(Connection::class); @@ -86,9 +80,7 @@ public function testInvalidWrapperClass(): void DriverManager::getConnection($options); } - /** - * @psalm-suppress InvalidArgument - */ + /** @psalm-suppress InvalidArgument */ public function testInvalidDriverClass(): void { $this->expectException(Exception::class); @@ -175,9 +167,7 @@ public function testDatabaseUrl($url, $expected): void } } - /** - * @return array> - */ + /** @return array> */ public function databaseUrls(): iterable { $driver = $this->createMock(Driver::class); diff --git a/tests/Events/OracleSessionInitTest.php b/tests/Events/OracleSessionInitTest.php index 1ba297d84f8..519a9a8e0a6 100644 --- a/tests/Events/OracleSessionInitTest.php +++ b/tests/Events/OracleSessionInitTest.php @@ -25,9 +25,7 @@ public function testPostConnect(): void $listener->postConnect($eventArgs); } - /** - * @dataProvider getPostConnectWithSessionParameterValuesData - */ + /** @dataProvider getPostConnectWithSessionParameterValuesData */ public function testPostConnectQuotesSessionParameterValues(string $name, string $value): void { $connectionMock = $this->getMockBuilder(Connection::class) @@ -43,9 +41,7 @@ public function testPostConnectQuotesSessionParameterValues(string $name, string $listener->postConnect($eventArgs); } - /** - * @return array> - */ + /** @return array> */ public static function getPostConnectWithSessionParameterValuesData(): iterable { return [ diff --git a/tests/Functional/BlobTest.php b/tests/Functional/BlobTest.php index 51744c413ef..52359bc0734 100644 --- a/tests/Functional/BlobTest.php +++ b/tests/Functional/BlobTest.php @@ -179,9 +179,7 @@ private function assertBlobContains(string $text): void self::assertEquals($text, stream_get_contents($blobValue)); } - /** - * @return list - */ + /** @return list */ private function fetchRow(): array { $rows = $this->connection->fetchAllNumeric('SELECT clobcolumn, blobcolumn FROM blob_table'); diff --git a/tests/Functional/DataAccessTest.php b/tests/Functional/DataAccessTest.php index e6002081362..27c4f6ad685 100644 --- a/tests/Functional/DataAccessTest.php +++ b/tests/Functional/DataAccessTest.php @@ -338,9 +338,7 @@ public function testTrimExpression(string $value, int $position, $char, string $ self::assertEquals($expectedResult, $row['trimmed']); } - /** - * @return array> - */ + /** @return array> */ public static function getTrimExpressionData(): iterable { return [ diff --git a/tests/Functional/Driver/IBMDB2/DriverTest.php b/tests/Functional/Driver/IBMDB2/DriverTest.php index ae97171491a..cab75b31729 100644 --- a/tests/Functional/Driver/IBMDB2/DriverTest.php +++ b/tests/Functional/Driver/IBMDB2/DriverTest.php @@ -7,9 +7,7 @@ use Doctrine\DBAL\Tests\Functional\Driver\AbstractDriverTest; use Doctrine\DBAL\Tests\TestUtil; -/** - * @requires extension ibm_db2 - */ +/** @requires extension ibm_db2 */ class DriverTest extends AbstractDriverTest { protected function setUp(): void diff --git a/tests/Functional/Driver/IBMDB2/StatementTest.php b/tests/Functional/Driver/IBMDB2/StatementTest.php index 6b00d72b7cb..95b0ccdcf57 100644 --- a/tests/Functional/Driver/IBMDB2/StatementTest.php +++ b/tests/Functional/Driver/IBMDB2/StatementTest.php @@ -12,9 +12,7 @@ use const E_NOTICE; use const E_WARNING; -/** - * @require extension ibm_db2 - */ +/** @require extension ibm_db2 */ class StatementTest extends FunctionalTestCase { protected function setUp(): void diff --git a/tests/Functional/Driver/Mysqli/ConnectionTest.php b/tests/Functional/Driver/Mysqli/ConnectionTest.php index 9c434d94fda..8f7b5acdb62 100644 --- a/tests/Functional/Driver/Mysqli/ConnectionTest.php +++ b/tests/Functional/Driver/Mysqli/ConnectionTest.php @@ -12,9 +12,7 @@ use const MYSQLI_OPT_CONNECT_TIMEOUT; -/** - * @require extension mysqli - */ +/** @require extension mysqli */ class ConnectionTest extends FunctionalTestCase { protected function setUp(): void @@ -52,9 +50,7 @@ public function testInvalidCharset(): void ); } - /** - * @param mixed[] $driverOptions - */ + /** @param mixed[] $driverOptions */ private function getConnection(array $driverOptions): Connection { $params = TestUtil::getConnectionParams(); diff --git a/tests/Functional/Driver/Mysqli/DriverTest.php b/tests/Functional/Driver/Mysqli/DriverTest.php index 58990520f6d..174a12d8628 100644 --- a/tests/Functional/Driver/Mysqli/DriverTest.php +++ b/tests/Functional/Driver/Mysqli/DriverTest.php @@ -7,9 +7,7 @@ use Doctrine\DBAL\Tests\Functional\Driver\AbstractDriverTest; use Doctrine\DBAL\Tests\TestUtil; -/** - * @requires extension mysqli - */ +/** @requires extension mysqli */ class DriverTest extends AbstractDriverTest { protected function setUp(): void diff --git a/tests/Functional/Driver/OCI8/ConnectionTest.php b/tests/Functional/Driver/OCI8/ConnectionTest.php index 4276f8d704b..e6aaf561620 100644 --- a/tests/Functional/Driver/OCI8/ConnectionTest.php +++ b/tests/Functional/Driver/OCI8/ConnectionTest.php @@ -6,9 +6,7 @@ use Doctrine\DBAL\Tests\FunctionalTestCase; use Doctrine\DBAL\Tests\TestUtil; -/** - * @requires extension oci8 - */ +/** @requires extension oci8 */ class ConnectionTest extends FunctionalTestCase { protected function setUp(): void diff --git a/tests/Functional/Driver/OCI8/DriverTest.php b/tests/Functional/Driver/OCI8/DriverTest.php index 82cda7950ee..e8ff5e23edb 100644 --- a/tests/Functional/Driver/OCI8/DriverTest.php +++ b/tests/Functional/Driver/OCI8/DriverTest.php @@ -7,9 +7,7 @@ use Doctrine\DBAL\Tests\Functional\Driver\AbstractDriverTest; use Doctrine\DBAL\Tests\TestUtil; -/** - * @requires extension oci8 - */ +/** @requires extension oci8 */ class DriverTest extends AbstractDriverTest { protected function setUp(): void diff --git a/tests/Functional/Driver/OCI8/ResultTest.php b/tests/Functional/Driver/OCI8/ResultTest.php index 5811b0f902d..c254707b582 100644 --- a/tests/Functional/Driver/OCI8/ResultTest.php +++ b/tests/Functional/Driver/OCI8/ResultTest.php @@ -15,9 +15,7 @@ use const E_ALL; use const E_WARNING; -/** - * @requires extension oci8 - */ +/** @requires extension oci8 */ class ResultTest extends FunctionalTestCase { /** diff --git a/tests/Functional/Driver/OCI8/StatementTest.php b/tests/Functional/Driver/OCI8/StatementTest.php index 44eed36a92d..815a0749ae2 100644 --- a/tests/Functional/Driver/OCI8/StatementTest.php +++ b/tests/Functional/Driver/OCI8/StatementTest.php @@ -5,9 +5,7 @@ use Doctrine\DBAL\Tests\FunctionalTestCase; use Doctrine\DBAL\Tests\TestUtil; -/** - * @requires extension oci8 - */ +/** @requires extension oci8 */ class StatementTest extends FunctionalTestCase { protected function setUp(): void @@ -51,9 +49,7 @@ public function testStatementBindParameters(string $query, array $params, array ); } - /** - * @return array> - */ + /** @return array> */ public static function queryConversionProvider(): iterable { return [ diff --git a/tests/Functional/Driver/PDO/MySQL/DriverTest.php b/tests/Functional/Driver/PDO/MySQL/DriverTest.php index e50328485e1..7cb2ed52d1c 100644 --- a/tests/Functional/Driver/PDO/MySQL/DriverTest.php +++ b/tests/Functional/Driver/PDO/MySQL/DriverTest.php @@ -7,9 +7,7 @@ use Doctrine\DBAL\Tests\Functional\Driver\AbstractDriverTest; use Doctrine\DBAL\Tests\TestUtil; -/** - * @requires extension pdo_mysql - */ +/** @requires extension pdo_mysql */ class DriverTest extends AbstractDriverTest { protected function setUp(): void diff --git a/tests/Functional/Driver/PDO/OCI/DriverTest.php b/tests/Functional/Driver/PDO/OCI/DriverTest.php index d3ba5f25e35..00e2c148a63 100644 --- a/tests/Functional/Driver/PDO/OCI/DriverTest.php +++ b/tests/Functional/Driver/PDO/OCI/DriverTest.php @@ -7,9 +7,7 @@ use Doctrine\DBAL\Tests\Functional\Driver\AbstractDriverTest; use Doctrine\DBAL\Tests\TestUtil; -/** - * @requires extension pdo_oci - */ +/** @requires extension pdo_oci */ class DriverTest extends AbstractDriverTest { protected function setUp(): void diff --git a/tests/Functional/Driver/PDO/PgSQL/ConnectionTest.php b/tests/Functional/Driver/PDO/PgSQL/ConnectionTest.php index 8f56ff4e1a6..8456d3868f0 100644 --- a/tests/Functional/Driver/PDO/PgSQL/ConnectionTest.php +++ b/tests/Functional/Driver/PDO/PgSQL/ConnectionTest.php @@ -6,9 +6,7 @@ use Doctrine\DBAL\Tests\FunctionalTestCase; use Doctrine\DBAL\Tests\TestUtil; -/** - * @requires extension pdo_pgsql - */ +/** @requires extension pdo_pgsql */ class ConnectionTest extends FunctionalTestCase { protected function setUp(): void @@ -20,9 +18,7 @@ protected function setUp(): void self::markTestSkipped('This test requires the pdo_pgsql driver.'); } - /** - * @dataProvider getValidCharsets - */ + /** @dataProvider getValidCharsets */ public function testConnectsWithValidCharsetOption(string $charset): void { $params = $this->connection->getParams(); @@ -40,9 +36,7 @@ public function testConnectsWithValidCharsetOption(string $charset): void ); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getValidCharsets(): iterable { return [ diff --git a/tests/Functional/Driver/PDO/PgSQL/DriverTest.php b/tests/Functional/Driver/PDO/PgSQL/DriverTest.php index 531c0e097c7..5777dee1ce4 100644 --- a/tests/Functional/Driver/PDO/PgSQL/DriverTest.php +++ b/tests/Functional/Driver/PDO/PgSQL/DriverTest.php @@ -12,9 +12,7 @@ use function microtime; use function sprintf; -/** - * @requires extension pdo_pgsql - */ +/** @requires extension pdo_pgsql */ class DriverTest extends AbstractDriverTest { protected function setUp(): void @@ -28,9 +26,7 @@ protected function setUp(): void self::markTestSkipped('This test requires the pdo_pgsql driver.'); } - /** - * @dataProvider getDatabaseParameter - */ + /** @dataProvider getDatabaseParameter */ public function testDatabaseParameters( ?string $databaseName, ?string $defaultDatabaseName, @@ -61,9 +57,7 @@ public function testDatabaseParameters( ); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getDatabaseParameter(): iterable { $params = TestUtil::getConnectionParams(); diff --git a/tests/Functional/Driver/PDO/SQLSrv/DriverTest.php b/tests/Functional/Driver/PDO/SQLSrv/DriverTest.php index 3736f99808b..8087e43ea27 100644 --- a/tests/Functional/Driver/PDO/SQLSrv/DriverTest.php +++ b/tests/Functional/Driver/PDO/SQLSrv/DriverTest.php @@ -11,9 +11,7 @@ use function array_merge; -/** - * @requires extension pdo_sqlsrv - */ +/** @requires extension pdo_sqlsrv */ class DriverTest extends AbstractDriverTest { protected function setUp(): void @@ -37,9 +35,7 @@ protected static function getDatabaseNameForConnectionWithoutDatabaseNameParamet return 'master'; } - /** - * @param int[]|string[] $driverOptions - */ + /** @param int[]|string[] $driverOptions */ private function getConnection(array $driverOptions): Connection { $params = TestUtil::getConnectionParams(); diff --git a/tests/Functional/Driver/PDO/SQLite/DriverTest.php b/tests/Functional/Driver/PDO/SQLite/DriverTest.php index 0868bf9bf54..38f1395ba4c 100644 --- a/tests/Functional/Driver/PDO/SQLite/DriverTest.php +++ b/tests/Functional/Driver/PDO/SQLite/DriverTest.php @@ -7,9 +7,7 @@ use Doctrine\DBAL\Tests\Functional\Driver\AbstractDriverTest; use Doctrine\DBAL\Tests\TestUtil; -/** - * @requires extension pdo_sqlite - */ +/** @requires extension pdo_sqlite */ class DriverTest extends AbstractDriverTest { protected function setUp(): void diff --git a/tests/Functional/Driver/SQLSrv/DriverTest.php b/tests/Functional/Driver/SQLSrv/DriverTest.php index c6c98491008..54bf07fb437 100644 --- a/tests/Functional/Driver/SQLSrv/DriverTest.php +++ b/tests/Functional/Driver/SQLSrv/DriverTest.php @@ -7,9 +7,7 @@ use Doctrine\DBAL\Tests\Functional\Driver\AbstractDriverTest; use Doctrine\DBAL\Tests\TestUtil; -/** - * @requires extension sqlsrv - */ +/** @requires extension sqlsrv */ class DriverTest extends AbstractDriverTest { protected function setUp(): void diff --git a/tests/Functional/Driver/SQLSrv/StatementTest.php b/tests/Functional/Driver/SQLSrv/StatementTest.php index a99066c7d3a..c457b694f5a 100644 --- a/tests/Functional/Driver/SQLSrv/StatementTest.php +++ b/tests/Functional/Driver/SQLSrv/StatementTest.php @@ -6,9 +6,7 @@ use Doctrine\DBAL\Tests\FunctionalTestCase; use Doctrine\DBAL\Tests\TestUtil; -/** - * @requires extension sqlsrv - */ +/** @requires extension sqlsrv */ class StatementTest extends FunctionalTestCase { protected function setUp(): void diff --git a/tests/Functional/ExceptionTest.php b/tests/Functional/ExceptionTest.php index 4cc911f1a32..3ef3e1b24df 100644 --- a/tests/Functional/ExceptionTest.php +++ b/tests/Functional/ExceptionTest.php @@ -26,9 +26,7 @@ use const E_WARNING; use const PHP_OS_FAMILY; -/** - * @psalm-import-type Params from DriverManager - */ +/** @psalm-import-type Params from DriverManager */ class ExceptionTest extends FunctionalTestCase { public function testPrimaryConstraintViolationException(): void @@ -341,9 +339,7 @@ private function testConnectionException(array $params): void $conn->connect(); } - /** - * @return array> - */ + /** @return array> */ public static function getConnectionParams(): iterable { return [ diff --git a/tests/Functional/FetchBooleanTest.php b/tests/Functional/FetchBooleanTest.php index dd5e7d3cf83..87f0e956790 100644 --- a/tests/Functional/FetchBooleanTest.php +++ b/tests/Functional/FetchBooleanTest.php @@ -18,9 +18,7 @@ protected function setUp(): void self::markTestSkipped('Only PostgreSQL supports boolean values natively'); } - /** - * @dataProvider booleanLiteralProvider - */ + /** @dataProvider booleanLiteralProvider */ public function testBooleanConversionSqlLiteral(string $literal, bool $expected): void { self::assertSame([$expected], $this->connection->fetchNumeric( @@ -29,9 +27,7 @@ public function testBooleanConversionSqlLiteral(string $literal, bool $expected) )); } - /** - * @return iterable - */ + /** @return iterable */ public function booleanLiteralProvider(): iterable { yield ['true', true]; diff --git a/tests/Functional/ModifyLimitQueryTest.php b/tests/Functional/ModifyLimitQueryTest.php index 6ccf663e079..99e60958e9e 100644 --- a/tests/Functional/ModifyLimitQueryTest.php +++ b/tests/Functional/ModifyLimitQueryTest.php @@ -160,9 +160,7 @@ public function testModifyLimitQueryZeroOffsetNoLimit(): void $this->assertLimitResult([1, 2], $sql, null, 0); } - /** - * @param array $expectedResults - */ + /** @param array $expectedResults */ private function assertLimitResult( array $expectedResults, string $sql, diff --git a/tests/Functional/NamedParametersTest.php b/tests/Functional/NamedParametersTest.php index 8653bca5075..e43498fd90a 100644 --- a/tests/Functional/NamedParametersTest.php +++ b/tests/Functional/NamedParametersTest.php @@ -14,9 +14,7 @@ class NamedParametersTest extends FunctionalTestCase { - /** - * @return iterable> - */ + /** @return iterable> */ public static function ticketProvider(): iterable { return [ diff --git a/tests/Functional/Platform/ConcatExpressionTest.php b/tests/Functional/Platform/ConcatExpressionTest.php index 87f158bebfb..33f47038a86 100644 --- a/tests/Functional/Platform/ConcatExpressionTest.php +++ b/tests/Functional/Platform/ConcatExpressionTest.php @@ -21,9 +21,7 @@ public function testConcatExpression(array $arguments, string $expected): void self::assertEquals($expected, $this->connection->fetchOne($query)); } - /** - * @return iterable,string}> - */ + /** @return iterable,string}> */ public static function expressionProvider(): iterable { yield 'strings' => [["'foo'", "'bar'"], 'foobar']; diff --git a/tests/Functional/Platform/DateExpressionTest.php b/tests/Functional/Platform/DateExpressionTest.php index be40fde3dcf..60e9b32997a 100644 --- a/tests/Functional/Platform/DateExpressionTest.php +++ b/tests/Functional/Platform/DateExpressionTest.php @@ -10,9 +10,7 @@ class DateExpressionTest extends FunctionalTestCase { - /** - * @dataProvider differenceProvider - */ + /** @dataProvider differenceProvider */ public function testDifference(string $date1, string $date2, int $expected): void { $table = new Table('date_expr_test'); @@ -32,9 +30,7 @@ public function testDifference(string $date1, string $date2, int $expected): voi self::assertEquals($expected, $diff); } - /** - * @return string[][]|int[][] - */ + /** @return string[][]|int[][] */ public static function differenceProvider(): iterable { $date1 = new DateTimeImmutable(); diff --git a/tests/Functional/Platform/LengthExpressionTest.php b/tests/Functional/Platform/LengthExpressionTest.php index 36c53d450ec..1c15f5a1e8b 100644 --- a/tests/Functional/Platform/LengthExpressionTest.php +++ b/tests/Functional/Platform/LengthExpressionTest.php @@ -32,9 +32,7 @@ public function testLengthExpression(string $value, int $expected, bool $isMulti self::assertEquals($expected, $this->connection->fetchOne($query, [$value])); } - /** - * @return iterable - */ + /** @return iterable */ public static function expressionProvider(): iterable { yield '1-byte' => ['Hello, world!', 13, false]; diff --git a/tests/Functional/Platform/QuotingTest.php b/tests/Functional/Platform/QuotingTest.php index b5de6062eed..06fceeaa3f5 100644 --- a/tests/Functional/Platform/QuotingTest.php +++ b/tests/Functional/Platform/QuotingTest.php @@ -9,9 +9,7 @@ class QuotingTest extends FunctionalTestCase { - /** - * @dataProvider stringLiteralProvider - */ + /** @dataProvider stringLiteralProvider */ public function testQuoteStringLiteral(string $string): void { $platform = $this->connection->getDatabasePlatform(); @@ -22,9 +20,7 @@ public function testQuoteStringLiteral(string $string): void self::assertSame($string, $this->connection->fetchOne($query)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function stringLiteralProvider(): iterable { return [ @@ -33,16 +29,12 @@ public static function stringLiteralProvider(): iterable ]; } - /** - * @dataProvider identifierProvider - */ + /** @dataProvider identifierProvider */ public function testQuoteIdentifier(string $identifier): void { $platform = $this->connection->getDatabasePlatform(); - /** - * @link https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements008.htm - */ + /** @link https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements008.htm */ if ($platform instanceof OraclePlatform && $identifier === '"') { self::markTestSkipped('Oracle does not support double quotes in identifiers'); } @@ -57,9 +49,7 @@ public function testQuoteIdentifier(string $identifier): void self::assertSame($identifier, key($row)); } - /** - * @return iterable - */ + /** @return iterable */ public static function identifierProvider(): iterable { return [ diff --git a/tests/Functional/Platform/RenameColumnTest.php b/tests/Functional/Platform/RenameColumnTest.php index 8b7f23723b3..9fdff201d8a 100644 --- a/tests/Functional/Platform/RenameColumnTest.php +++ b/tests/Functional/Platform/RenameColumnTest.php @@ -11,9 +11,7 @@ class RenameColumnTest extends FunctionalTestCase { - /** - * @dataProvider columnNameProvider - */ + /** @dataProvider columnNameProvider */ public function testColumnPositionRetainedAfterRenaming(string $columnName, string $newColumnName): void { $table = new Table('test_rename'); @@ -36,9 +34,7 @@ public function testColumnPositionRetainedAfterRenaming(string $columnName, stri self::assertSame([strtolower($newColumnName), 'c2'], array_keys($table->getColumns())); } - /** - * @return iterable - */ + /** @return iterable */ public static function columnNameProvider(): iterable { yield ['c1', 'c1_x']; diff --git a/tests/Functional/PortabilityTest.php b/tests/Functional/PortabilityTest.php index 18b98f17058..941856bc074 100644 --- a/tests/Functional/PortabilityTest.php +++ b/tests/Functional/PortabilityTest.php @@ -61,18 +61,14 @@ public function testCaseConversion(int $case, array $expected): void self::assertSame($expected, array_keys($row)); } - /** - * @return iterable}> - */ + /** @return iterable}> */ public static function caseProvider(): iterable { yield 'lower' => [ColumnCase::LOWER, ['test_int', 'test_string', 'test_null']]; yield 'upper' => [ColumnCase::UPPER, ['TEST_INT', 'TEST_STRING', 'TEST_NULL']]; } - /** - * @param array> $rows - */ + /** @param array> $rows */ private function assertFetchResultRows(array $rows): void { self::assertCount(2, $rows); @@ -81,9 +77,7 @@ private function assertFetchResultRows(array $rows): void } } - /** - * @param array $row - */ + /** @param array $row */ public function assertFetchResultRow(array $row): void { self::assertThat($row['test_int'], self::logicalOr( @@ -112,9 +106,7 @@ public function testFetchColumn(string $column, array $expected): void self::assertEquals($expected, $result->fetchFirstColumn()); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function fetchColumnProvider(): iterable { return [ diff --git a/tests/Functional/PrimaryReadReplicaConnectionTest.php b/tests/Functional/PrimaryReadReplicaConnectionTest.php index 99c9a248e05..27026fc6911 100644 --- a/tests/Functional/PrimaryReadReplicaConnectionTest.php +++ b/tests/Functional/PrimaryReadReplicaConnectionTest.php @@ -13,9 +13,7 @@ use const CASE_LOWER; -/** - * @psalm-import-type Params from DriverManager - */ +/** @psalm-import-type Params from DriverManager */ class PrimaryReadReplicaConnectionTest extends FunctionalTestCase { protected function setUp(): void diff --git a/tests/Functional/ResultTest.php b/tests/Functional/ResultTest.php index 7b252997c75..8ebc6fdb323 100644 --- a/tests/Functional/ResultTest.php +++ b/tests/Functional/ResultTest.php @@ -9,9 +9,7 @@ class ResultTest extends FunctionalTestCase { - /** - * @dataProvider methodProvider - */ + /** @dataProvider methodProvider */ public function testExceptionHandling(callable $method): void { if (! TestUtil::isDriverOneOf('mysqli', 'ibm_db2')) { @@ -28,9 +26,7 @@ public function testExceptionHandling(callable $method): void $method($result); } - /** - * @return iterable - */ + /** @return iterable */ public static function methodProvider(): iterable { yield 'fetchNumeric' => [ diff --git a/tests/Functional/Schema/ComparatorTest.php b/tests/Functional/Schema/ComparatorTest.php index 47edd96da45..dc994859a72 100644 --- a/tests/Functional/Schema/ComparatorTest.php +++ b/tests/Functional/Schema/ComparatorTest.php @@ -52,9 +52,7 @@ public function testDefaultValueComparison(callable $comparatorFactory, string $ self::assertFalse($comparatorFactory($this->schemaManager)->diffTable($table, $onlineTable)); } - /** - * @return iterable - */ + /** @return iterable */ public static function defaultValueProvider(): iterable { foreach (ComparatorTestUtils::comparatorProvider() as $comparatorType => $comparatorArguments) { diff --git a/tests/Functional/Schema/ComparatorTestUtils.php b/tests/Functional/Schema/ComparatorTestUtils.php index 9d05573383d..963555629b2 100644 --- a/tests/Functional/Schema/ComparatorTestUtils.php +++ b/tests/Functional/Schema/ComparatorTestUtils.php @@ -58,9 +58,7 @@ public static function assertDiffNotEmpty(Connection $connection, Comparator $co TestCase::assertFalse(self::diffFromDesiredToActualTable($schemaManager, $comparator, $table)); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function comparatorProvider(): iterable { yield 'Generic comparator' => [ diff --git a/tests/Functional/Schema/MySQL/ComparatorTest.php b/tests/Functional/Schema/MySQL/ComparatorTest.php index 0850bbde3da..bb360ca600e 100644 --- a/tests/Functional/Schema/MySQL/ComparatorTest.php +++ b/tests/Functional/Schema/MySQL/ComparatorTest.php @@ -33,9 +33,7 @@ protected function setUp(): void $this->comparator = $this->schemaManager->createComparator(); } - /** - * @dataProvider lobColumnProvider - */ + /** @dataProvider lobColumnProvider */ public function testLobLengthIncrementWithinLimit(string $type, int $length): void { $table = $this->createLobTable($type, $length - 1); @@ -54,9 +52,7 @@ public function testLobLengthIncrementWithinLimit(string $type, int $length): vo )); } - /** - * @dataProvider lobColumnProvider - */ + /** @dataProvider lobColumnProvider */ public function testLobLengthIncrementOverLimit(string $type, int $length): void { $table = $this->createLobTable($type, $length); @@ -64,9 +60,7 @@ public function testLobLengthIncrementOverLimit(string $type, int $length): void ComparatorTestUtils::assertDiffNotEmpty($this->connection, $this->comparator, $table); } - /** - * @return iterable - */ + /** @return iterable */ public static function lobColumnProvider(): iterable { yield [Types::BLOB, AbstractMySQLPlatform::LENGTH_LIMIT_TINYBLOB]; @@ -78,9 +72,7 @@ public static function lobColumnProvider(): iterable yield [Types::TEXT, AbstractMySQLPlatform::LENGTH_LIMIT_MEDIUMTEXT]; } - /** - * @throws Exception - */ + /** @throws Exception */ private function createLobTable(string $type, int $length): Table { $table = new Table('comparator_test'); @@ -91,9 +83,7 @@ private function createLobTable(string $type, int $length): Table return $table; } - /** - * @throws Exception - */ + /** @throws Exception */ private function increaseLobLength(Table $table): void { $column = $table->getColumn('lob'); diff --git a/tests/Functional/Schema/PostgreSQLSchemaManagerTest.php b/tests/Functional/Schema/PostgreSQLSchemaManagerTest.php index 0f3c37f5363..eff4c19d3a3 100644 --- a/tests/Functional/Schema/PostgreSQLSchemaManagerTest.php +++ b/tests/Functional/Schema/PostgreSQLSchemaManagerTest.php @@ -460,9 +460,7 @@ public function testListNegativeColumnDefaultValue(): void self::assertEquals('(-1)', $columns['col_string']->getDefault()); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function serialTypes(): iterable { return [ @@ -471,9 +469,7 @@ public static function serialTypes(): iterable ]; } - /** - * @dataProvider serialTypes - */ + /** @dataProvider serialTypes */ public function testAutoIncrementCreatesSerialDataTypesWithoutADefaultValue(string $type): void { $tableName = 'test_serial_type_' . $type; @@ -488,9 +484,7 @@ public function testAutoIncrementCreatesSerialDataTypesWithoutADefaultValue(stri self::assertNull($columns['id']->getDefault()); } - /** - * @dataProvider serialTypes - */ + /** @dataProvider serialTypes */ public function testAutoIncrementCreatesSerialDataTypesWithoutADefaultValueEvenWhenDefaultIsSet(string $type): void { $tableName = 'test_serial_type_with_default_' . $type; @@ -539,9 +533,7 @@ public function testAlterTableAutoIncrementIntToBigInt( self::assertTrue($tableFinal->getColumn('id')->getAutoincrement()); } - /** - * @return iterable - */ + /** @return iterable */ public static function autoIncrementTypeMigrations(): iterable { foreach (ComparatorTestUtils::comparatorProvider() as $comparatorArguments) { diff --git a/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php b/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php index 346f091ab20..d3f2f593b69 100644 --- a/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php +++ b/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php @@ -100,9 +100,7 @@ public function testCreateSequence(): void self::assertTrue($this->hasElementWithName($this->schemaManager->listSequences(), $name)); } - /** - * @param AbstractAsset[] $items - */ + /** @param AbstractAsset[] $items */ private function hasElementWithName(array $items, string $name): bool { $filteredList = $this->filterElementsByName($items, $name); @@ -171,9 +169,7 @@ public function testListDatabases(): void self::assertContains('test_create_database', $databases); } - /** - * @dataProvider listSchemaNamesMethodProvider - */ + /** @dataProvider listSchemaNamesMethodProvider */ public function testListSchemaNames(callable $method): void { $platform = $this->connection->getDatabasePlatform(); @@ -196,9 +192,7 @@ public function testListSchemaNames(callable $method): void self::assertContains('test_create_schema', $method($this->schemaManager)); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function listSchemaNamesMethodProvider(): iterable { yield [ @@ -241,9 +235,7 @@ public function testListTablesDoesNotIncludeViews(): void self::assertNull($view); } - /** - * @dataProvider tableFilterProvider - */ + /** @dataProvider tableFilterProvider */ public function testListTablesWithFilter(string $prefix, int $expectedCount): void { $this->createTestTable('filter_test_1'); @@ -261,9 +253,7 @@ static function (string $name) use ($prefix): bool { self::assertCount($expectedCount, $this->schemaManager->listTables()); } - /** - * @return iterable - */ + /** @return iterable */ public static function tableFilterProvider(): iterable { yield 'One table' => ['filter_test_1', 1]; @@ -1067,9 +1057,7 @@ public function testListTableWithBlob(): void self::assertInstanceOf(BlobType::class, $created->getColumn('binarydata')->getType()); } - /** - * @param mixed[] $data - */ + /** @param mixed[] $data */ protected function createTestTable(string $name = 'test_table', array $data = []): Table { $options = $data['options'] ?? []; @@ -1081,9 +1069,7 @@ protected function createTestTable(string $name = 'test_table', array $data = [] return $table; } - /** - * @param mixed[] $options - */ + /** @param mixed[] $options */ protected function getTestTable(string $name, array $options = []): Table { $table = new Table($name, [], [], [], [], $options); @@ -1108,9 +1094,7 @@ protected function getTestCompositeTable(string $name): Table return $table; } - /** - * @param Table[] $tables - */ + /** @param Table[] $tables */ protected function assertHasTable(array $tables): void { $foundTable = false; @@ -1388,9 +1372,7 @@ public function testAlterColumnComment( self::assertSame($expectedComment2, $onlineTable->getColumn('no_comment2')->getComment()); } - /** - * @return iterable - */ + /** @return iterable */ public static function getAlterColumnComment(): iterable { foreach (ComparatorTestUtils::comparatorProvider() as $comparatorArguments) { @@ -1463,9 +1445,7 @@ public function testComparatorShouldNotAddCommentToJsonTypeSinceItIsTheDefaultNo self::assertFalse($tableDiff); } - /** - * @dataProvider commentsProvider - */ + /** @dataProvider commentsProvider */ public function testExtractDoctrineTypeFromComment(string $comment, string $expected, string $currentType): void { $result = $this->schemaManager->extractDoctrineTypeFromComment($comment, $currentType); @@ -1473,9 +1453,7 @@ public function testExtractDoctrineTypeFromComment(string $comment, string $expe self::assertSame($expected, $result); } - /** - * @return string[][] - */ + /** @return string[][] */ public function commentsProvider(): array { $currentType = 'current type'; @@ -1715,9 +1693,7 @@ private function createReservedKeywordTables(): void $schemaManager->createSchemaObjects($schema); } - /** - * @param list $tables - */ + /** @param list
$tables */ protected function findTableByName(array $tables, string $name): ?Table { foreach ($tables as $table) { diff --git a/tests/Functional/StatementTest.php b/tests/Functional/StatementTest.php index 504b2ee5aa4..7427f3084bd 100644 --- a/tests/Functional/StatementTest.php +++ b/tests/Functional/StatementTest.php @@ -310,33 +310,25 @@ public function testFetchFromExecutedStatementWithFreedResult(callable $fetch, $ self::assertSame($expected, $value); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function emptyFetchProvider(): iterable { return [ 'fetch' => [ - /** - * @return mixed - */ + /** @return mixed */ static function (Result $result) { return $result->fetchAssociative(); }, false, ], - /** - * @return mixed|false - */ + /** @return mixed|false */ 'fetch-column' => [ static function (Result $result) { return $result->fetchOne(); }, false, ], - /** - * @return mixed[] - */ + /** @return mixed[] */ 'fetch-all' => [ static function (Result $result): array { return $result->fetchAllAssociative(); diff --git a/tests/Functional/TypeConversionTest.php b/tests/Functional/TypeConversionTest.php index 8eb60c92162..c744f5306d8 100644 --- a/tests/Functional/TypeConversionTest.php +++ b/tests/Functional/TypeConversionTest.php @@ -51,9 +51,7 @@ public function testIdempotentConversionToBoolean(string $type, $originalValue): self::assertEquals($originalValue, $dbValue); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function booleanProvider(): iterable { return [ @@ -75,9 +73,7 @@ public function testIdempotentConversionToInteger(string $type, $originalValue): self::assertEquals($originalValue, $dbValue); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function integerProvider(): iterable { return [ @@ -98,9 +94,7 @@ public function testIdempotentConversionToFloat(string $type, $originalValue): v self::assertEquals($originalValue, $dbValue); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function floatProvider(): iterable { return [ @@ -127,9 +121,7 @@ public function testIdempotentConversionToString(string $type, $originalValue): self::assertEquals($originalValue, $dbValue); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function toStringProvider(): iterable { return [ @@ -151,9 +143,7 @@ public function testIdempotentConversionToArray(string $type, $originalValue): v self::assertEquals($originalValue, $dbValue); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function toArrayProvider(): iterable { return [ @@ -175,9 +165,7 @@ public function testIdempotentConversionToObject(string $type, $originalValue): self::assertEquals($originalValue, $dbValue); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function toObjectProvider(): iterable { $obj = new stdClass(); @@ -189,9 +177,7 @@ public static function toObjectProvider(): iterable ]; } - /** - * @dataProvider toDateTimeProvider - */ + /** @dataProvider toDateTimeProvider */ public function testIdempotentConversionToDateTime(string $type, DateTime $originalValue): void { $dbValue = $this->processValue($type, $originalValue); @@ -209,9 +195,7 @@ public function testIdempotentConversionToDateTime(string $type, DateTime $origi ); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function toDateTimeProvider(): iterable { return [ diff --git a/tests/Functional/Types/BinaryTest.php b/tests/Functional/Types/BinaryTest.php index c9b5e457bb7..939905d8587 100644 --- a/tests/Functional/Types/BinaryTest.php +++ b/tests/Functional/Types/BinaryTest.php @@ -67,9 +67,7 @@ private function insert(string $id, string $value): void self::assertSame(1, $result); } - /** - * @return mixed - */ + /** @return mixed */ private function select(string $id) { $value = $this->connection->fetchOne( diff --git a/tests/Functional/Types/DecimalTest.php b/tests/Functional/Types/DecimalTest.php index e6668998f36..cf7aed067a2 100644 --- a/tests/Functional/Types/DecimalTest.php +++ b/tests/Functional/Types/DecimalTest.php @@ -13,9 +13,7 @@ final class DecimalTest extends FunctionalTestCase { - /** - * @return string[][] - */ + /** @return string[][] */ public function dataValuesProvider(): array { return [ @@ -24,9 +22,7 @@ public function dataValuesProvider(): array ]; } - /** - * @dataProvider dataValuesProvider - */ + /** @dataProvider dataValuesProvider */ public function testInsertAndRetrieveDecimal(string $expected): void { $table = new Table('decimal_table'); diff --git a/tests/FunctionalTestCase.php b/tests/FunctionalTestCase.php index a85a31d023d..cdb84453dd6 100644 --- a/tests/FunctionalTestCase.php +++ b/tests/FunctionalTestCase.php @@ -33,9 +33,7 @@ protected function markConnectionNotReusable(): void $this->isConnectionReusable = false; } - /** - * @before - */ + /** @before */ final protected function connect(): void { if (self::$sharedConnection === null) { @@ -45,9 +43,7 @@ final protected function connect(): void $this->connection = self::$sharedConnection; } - /** - * @after - */ + /** @after */ final protected function disconnect(): void { while ($this->connection->isTransactionActive()) { diff --git a/tests/Logging/LoggerChainTest.php b/tests/Logging/LoggerChainTest.php index c3f03cf870c..c65260f83e4 100644 --- a/tests/Logging/LoggerChainTest.php +++ b/tests/Logging/LoggerChainTest.php @@ -27,9 +27,7 @@ public function testStopQuery(): void $listener->stopQuery(); } - /** - * @param mixed ...$args - */ + /** @param mixed ...$args */ private function createChain(string $method, ...$args): LoggerChain { return new LoggerChain([ @@ -38,9 +36,7 @@ private function createChain(string $method, ...$args): LoggerChain ]); } - /** - * @param mixed ...$args - */ + /** @param mixed ...$args */ private function createLogger(string $method, ...$args): SQLLogger { $logger = $this->createMock(SQLLogger::class); diff --git a/tests/Platforms/AbstractMySQLPlatformTestCase.php b/tests/Platforms/AbstractMySQLPlatformTestCase.php index 06e64b005e4..62ed36c5026 100644 --- a/tests/Platforms/AbstractMySQLPlatformTestCase.php +++ b/tests/Platforms/AbstractMySQLPlatformTestCase.php @@ -15,9 +15,7 @@ use function array_shift; -/** - * @extends AbstractPlatformTestCase - */ +/** @extends AbstractPlatformTestCase */ abstract class AbstractMySQLPlatformTestCase extends AbstractPlatformTestCase { public function testModifyLimitQueryWitoutLimit(): void @@ -44,9 +42,7 @@ public function getGenerateTableSql(): string . 'PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB'; } - /** - * @return string[] - */ + /** @return string[] */ public function getGenerateTableWithMultiColumnUniqueIndexSql(): array { return [ @@ -174,9 +170,7 @@ protected function getGenerateForeignKeySql(): string return 'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id)'; } - /** - * @dataProvider comparatorProvider - */ + /** @dataProvider comparatorProvider */ public function testUniquePrimaryKey(Comparator $comparator): void { $keyTable = new Table('foo'); @@ -267,9 +261,7 @@ public function testChangeIndexWithForeignKeys(): void self::assertEquals(['ALTER TABLE test DROP INDEX uniq, ADD INDEX idx (col)'], $sql); } - /** - * @return string[] - */ + /** @return string[] */ protected function getQuotedColumnInPrimaryKeySQL(): array { return ['CREATE TABLE `quoted` (`create` VARCHAR(255) NOT NULL, ' @@ -277,9 +269,7 @@ protected function getQuotedColumnInPrimaryKeySQL(): array ]; } - /** - * @return string[] - */ + /** @return string[] */ protected function getQuotedColumnInIndexSQL(): array { return [ @@ -289,9 +279,7 @@ protected function getQuotedColumnInIndexSQL(): array ]; } - /** - * @return string[] - */ + /** @return string[] */ protected function getQuotedNameInIndexSQL(): array { return [ @@ -300,9 +288,7 @@ protected function getQuotedNameInIndexSQL(): array ]; } - /** - * @return string[] - */ + /** @return string[] */ protected function getQuotedColumnInForeignKeySQL(): array { return [ @@ -383,9 +369,7 @@ public function testBlobTypeDeclarationSQL(): void self::assertEquals('LONGBLOB', $this->platform->getBlobTypeDeclarationSQL([])); } - /** - * @dataProvider comparatorProvider - */ + /** @dataProvider comparatorProvider */ public function testAlterTableAddPrimaryKey(Comparator $comparator): void { $table = new Table('alter_table_add_pk'); @@ -407,9 +391,7 @@ public function testAlterTableAddPrimaryKey(Comparator $comparator): void ); } - /** - * @dataProvider comparatorProvider - */ + /** @dataProvider comparatorProvider */ public function testAlterPrimaryKeyWithAutoincrementColumn(Comparator $comparator): void { $table = new Table('alter_primary_key'); @@ -435,9 +417,7 @@ public function testAlterPrimaryKeyWithAutoincrementColumn(Comparator $comparato ); } - /** - * @dataProvider comparatorProvider - */ + /** @dataProvider comparatorProvider */ public function testDropPrimaryKeyWithAutoincrementColumn(Comparator $comparator): void { $table = new Table('drop_primary_key'); @@ -462,9 +442,7 @@ public function testDropPrimaryKeyWithAutoincrementColumn(Comparator $comparator ); } - /** - * @dataProvider comparatorProvider - */ + /** @dataProvider comparatorProvider */ public function testDropNonAutoincrementColumnFromCompositePrimaryKeyWithAutoincrementColumn( Comparator $comparator ): void { @@ -492,9 +470,7 @@ public function testDropNonAutoincrementColumnFromCompositePrimaryKeyWithAutoinc ); } - /** - * @dataProvider comparatorProvider - */ + /** @dataProvider comparatorProvider */ public function testAddNonAutoincrementColumnToPrimaryKeyWithAutoincrementColumn(Comparator $comparator): void { $table = new Table('tbl'); @@ -521,9 +497,7 @@ public function testAddNonAutoincrementColumnToPrimaryKeyWithAutoincrementColumn ); } - /** - * @dataProvider comparatorProvider - */ + /** @dataProvider comparatorProvider */ public function testAddAutoIncrementPrimaryKey(Comparator $comparator): void { $keyTable = new Table('foo'); @@ -555,9 +529,7 @@ public function testNamedPrimaryKey(): void ], $sql); } - /** - * @dataProvider comparatorProvider - */ + /** @dataProvider comparatorProvider */ public function testAlterPrimaryKeyWithNewColumn(Comparator $comparator): void { $table = new Table('yolo'); @@ -714,9 +686,7 @@ public function testDoesNotPropagateForeignKeyAlterationForNonSupportingEngines( ); } - /** - * @return string[] - */ + /** @return string[] */ protected function getAlterTableRenameIndexSQL(): array { return [ @@ -725,9 +695,7 @@ protected function getAlterTableRenameIndexSQL(): array ]; } - /** - * @return string[] - */ + /** @return string[] */ protected function getQuotedAlterTableRenameIndexSQL(): array { return [ @@ -738,9 +706,7 @@ protected function getQuotedAlterTableRenameIndexSQL(): array ]; } - /** - * @return string[] - */ + /** @return string[] */ protected function getAlterTableRenameIndexInSchemaSQL(): array { return [ @@ -749,9 +715,7 @@ protected function getAlterTableRenameIndexInSchemaSQL(): array ]; } - /** - * @return string[] - */ + /** @return string[] */ protected function getQuotedAlterTableRenameIndexInSchemaSQL(): array { return [ @@ -1049,9 +1013,7 @@ public function testGetCreateTableSQLWithColumnCollation(): void ); } - /** - * @return iterable - */ + /** @return iterable */ public static function comparatorProvider(): iterable { yield 'Generic comparator' => [ diff --git a/tests/Platforms/AbstractPlatformTestCase.php b/tests/Platforms/AbstractPlatformTestCase.php index 0742d6a3e37..4dfa27b0d28 100644 --- a/tests/Platforms/AbstractPlatformTestCase.php +++ b/tests/Platforms/AbstractPlatformTestCase.php @@ -28,9 +28,7 @@ use function sprintf; use function str_repeat; -/** - * @template T of AbstractPlatform - */ +/** @template T of AbstractPlatform */ abstract class AbstractPlatformTestCase extends TestCase { /** @var T */ @@ -38,9 +36,7 @@ abstract class AbstractPlatformTestCase extends TestCase private ?Type $backedUpType = null; - /** - * @return T - */ + /** @return T */ abstract public function createPlatform(): AbstractPlatform; protected function setUp(): void @@ -72,17 +68,13 @@ public function testQuoteSingleIdentifier(): void self::assertEquals(str_repeat($c, 4), $this->platform->quoteSingleIdentifier($c)); } - /** - * @dataProvider getReturnsForeignKeyReferentialActionSQL - */ + /** @dataProvider getReturnsForeignKeyReferentialActionSQL */ public function testReturnsForeignKeyReferentialActionSQL(string $action, string $expectedSQL): void { self::assertSame($expectedSQL, $this->platform->getForeignKeyReferentialActionSQL($action)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getReturnsForeignKeyReferentialActionSQL(): iterable { return [ @@ -127,17 +119,13 @@ public function testRegistersCommentedDoctrineMappingTypeImplicitly(): void self::assertTrue($this->platform->isCommentedDoctrineType($type)); } - /** - * @dataProvider getIsCommentedDoctrineType - */ + /** @dataProvider getIsCommentedDoctrineType */ public function testIsCommentedDoctrineType(Type $type, bool $commented): void { self::assertSame($commented, $this->platform->isCommentedDoctrineType($type)); } - /** - * @return mixed[] - */ + /** @return mixed[] */ public function getIsCommentedDoctrineType(): iterable { $this->setUp(); @@ -188,9 +176,7 @@ public function testGenerateTableWithMultiColumnUniqueIndex(): void self::assertEquals($this->getGenerateTableWithMultiColumnUniqueIndexSql(), $sql); } - /** - * @return string[] - */ + /** @return string[] */ abstract public function getGenerateTableWithMultiColumnUniqueIndexSql(): array; public function testGeneratesIndexCreationSql(): void @@ -314,9 +300,7 @@ public function getGenerateConstraintForeignKeySql(ForeignKeyConstraint $fk): st ); } - /** - * @return string[] - */ + /** @return string[] */ abstract public function getGenerateAlterTableSql(): array; public function testGeneratesTableAlterationSql(): void @@ -505,25 +489,19 @@ public function testCreateTableColumnTypeComments(): void self::assertEquals($this->getCreateTableColumnTypeCommentsSQL(), $this->platform->getCreateTableSQL($table)); } - /** - * @return string[] - */ + /** @return string[] */ public function getCreateTableColumnCommentsSQL(): array { self::markTestSkipped('Platform does not support Column comments.'); } - /** - * @return string[] - */ + /** @return string[] */ public function getAlterTableColumnCommentsSQL(): array { self::markTestSkipped('Platform does not support Column comments.'); } - /** - * @return string[] - */ + /** @return string[] */ public function getCreateTableColumnTypeCommentsSQL(): array { self::markTestSkipped('Platform does not support Column comments.'); @@ -597,24 +575,16 @@ public function testQuotedColumnInPrimaryKeyPropagation(): void self::assertEquals($this->getQuotedColumnInPrimaryKeySQL(), $sql); } - /** - * @return string[] - */ + /** @return string[] */ abstract protected function getQuotedColumnInPrimaryKeySQL(): array; - /** - * @return string[] - */ + /** @return string[] */ abstract protected function getQuotedColumnInIndexSQL(): array; - /** - * @return string[] - */ + /** @return string[] */ abstract protected function getQuotedNameInIndexSQL(): array; - /** - * @return string[] - */ + /** @return string[] */ abstract protected function getQuotedColumnInForeignKeySQL(): array; public function testQuotedColumnInIndexPropagation(): void @@ -798,9 +768,7 @@ public function testUsesSequenceEmulatedIdentityColumns(): void self::assertFalse($this->platform->usesSequenceEmulatedIdentityColumns()); } - /** - * @group DBAL-563 - */ + /** @group DBAL-563 */ public function testReturnsIdentitySequenceName(): void { $this->expectException(Exception::class); @@ -875,9 +843,7 @@ public function testAlterTableRenameIndex(): void ); } - /** - * @return string[] - */ + /** @return string[] */ protected function getAlterTableRenameIndexSQL(): array { return [ @@ -903,9 +869,7 @@ public function testQuotesAlterTableRenameIndex(): void ); } - /** - * @return string[] - */ + /** @return string[] */ protected function getQuotedAlterTableRenameIndexSQL(): array { return [ @@ -1031,9 +995,7 @@ public function testAlterTableRenameIndexInSchema(): void ); } - /** - * @return string[] - */ + /** @return string[] */ protected function getAlterTableRenameIndexInSchemaSQL(): array { return [ @@ -1059,9 +1021,7 @@ public function testQuotesAlterTableRenameIndexInSchema(): void ); } - /** - * @return string[] - */ + /** @return string[] */ protected function getQuotedAlterTableRenameIndexInSchemaSQL(): array { return [ @@ -1163,9 +1123,7 @@ public function testGetCommentOnColumnSQL(): void ); } - /** - * @dataProvider getGeneratesInlineColumnCommentSQL - */ + /** @dataProvider getGeneratesInlineColumnCommentSQL */ public function testGeneratesInlineColumnCommentSQL(string $comment, string $expectedSql): void { if (! $this->platform->supportsInlineColumnComments()) { @@ -1175,9 +1133,7 @@ public function testGeneratesInlineColumnCommentSQL(string $comment, string $exp self::assertSame($expectedSql, $this->platform->getInlineColumnCommentSQL($comment)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getGeneratesInlineColumnCommentSQL(): iterable { return [ @@ -1288,9 +1244,7 @@ public function testGeneratesAlterTableRenameColumnSQL(): void self::assertSame($this->getAlterTableRenameColumnSQL(), $this->platform->getAlterTableSQL($tableDiff)); } - /** - * @return string[] - */ + /** @return string[] */ abstract public function getAlterTableRenameColumnSQL(): array; public function testQuotesTableIdentifiersInAlterTableSQL(): void @@ -1327,9 +1281,7 @@ public function testQuotesTableIdentifiersInAlterTableSQL(): void ); } - /** - * @return string[] - */ + /** @return string[] */ abstract protected function getQuotesTableIdentifiersInAlterTableSQL(): array; public function testAlterStringToFixedString(): void @@ -1357,9 +1309,7 @@ public function testAlterStringToFixedString(): void self::assertEquals($expectedSql, $sql); } - /** - * @return string[] - */ + /** @return string[] */ abstract protected function getAlterStringToFixedStringSQL(): array; public function testGeneratesAlterTableRenameIndexUsedByForeignKeySQL(): void @@ -1387,9 +1337,7 @@ public function testGeneratesAlterTableRenameIndexUsedByForeignKeySQL(): void ); } - /** - * @return string[] - */ + /** @return string[] */ abstract protected function getGeneratesAlterTableRenameIndexUsedByForeignKeySQL(): array; /** @@ -1402,9 +1350,7 @@ public function testGeneratesDecimalTypeDeclarationSQL(array $column, string $ex self::assertSame($expectedSql, $this->platform->getDecimalTypeDeclarationSQL($column)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getGeneratesDecimalTypeDeclarationSQL(): iterable { return [ @@ -1427,9 +1373,7 @@ public function testGeneratesFloatDeclarationSQL(array $column, string $expected self::assertSame($expectedSql, $this->platform->getFloatDeclarationSQL($column)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getGeneratesFloatDeclarationSQL(): iterable { return [ @@ -1484,9 +1428,7 @@ public function testAsciiSQLDeclaration(string $expectedSql, array $column): voi self::assertEquals($expectedSql, $declarationSql); } - /** - * @return array}> - */ + /** @return array}> */ public function asciiStringSqlDeclarationDataProvider(): array { return [ diff --git a/tests/Platforms/DB2PlatformTest.php b/tests/Platforms/DB2PlatformTest.php index 93b26b838d8..40718bd5da6 100644 --- a/tests/Platforms/DB2PlatformTest.php +++ b/tests/Platforms/DB2PlatformTest.php @@ -12,9 +12,7 @@ use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types; -/** - * @extends AbstractPlatformTestCase - */ +/** @extends AbstractPlatformTestCase */ class DB2PlatformTest extends AbstractPlatformTestCase { public function createPlatform(): AbstractPlatform @@ -579,9 +577,7 @@ protected function getCommentOnColumnSQL(): array ]; } - /** - * @dataProvider getGeneratesAlterColumnSQL - */ + /** @dataProvider getGeneratesAlterColumnSQL */ public function testGeneratesAlterColumnSQL( string $changedProperty, Column $column, @@ -602,9 +598,7 @@ public function testGeneratesAlterColumnSQL( self::assertSame($expectedSQL, $this->platform->getAlterTableSQL($tableDiff)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getGeneratesAlterColumnSQL(): iterable { return [ diff --git a/tests/Platforms/MySQL/CollationMetadataProvider/CachingCollationMetadataProviderTest.php b/tests/Platforms/MySQL/CollationMetadataProvider/CachingCollationMetadataProviderTest.php index 5d0c47233e6..f90bdaf7cde 100644 --- a/tests/Platforms/MySQL/CollationMetadataProvider/CachingCollationMetadataProviderTest.php +++ b/tests/Platforms/MySQL/CollationMetadataProvider/CachingCollationMetadataProviderTest.php @@ -10,9 +10,7 @@ class CachingCollationMetadataProviderTest extends TestCase { - /** - * @dataProvider charsetAndCollationProvider - */ + /** @dataProvider charsetAndCollationProvider */ public function testCharsetCaching(string $collation, ?string $charset): void { $underlyingProvider = $this->createMock(CollationMetadataProvider::class); @@ -26,9 +24,7 @@ public function testCharsetCaching(string $collation, ?string $charset): void self::assertSame($charset, $cachingProvider->getCollationCharset($collation)); } - /** - * @return iterable - */ + /** @return iterable */ public static function charsetAndCollationProvider(): iterable { yield 'found' => ['utf8mb4_unicode_ci', 'utf8mb4']; diff --git a/tests/Platforms/MySQL57PlatformTest.php b/tests/Platforms/MySQL57PlatformTest.php index a32adb82722..1ce9871c136 100644 --- a/tests/Platforms/MySQL57PlatformTest.php +++ b/tests/Platforms/MySQL57PlatformTest.php @@ -29,17 +29,13 @@ public function testInitializesJsonTypeMapping(): void self::assertSame(Types::JSON, $this->platform->getDoctrineTypeMapping('json')); } - /** - * @return string[] - */ + /** @return string[] */ protected function getAlterTableRenameIndexSQL(): array { return ['ALTER TABLE mytable RENAME INDEX idx_foo TO idx_bar']; } - /** - * @return string[] - */ + /** @return string[] */ protected function getQuotedAlterTableRenameIndexSQL(): array { return [ @@ -48,17 +44,13 @@ protected function getQuotedAlterTableRenameIndexSQL(): array ]; } - /** - * @return string[] - */ + /** @return string[] */ protected function getAlterTableRenameIndexInSchemaSQL(): array { return ['ALTER TABLE myschema.mytable RENAME INDEX idx_foo TO idx_bar']; } - /** - * @return string[] - */ + /** @return string[] */ protected function getQuotedAlterTableRenameIndexInSchemaSQL(): array { return [ diff --git a/tests/Platforms/OraclePlatformTest.php b/tests/Platforms/OraclePlatformTest.php index 477539976cb..6808f785c32 100644 --- a/tests/Platforms/OraclePlatformTest.php +++ b/tests/Platforms/OraclePlatformTest.php @@ -19,14 +19,10 @@ use function strtoupper; use function uniqid; -/** - * @extends AbstractPlatformTestCase - */ +/** @extends AbstractPlatformTestCase */ class OraclePlatformTest extends AbstractPlatformTestCase { - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function dataValidIdentifiers(): iterable { return [ @@ -42,9 +38,7 @@ public static function dataValidIdentifiers(): iterable ]; } - /** - * @dataProvider dataValidIdentifiers - */ + /** @dataProvider dataValidIdentifiers */ public function testValidIdentifiers(string $identifier): void { $platform = $this->createPlatform(); @@ -53,9 +47,7 @@ public function testValidIdentifiers(string $identifier): void $this->expectNotToPerformAssertions(); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function dataInvalidIdentifiers(): iterable { return [ @@ -67,9 +59,7 @@ public static function dataInvalidIdentifiers(): iterable ]; } - /** - * @dataProvider dataInvalidIdentifiers - */ + /** @dataProvider dataInvalidIdentifiers */ public function testInvalidIdentifiers(string $identifier): void { $this->expectException(Exception::class); @@ -247,9 +237,7 @@ public function testGeneratesAdvancedForeignKeyOptionsSQL(array $options, string self::assertSame($expectedSql, $this->platform->getAdvancedForeignKeyOptionsSQL($foreignKey)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getGeneratesAdvancedForeignKeyOptionsSQLData(): iterable { return [ @@ -592,18 +580,14 @@ public function testReturnsIdentitySequenceName(): void self::assertSame('"mytable_SEQ"', $this->platform->getIdentitySequenceName('"mytable"', '"mycolumn"')); } - /** - * @dataProvider dataCreateSequenceWithCache - */ + /** @dataProvider dataCreateSequenceWithCache */ public function testCreateSequenceWithCache(int $cacheSize, string $expectedSql): void { $sequence = new Sequence('foo', 1, 1, $cacheSize); self::assertStringContainsString($expectedSql, $this->platform->getCreateSequenceSQL($sequence)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function dataCreateSequenceWithCache(): iterable { return [ @@ -705,9 +689,7 @@ public function testReturnsDropAutoincrementSQL(string $table, array $expectedSq self::assertSame($expectedSql, $this->platform->getDropAutoincrementSql($table)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getReturnsDropAutoincrementSQL(): iterable { return [ @@ -824,9 +806,7 @@ public function testQuotedTableNames(): void self::assertEquals($createTriggerStatement, $sql[3]); } - /** - * @dataProvider getReturnsGetListTableColumnsSQL - */ + /** @dataProvider getReturnsGetListTableColumnsSQL */ public function testReturnsGetListTableColumnsSQL(?string $database, string $expectedSql): void { // note: this assertion is a bit strict, as it compares a full SQL string. @@ -835,9 +815,7 @@ public function testReturnsGetListTableColumnsSQL(?string $database, string $exp self::assertEquals($expectedSql, $this->platform->getListTableColumnsSQL('"test"', $database)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getReturnsGetListTableColumnsSQL(): iterable { return [ @@ -971,9 +949,7 @@ public function testQuotesDatabaseNameInListTableColumnsSQL(): void ); } - /** - * @return array}> - */ + /** @return array}> */ public function asciiStringSqlDeclarationDataProvider(): array { return [ diff --git a/tests/Platforms/PostgreSQLPlatformTest.php b/tests/Platforms/PostgreSQLPlatformTest.php index 936fd57bec1..249a310effe 100644 --- a/tests/Platforms/PostgreSQLPlatformTest.php +++ b/tests/Platforms/PostgreSQLPlatformTest.php @@ -18,9 +18,7 @@ use function sprintf; -/** - * @extends AbstractPlatformTestCase - */ +/** @extends AbstractPlatformTestCase */ class PostgreSQLPlatformTest extends AbstractPlatformTestCase { public function createPlatform(): AbstractPlatform @@ -207,9 +205,7 @@ public function testGenerateTableWithAutoincrement(): void ); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function serialTypes(): iterable { return [ @@ -218,9 +214,7 @@ public static function serialTypes(): iterable ]; } - /** - * @dataProvider serialTypes - */ + /** @dataProvider serialTypes */ public function testGenerateTableWithAutoincrementDoesNotSetDefault(string $type, string $definition): void { $table = new Table('autoinc_table_notnull'); @@ -233,9 +227,7 @@ public function testGenerateTableWithAutoincrementDoesNotSetDefault(string $type self::assertEquals([sprintf('CREATE TABLE autoinc_table_notnull (id %s)', $definition)], $sql); } - /** - * @dataProvider serialTypes - */ + /** @dataProvider serialTypes */ public function testCreateTableWithAutoincrementAndNotNullAddsConstraint(string $type, string $definition): void { $table = new Table('autoinc_table_notnull_enabled'); @@ -248,9 +240,7 @@ public function testCreateTableWithAutoincrementAndNotNullAddsConstraint(string self::assertEquals([sprintf('CREATE TABLE autoinc_table_notnull_enabled (id %s NOT NULL)', $definition)], $sql); } - /** - * @dataProvider serialTypes - */ + /** @dataProvider serialTypes */ public function testGetDefaultValueDeclarationSQLIgnoresTheDefaultKeyWhenTheFieldIsSerial(string $type): void { $sql = $this->platform->getDefaultValueDeclarationSQL( @@ -619,18 +609,14 @@ public function testReturnsIdentitySequenceName(): void self::assertSame('mytable_mycolumn_seq', $this->platform->getIdentitySequenceName('mytable', 'mycolumn')); } - /** - * @dataProvider dataCreateSequenceWithCache - */ + /** @dataProvider dataCreateSequenceWithCache */ public function testCreateSequenceWithCache(int $cacheSize, string $expectedSql): void { $sequence = new Sequence('foo', 1, 1, $cacheSize); self::assertStringContainsString($expectedSql, $this->platform->getCreateSequenceSQL($sequence)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function dataCreateSequenceWithCache(): iterable { return [ diff --git a/tests/Platforms/SQLServerPlatformTestCase.php b/tests/Platforms/SQLServerPlatformTestCase.php index 2116321ebd2..09a9e751a2a 100644 --- a/tests/Platforms/SQLServerPlatformTestCase.php +++ b/tests/Platforms/SQLServerPlatformTestCase.php @@ -17,9 +17,7 @@ use Doctrine\DBAL\Types\Type; use InvalidArgumentException; -/** - * @extends AbstractPlatformTestCase - */ +/** @extends AbstractPlatformTestCase */ class SQLServerPlatformTestCase extends AbstractPlatformTestCase { public function createPlatform(): AbstractPlatform @@ -1306,9 +1304,7 @@ public function testGeneratesIdentifierNamesInDefaultConstraintDeclarationSQL( self::assertSame($expectedSql, $this->platform->getDefaultConstraintDeclarationSQL($table, $column)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getGeneratesIdentifierNamesInDefaultConstraintDeclarationSQL(): iterable { return [ @@ -1361,9 +1357,7 @@ public function testGeneratesIdentifierNamesInCreateTableSQL(Table $table, array self::assertSame($expectedSql, $this->platform->getCreateTableSQL($table)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getGeneratesIdentifierNamesInCreateTableSQL(): iterable { return [ @@ -1412,9 +1406,7 @@ public function testGeneratesIdentifierNamesInAlterTableSQL(TableDiff $tableDiff self::assertSame($expectedSql, $this->platform->getAlterTableSQL($tableDiff)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getGeneratesIdentifierNamesInAlterTableSQL(): iterable { return [ @@ -1834,9 +1826,7 @@ public function testAppendsLockHint(int $lockMode, string $lockHint): void self::assertSame($expectedResult, $this->platform->appendLockHint($fromClause, $lockMode)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getLockHints(): iterable { return [ diff --git a/tests/Platforms/SqlitePlatformTest.php b/tests/Platforms/SqlitePlatformTest.php index d29f8dc65fd..a97f9554c86 100644 --- a/tests/Platforms/SqlitePlatformTest.php +++ b/tests/Platforms/SqlitePlatformTest.php @@ -11,9 +11,7 @@ use Doctrine\DBAL\TransactionIsolationLevel; use Doctrine\DBAL\Types\Type; -/** - * @extends AbstractPlatformTestCase - */ +/** @extends AbstractPlatformTestCase */ class SqlitePlatformTest extends AbstractPlatformTestCase { public function createPlatform(): AbstractPlatform @@ -337,9 +335,7 @@ public function testAlterTableAddColumns(): void self::assertEquals($expected, $this->platform->getAlterTableSQL($diff)); } - /** - * @dataProvider complexDiffProvider - */ + /** @dataProvider complexDiffProvider */ public function testAlterTableAddComplexColumns(TableDiff $diff): void { $this->expectException(Exception::class); @@ -360,9 +356,7 @@ public function testRenameNonExistingColumn(): void $this->platform->getAlterTableSQL($tableDiff); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function complexDiffProvider(): iterable { $date = new TableDiff('user'); diff --git a/tests/Portability/ConnectionTest.php b/tests/Portability/ConnectionTest.php index 3077edd2b94..dd5cecab1fc 100644 --- a/tests/Portability/ConnectionTest.php +++ b/tests/Portability/ConnectionTest.php @@ -62,8 +62,6 @@ public function testGetNativeConnectionFailsWithLegacyConnection(): void interface NativeDriverConnection extends ServerInfoAwareConnection { - /** - * @return object|resource - */ + /** @return object|resource */ public function getNativeConnection(); } diff --git a/tests/Portability/ConverterTest.php b/tests/Portability/ConverterTest.php index e539c45074b..a5372c80bbd 100644 --- a/tests/Portability/ConverterTest.php +++ b/tests/Portability/ConverterTest.php @@ -24,9 +24,7 @@ public function testConvertNumeric($row, bool $convertEmptyStringToNull, bool $r ); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function convertNumericProvider(): iterable { $row = ['X ', '']; @@ -82,9 +80,7 @@ public function testConvertAssociative( ); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function convertAssociativeProvider(): iterable { $row = [ @@ -198,9 +194,7 @@ public function testConvertOne($value, bool $convertEmptyStringToNull, bool $rig ); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function convertOneProvider(): iterable { yield 'None, trailing space' => ['X ', false, false, 'X ']; @@ -234,9 +228,7 @@ public function testConvertAllNumeric( ); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function convertAllNumericProvider(): iterable { $data = [ @@ -303,9 +295,7 @@ public function testConvertAllAssociative( ); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function convertAllAssociativeProvider(): iterable { $data = [ @@ -475,9 +465,7 @@ public function testConvertFirstColumn( ); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function convertFirstColumnProvider(): iterable { $column = ['X ', '']; diff --git a/tests/Portability/ResultTest.php b/tests/Portability/ResultTest.php index 89dd123849c..933670c0dbf 100644 --- a/tests/Portability/ResultTest.php +++ b/tests/Portability/ResultTest.php @@ -28,9 +28,7 @@ public function testFetch(string $source, callable $fetch, $return): void self::assertSame($return, $fetch($result)); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function fetchProvider(): iterable { yield 'numeric' => [ diff --git a/tests/Portability/StatementTest.php b/tests/Portability/StatementTest.php index ad11903d3bd..0282d403c61 100644 --- a/tests/Portability/StatementTest.php +++ b/tests/Portability/StatementTest.php @@ -67,9 +67,7 @@ public function testExecute(): void $this->stmt->execute($params); } - /** - * @return Connection&MockObject - */ + /** @return Connection&MockObject */ protected function createConnection() { return $this->getMockBuilder(Connection::class) diff --git a/tests/Query/Expression/CompositeExpressionTest.php b/tests/Query/Expression/CompositeExpressionTest.php index ecdcfc542f9..08489f3e140 100644 --- a/tests/Query/Expression/CompositeExpressionTest.php +++ b/tests/Query/Expression/CompositeExpressionTest.php @@ -73,9 +73,7 @@ public function testCompositeUsageAndGeneration(string $type, array $parts, stri self::assertEquals($expects, (string) $expr); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function provideDataForConvertToString(): iterable { return [ diff --git a/tests/Query/Expression/ExpressionBuilderTest.php b/tests/Query/Expression/ExpressionBuilderTest.php index 090c1645089..7c97facb645 100644 --- a/tests/Query/Expression/ExpressionBuilderTest.php +++ b/tests/Query/Expression/ExpressionBuilderTest.php @@ -50,9 +50,7 @@ public function testAndX(array $parts, string $expected): void self::assertEquals($expected, (string) $composite); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function provideDataForAnd(): iterable { return [ @@ -123,9 +121,7 @@ public function testOrX(array $parts, string $expected): void self::assertEquals($expected, (string) $composite); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function provideDataForOr(): iterable { return [ @@ -168,9 +164,7 @@ public static function provideDataForOr(): iterable ]; } - /** - * @dataProvider provideDataForComparison - */ + /** @dataProvider provideDataForComparison */ public function testComparison(string $leftExpr, string $operator, string $rightExpr, string $expected): void { $part = $this->expr->comparison($leftExpr, $operator, $rightExpr); @@ -178,9 +172,7 @@ public function testComparison(string $leftExpr, string $operator, string $right self::assertEquals($expected, $part); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function provideDataForComparison(): iterable { return [ diff --git a/tests/Query/QueryBuilderTest.php b/tests/Query/QueryBuilderTest.php index f73c3e92b03..7b403a12499 100644 --- a/tests/Query/QueryBuilderTest.php +++ b/tests/Query/QueryBuilderTest.php @@ -575,9 +575,7 @@ public function testGetState(): void self::assertEquals($sql1, $qb->getSQL()); } - /** - * @dataProvider maxResultsProvider - */ + /** @dataProvider maxResultsProvider */ public function testSetMaxResults(?int $maxResults): void { $qb = new QueryBuilder($this->conn); @@ -587,9 +585,7 @@ public function testSetMaxResults(?int $maxResults): void self::assertEquals($maxResults, $qb->getMaxResults()); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function maxResultsProvider(): iterable { return [ diff --git a/tests/SQL/ParserTest.php b/tests/SQL/ParserTest.php index 798547609fc..a186e6104cf 100644 --- a/tests/SQL/ParserTest.php +++ b/tests/SQL/ParserTest.php @@ -15,9 +15,7 @@ class ParserTest extends TestCase implements Visitor /** @var list */ private array $result = []; - /** - * @dataProvider statementsWithParametersProvider - */ + /** @dataProvider statementsWithParametersProvider */ public function testStatementsWithParameters(bool $mySQLStringEscaping, string $sql, string $expected): void { $parser = new Parser($mySQLStringEscaping); @@ -26,9 +24,7 @@ public function testStatementsWithParameters(bool $mySQLStringEscaping, string $ $this->assertParsed($expected); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function statementsWithParametersProvider(): iterable { foreach (self::getModes() as $mode => $mySQLStringEscaping) { @@ -38,9 +34,7 @@ public static function statementsWithParametersProvider(): iterable } } - /** - * @return iterable> - */ + /** @return iterable> */ private static function getStatementsWithParameters(): iterable { yield [ @@ -308,9 +302,7 @@ private static function getStatementsWithParameters(): iterable ]; } - /** - * @dataProvider statementsWithoutParametersProvider - */ + /** @dataProvider statementsWithoutParametersProvider */ public function testStatementsWithoutParameters(bool $mySQLStringEscaping, string $sql): void { $parser = new Parser($mySQLStringEscaping); @@ -319,9 +311,7 @@ public function testStatementsWithoutParameters(bool $mySQLStringEscaping, strin $this->assertParsed($sql); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function statementsWithoutParametersProvider(): iterable { foreach (self::getModes() as $mode => $mySQLStringEscaping) { @@ -331,9 +321,7 @@ public static function statementsWithoutParametersProvider(): iterable } } - /** - * @return iterable - */ + /** @return iterable */ private static function getStatementsWithoutParameters(): iterable { yield 'SELECT * FROM Foo'; @@ -348,9 +336,7 @@ private static function getStatementsWithoutParameters(): iterable yield 'SELECT @rank := 1'; } - /** - * @dataProvider ansiParametersProvider - */ + /** @dataProvider ansiParametersProvider */ public function testAnsiEscaping(string $sql, string $expected): void { $parser = new Parser(false); @@ -359,9 +345,7 @@ public function testAnsiEscaping(string $sql, string $expected): void $this->assertParsed($expected); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function ansiParametersProvider(): iterable { yield 'Quotes inside literals escaped by doubling' => [ @@ -393,9 +377,7 @@ public static function ansiParametersProvider(): iterable ]; } - /** - * @dataProvider mySQLParametersProvider - */ + /** @dataProvider mySQLParametersProvider */ public function testMySQLEscaping(string $sql, string $expected): void { $parser = new Parser(true); @@ -404,9 +386,7 @@ public function testMySQLEscaping(string $sql, string $expected): void $this->assertParsed($expected); } - /** - * @return iterable> - */ + /** @return iterable> */ public static function mySQLParametersProvider(): iterable { yield 'Quotes inside literals escaped by backslash' => [ @@ -457,9 +437,7 @@ public function acceptOther(string $sql): void $this->result[] = $sql; } - /** - * @return iterable - */ + /** @return iterable */ private static function getModes(): iterable { yield 'ANSI' => false; diff --git a/tests/Schema/ColumnTest.php b/tests/Schema/ColumnTest.php index 29274dd0874..aacbd52f69d 100644 --- a/tests/Schema/ColumnTest.php +++ b/tests/Schema/ColumnTest.php @@ -120,9 +120,7 @@ public function testQuotedColumnName(): void self::assertEquals('[bar]', $column->getQuotedName($sqlServerPlatform)); } - /** - * @dataProvider getIsQuoted - */ + /** @dataProvider getIsQuoted */ public function testIsQuoted(string $columnName, bool $isQuoted): void { $type = Type::getType('string'); @@ -131,9 +129,7 @@ public function testIsQuoted(string $columnName, bool $isQuoted): void self::assertSame($isQuoted, $column->isQuoted()); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getIsQuoted(): iterable { return [ diff --git a/tests/Schema/ComparatorTest.php b/tests/Schema/ComparatorTest.php index 9ab934a67fc..86a2ee1f5ae 100644 --- a/tests/Schema/ComparatorTest.php +++ b/tests/Schema/ComparatorTest.php @@ -843,9 +843,7 @@ public function testChangedSequence(): void self::assertSame($diff->changedSequences[0], $schemaNew->getSequence('baz')); } - /** - * @psalm-suppress NullArgument - */ + /** @psalm-suppress NullArgument */ public function testDiffDecimalWithNullPrecision(): void { $column = new Column('foo', Type::getType('decimal')); @@ -1183,9 +1181,7 @@ public function testCompareGuidColumns(): void self::assertEquals(['notnull', 'default', 'comment'], $this->comparator->diffColumn($column2, $column1)); } - /** - * @dataProvider getCompareColumnComments - */ + /** @dataProvider getCompareColumnComments */ public function testCompareColumnComments(?string $comment1, ?string $comment2, bool $equals): void { $column1 = new Column('foo', Type::getType('integer'), ['comment' => $comment1]); @@ -1202,9 +1198,7 @@ public function testCompareColumnComments(?string $comment1, ?string $comment2, self::assertSame($expectedDiff, $actualDiff); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getCompareColumnComments(): iterable { return [ diff --git a/tests/Schema/ForeignKeyConstraintTest.php b/tests/Schema/ForeignKeyConstraintTest.php index f3b9660a6c9..c8bd3909368 100644 --- a/tests/Schema/ForeignKeyConstraintTest.php +++ b/tests/Schema/ForeignKeyConstraintTest.php @@ -28,9 +28,7 @@ public function testIntersectsIndexColumns(array $indexColumns, bool $expectedRe self::assertSame($expectedResult, $foreignKey->intersectsIndexColumns($index)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getIntersectsIndexColumnsData(): iterable { return [ @@ -69,9 +67,7 @@ public function testGetUnqualifiedForeignTableName($foreignTableName, string $ex self::assertSame($expectedUnqualifiedTableName, $foreignKey->getUnqualifiedForeignTableName()); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getUnqualifiedForeignTableNameData(): iterable { return [ diff --git a/tests/Schema/IndexTest.php b/tests/Schema/IndexTest.php index 56a33ec5512..0306959c401 100644 --- a/tests/Schema/IndexTest.php +++ b/tests/Schema/IndexTest.php @@ -7,9 +7,7 @@ class IndexTest extends TestCase { - /** - * @param mixed[] $options - */ + /** @param mixed[] $options */ private function createIndex(bool $unique = false, bool $primary = false, array $options = []): Index { return new Index('foo', ['bar', 'baz'], $unique, $primary, [], $options); @@ -118,9 +116,7 @@ public function testFulfilledWithLength(array $columns, array $lengths1, array $ self::assertSame($expected, $index2->isFullfilledBy($index1)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function indexLengthProvider(): iterable { return [ diff --git a/tests/Schema/MySQLInheritCharsetTest.php b/tests/Schema/MySQLInheritCharsetTest.php index e7e2c9df5c1..e579aac9009 100644 --- a/tests/Schema/MySQLInheritCharsetTest.php +++ b/tests/Schema/MySQLInheritCharsetTest.php @@ -19,9 +19,7 @@ use function array_merge; -/** - * @psalm-import-type Params from DriverManager - */ +/** @psalm-import-type Params from DriverManager */ class MySQLInheritCharsetTest extends TestCase { public function testInheritTableOptionsFromDatabase(): void diff --git a/tests/Schema/Platforms/MySQLSchemaTest.php b/tests/Schema/Platforms/MySQLSchemaTest.php index 6bf80835f4a..212e8f79bac 100644 --- a/tests/Schema/Platforms/MySQLSchemaTest.php +++ b/tests/Schema/Platforms/MySQLSchemaTest.php @@ -19,9 +19,7 @@ protected function setUp(): void $this->platform = new MySQLPlatform(); } - /** - * @dataProvider comparatorProvider - */ + /** @dataProvider comparatorProvider */ public function testSwitchPrimaryKeyOrder(Comparator $comparator): void { $tableOld = new Table('test'); @@ -66,9 +64,7 @@ public function testGenerateForeignKeySQL(): void ); } - /** - * @dataProvider comparatorProvider - */ + /** @dataProvider comparatorProvider */ public function testClobNoAlterTable(Comparator $comparator): void { $tableOld = new Table('test'); @@ -89,9 +85,7 @@ public function testClobNoAlterTable(Comparator $comparator): void ); } - /** - * @return iterable - */ + /** @return iterable */ public static function comparatorProvider(): iterable { yield 'Generic comparator' => [ diff --git a/tests/Schema/SqliteSchemaManagerTest.php b/tests/Schema/SqliteSchemaManagerTest.php index 525c25731fe..ff92842cb0a 100644 --- a/tests/Schema/SqliteSchemaManagerTest.php +++ b/tests/Schema/SqliteSchemaManagerTest.php @@ -10,9 +10,7 @@ class SqliteSchemaManagerTest extends TestCase { - /** - * @dataProvider getDataColumnCollation - */ + /** @dataProvider getDataColumnCollation */ public function testParseColumnCollation(?string $collation, string $column, string $sql): void { $conn = $this->createMock(Connection::class); @@ -24,9 +22,7 @@ public function testParseColumnCollation(?string $collation, string $column, str self::assertSame($collation, $ref->invoke($manager, $column, $sql)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getDataColumnCollation(): iterable { return [ @@ -126,9 +122,7 @@ public static function getDataColumnCollation(): iterable ]; } - /** - * @dataProvider getDataColumnComment - */ + /** @dataProvider getDataColumnComment */ public function testParseColumnCommentFromSQL(?string $comment, string $column, string $sql): void { $conn = $this->createMock(Connection::class); @@ -140,9 +134,7 @@ public function testParseColumnCommentFromSQL(?string $comment, string $column, self::assertSame($comment, $ref->invoke($manager, $column, $sql)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getDataColumnComment(): iterable { return [ diff --git a/tests/Schema/TableTest.php b/tests/Schema/TableTest.php index c3c5955881d..45211228dbf 100644 --- a/tests/Schema/TableTest.php +++ b/tests/Schema/TableTest.php @@ -749,9 +749,7 @@ public function testThrowsExceptionOnRenamingToAlreadyExistingIndex(): void $table->renameIndex('idx_id', 'idx_foo'); } - /** - * @dataProvider getNormalizesAssetNames - */ + /** @dataProvider getNormalizesAssetNames */ public function testNormalizesColumnNames(string $assetName): void { $table = new Table('test'); @@ -806,9 +804,7 @@ public function testNormalizesColumnNames(string $assetName): void self::assertFalse($table->hasForeignKey('foo')); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getNormalizesAssetNames(): iterable { return [ diff --git a/tests/Schema/Visitor/CreateSchemaSqlCollectorTest.php b/tests/Schema/Visitor/CreateSchemaSqlCollectorTest.php index 1115d808f72..9f73469c44a 100644 --- a/tests/Schema/Visitor/CreateSchemaSqlCollectorTest.php +++ b/tests/Schema/Visitor/CreateSchemaSqlCollectorTest.php @@ -130,9 +130,7 @@ public function testResetsQueries(): void self::assertEmpty($this->visitor->getQueries()); } - /** - * @return ForeignKeyConstraint&MockObject - */ + /** @return ForeignKeyConstraint&MockObject */ private function createForeignKeyConstraintMock() { return $this->getMockBuilder(ForeignKeyConstraint::class) @@ -140,9 +138,7 @@ private function createForeignKeyConstraintMock() ->getMock(); } - /** - * @return Sequence&MockObject - */ + /** @return Sequence&MockObject */ private function createSequenceMock() { return $this->getMockBuilder(Sequence::class) @@ -150,9 +146,7 @@ private function createSequenceMock() ->getMock(); } - /** - * @return Table&MockObject - */ + /** @return Table&MockObject */ private function createTableMock() { return $this->getMockBuilder(Table::class) diff --git a/tests/Schema/Visitor/DropSchemaSqlCollectorTest.php b/tests/Schema/Visitor/DropSchemaSqlCollectorTest.php index 4f6caeb9ed9..5072d2e43c3 100644 --- a/tests/Schema/Visitor/DropSchemaSqlCollectorTest.php +++ b/tests/Schema/Visitor/DropSchemaSqlCollectorTest.php @@ -9,9 +9,7 @@ use Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector; use PHPUnit\Framework\TestCase; -/** - * @covers \Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector - */ +/** @covers \Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector */ class DropSchemaSqlCollectorTest extends TestCase { public function testGetQueriesUsesAcceptedForeignKeys(): void diff --git a/tests/TestUtil.php b/tests/TestUtil.php index 045ccc8db3c..7327c13da12 100644 --- a/tests/TestUtil.php +++ b/tests/TestUtil.php @@ -75,9 +75,7 @@ public static function getConnection(): Connection return $connection; } - /** - * @return mixed[] - */ + /** @return mixed[] */ public static function getConnectionParams(): array { if (self::hasRequiredConnectionParams()) { @@ -135,9 +133,7 @@ private static function initializeDatabase(): void $privConn->close(); } - /** - * @return mixed[] - */ + /** @return mixed[] */ private static function getFallbackConnectionParams(): array { if (! extension_loaded('pdo_sqlite')) { @@ -151,9 +147,7 @@ private static function getFallbackConnectionParams(): array ]; } - /** - * @param list $subscribers - */ + /** @param list $subscribers */ private static function addDbEventSubscribers(Connection $connection, array $subscribers): void { $evm = $connection->getEventManager(); @@ -171,9 +165,7 @@ private static function addDbEventSubscribers(Connection $connection, array $sub } } - /** - * @return mixed[] - */ + /** @return mixed[] */ private static function getPrivilegedConnectionParameters(): array { if (isset($GLOBALS['tmpdb_driver'])) { @@ -186,9 +178,7 @@ private static function getPrivilegedConnectionParameters(): array return $parameters; } - /** - * @return mixed[] - */ + /** @return mixed[] */ private static function getTestConnectionParameters(): array { return self::mapConnectionParameters($GLOBALS, 'db_'); diff --git a/tests/Types/BaseDateTypeTestCase.php b/tests/Types/BaseDateTypeTestCase.php index eaf21fc5add..00fb2a72f36 100644 --- a/tests/Types/BaseDateTypeTestCase.php +++ b/tests/Types/BaseDateTypeTestCase.php @@ -86,9 +86,7 @@ public function testDateTimeImmutableConvertsToDatabaseValue(): void self::assertIsString($this->type->convertToDatabaseValue(new DateTimeImmutable(), $this->platform)); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function invalidPHPValuesProvider(): iterable { return [ diff --git a/tests/Types/BinaryTest.php b/tests/Types/BinaryTest.php index 45c1bce6a89..c9869467b92 100644 --- a/tests/Types/BinaryTest.php +++ b/tests/Types/BinaryTest.php @@ -80,9 +80,7 @@ public function testThrowsConversionExceptionOnInvalidDatabaseValue($value): voi $this->type->convertToPHPValue($value, $this->platform); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function getInvalidDatabaseValues(): iterable { return [ diff --git a/tests/Types/ConversionExceptionTest.php b/tests/Types/ConversionExceptionTest.php index b5e2e59d8ed..956f094fc14 100644 --- a/tests/Types/ConversionExceptionTest.php +++ b/tests/Types/ConversionExceptionTest.php @@ -74,9 +74,7 @@ public function testConversionFailedFormatPreservesPreviousException(): void self::assertSame($previous, $exception->getPrevious()); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function nonScalarsProvider(): iterable { return [ @@ -86,9 +84,7 @@ public static function nonScalarsProvider(): iterable ]; } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function scalarsProvider(): iterable { return [ diff --git a/tests/Types/DateIntervalTest.php b/tests/Types/DateIntervalTest.php index 732fac35fd5..7defde895f0 100644 --- a/tests/Types/DateIntervalTest.php +++ b/tests/Types/DateIntervalTest.php @@ -104,9 +104,7 @@ public function testInvalidTypeConversionToDatabaseValue($value): void $this->type->convertToDatabaseValue($value, $this->platform); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function invalidPHPValuesProvider(): iterable { return [ diff --git a/tests/Types/JsonTest.php b/tests/Types/JsonTest.php index 8b350115524..5bc96f30c4d 100644 --- a/tests/Types/JsonTest.php +++ b/tests/Types/JsonTest.php @@ -75,9 +75,7 @@ public function testConversionFailure(string $data): void $this->type->convertToPHPValue($data, $this->platform); } - /** - * @return mixed[][] - */ + /** @return mixed[][] */ public static function providerFailure(): iterable { return [['a'], ['{']]; diff --git a/tests/Types/TypeTest.php b/tests/Types/TypeTest.php index efa9e229c3d..b30d9f3a8cd 100644 --- a/tests/Types/TypeTest.php +++ b/tests/Types/TypeTest.php @@ -10,17 +10,13 @@ class TypeTest extends TestCase { - /** - * @dataProvider defaultTypesProvider() - */ + /** @dataProvider defaultTypesProvider() */ public function testDefaultTypesAreRegistered(string $name): void { self::assertTrue(Type::hasType($name)); } - /** - * @return iterable - */ + /** @return iterable */ public function defaultTypesProvider(): iterable { foreach ((new ReflectionClass(Type::class))->getReflectionConstants() as $constant) {