Skip to content

Commit

Permalink
Update doctrine/coding-standard to 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Jun 6, 2020
1 parent acf84c3 commit dbc623d
Show file tree
Hide file tree
Showing 328 changed files with 2,745 additions and 2,430 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@
"doctrine/event-manager": "^1.0"
},
"require-dev": {
"doctrine/coding-standard": "^7.0",
"doctrine/coding-standard": "^8.0",
"jetbrains/phpstorm-stubs": "^2019.1",
"nikic/php-parser": "^4.4",
"phpstan/phpstan": "^0.12",
"phpunit/phpunit": "^8.5.5",
"psalm/plugin-phpunit": "^0.10.0",
"slevomat/coding-standard": "^6.3.6",
"symfony/console": "^2.0.5|^3.0|^4.0|^5.0",
"vimeo/psalm": "^3.11.4"
},
Expand Down
63 changes: 36 additions & 27 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions lib/Doctrine/DBAL/Cache/ArrayStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use InvalidArgumentException;
use IteratorAggregate;
use PDO;

use function array_merge;
use function array_values;
use function count;
Expand Down Expand Up @@ -188,23 +189,23 @@ public function fetchOne()
/**
* {@inheritdoc}
*/
public function fetchAllNumeric() : array
public function fetchAllNumeric(): array
{
return FetchUtils::fetchAllNumeric($this);
}

/**
* {@inheritdoc}
*/
public function fetchAllAssociative() : array
public function fetchAllAssociative(): array
{
return FetchUtils::fetchAllAssociative($this);
}

/**
* {@inheritdoc}
*/
public function fetchFirstColumn() : array
public function fetchFirstColumn(): array
{
return FetchUtils::fetchFirstColumn($this);
}
Expand Down
1 change: 1 addition & 0 deletions lib/Doctrine/DBAL/Cache/QueryCacheProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Doctrine\DBAL\Cache;

use Doctrine\Common\Cache\Cache;

use function hash;
use function serialize;
use function sha1;
Expand Down
9 changes: 5 additions & 4 deletions lib/Doctrine/DBAL/Cache/ResultCacheStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use InvalidArgumentException;
use IteratorAggregate;
use PDO;

use function array_map;
use function array_merge;
use function array_values;
Expand Down Expand Up @@ -248,7 +249,7 @@ public function fetchOne()
/**
* {@inheritdoc}
*/
public function fetchAllNumeric() : array
public function fetchAllNumeric(): array
{
if ($this->statement instanceof ForwardCompatibleResultStatement) {
$data = $this->statement->fetchAllAssociative();
Expand All @@ -264,7 +265,7 @@ public function fetchAllNumeric() : array
/**
* {@inheritdoc}
*/
public function fetchAllAssociative() : array
public function fetchAllAssociative(): array
{
if ($this->statement instanceof ForwardCompatibleResultStatement) {
$data = $this->statement->fetchAllAssociative();
Expand All @@ -280,7 +281,7 @@ public function fetchAllAssociative() : array
/**
* {@inheritdoc}
*/
public function fetchFirstColumn() : array
public function fetchFirstColumn(): array
{
return FetchUtils::fetchFirstColumn($this);
}
Expand Down Expand Up @@ -334,7 +335,7 @@ private function doFetch()
/**
* @param array<int,array<string,mixed>> $data
*/
private function store(array $data) : void
private function store(array $data): void
{
$this->data = $data;
$this->emptied = true;
Expand Down
7 changes: 4 additions & 3 deletions lib/Doctrine/DBAL/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Doctrine\Common\Cache\Cache;
use Doctrine\DBAL\Logging\SQLLogger;
use Doctrine\DBAL\Schema\AbstractAsset;

use function preg_match;

/**
Expand Down Expand Up @@ -101,7 +102,7 @@ public function getFilterSchemaAssetsExpression()
/**
* @param string $filterExpression
*/
private function buildSchemaAssetsFilterFromExpression($filterExpression) : callable
private function buildSchemaAssetsFilterFromExpression($filterExpression): callable
{
return static function ($assetName) use ($filterExpression) {
if ($assetName instanceof AbstractAsset) {
Expand All @@ -115,7 +116,7 @@ private function buildSchemaAssetsFilterFromExpression($filterExpression) : call
/**
* Sets the callable to use to filter schema assets.
*/
public function setSchemaAssetsFilter(?callable $callable = null) : ?callable
public function setSchemaAssetsFilter(?callable $callable = null): ?callable
{
$this->_attributes['filterSchemaAssetsExpression'] = null;

Expand All @@ -125,7 +126,7 @@ public function setSchemaAssetsFilter(?callable $callable = null) : ?callable
/**
* Returns the callable to use to filter schema assets.
*/
public function getSchemaAssetsFilter() : ?callable
public function getSchemaAssetsFilter(): ?callable
{
return $this->_attributes['filterSchemaAssetsExpressionCallable'] ?? null;
}
Expand Down
19 changes: 10 additions & 9 deletions lib/Doctrine/DBAL/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Exception;
use Throwable;
use Traversable;

use function array_key_exists;
use function assert;
use function func_get_args;
Expand Down Expand Up @@ -385,7 +386,7 @@ public function connect()
*
* @throws DBALException If an invalid platform was specified for this connection.
*/
private function detectDatabasePlatform() : void
private function detectDatabasePlatform(): void
{
$version = $this->getDatabasePlatformVersion();

Expand Down Expand Up @@ -714,7 +715,7 @@ private function addIdentifierCondition(
array &$columns,
array &$values,
array &$conditions
) : void {
): void {
$platform = $this->getDatabasePlatform();

foreach ($identifier as $columnName => $value) {
Expand Down Expand Up @@ -950,7 +951,7 @@ public function fetchAll($sql, array $params = [], $types = [])
*
* @throws DBALException
*/
public function fetchAllNumeric(string $query, array $params = [], array $types = []) : array
public function fetchAllNumeric(string $query, array $params = [], array $types = []): array
{
try {
$stmt = $this->executeQuery($query, $params, $types);
Expand All @@ -976,7 +977,7 @@ public function fetchAllNumeric(string $query, array $params = [], array $types
*
* @throws DBALException
*/
public function fetchAllAssociative(string $query, array $params = [], array $types = []) : array
public function fetchAllAssociative(string $query, array $params = [], array $types = []): array
{
try {
$stmt = $this->executeQuery($query, $params, $types);
Expand All @@ -1002,7 +1003,7 @@ public function fetchAllAssociative(string $query, array $params = [], array $ty
*
* @throws DBALException
*/
public function fetchFirstColumn(string $query, array $params = [], array $types = []) : array
public function fetchFirstColumn(string $query, array $params = [], array $types = []): array
{
try {
$stmt = $this->executeQuery($query, $params, $types);
Expand All @@ -1028,7 +1029,7 @@ public function fetchFirstColumn(string $query, array $params = [], array $types
*
* @throws DBALException
*/
public function iterateNumeric(string $query, array $params = [], array $types = []) : Traversable
public function iterateNumeric(string $query, array $params = [], array $types = []): Traversable
{
try {
$stmt = $this->executeQuery($query, $params, $types);
Expand Down Expand Up @@ -1056,7 +1057,7 @@ public function iterateNumeric(string $query, array $params = [], array $types =
*
* @throws DBALException
*/
public function iterateAssociative(string $query, array $params = [], array $types = []) : Traversable
public function iterateAssociative(string $query, array $params = [], array $types = []): Traversable
{
try {
$stmt = $this->executeQuery($query, $params, $types);
Expand Down Expand Up @@ -1084,7 +1085,7 @@ public function iterateAssociative(string $query, array $params = [], array $typ
*
* @throws DBALException
*/
public function iterateColumn(string $query, array $params = [], array $types = []) : Traversable
public function iterateColumn(string $query, array $params = [], array $types = []): Traversable
{
try {
$stmt = $this->executeQuery($query, $params, $types);
Expand Down Expand Up @@ -1585,7 +1586,7 @@ public function commit()
/**
* Commits all current nesting transactions.
*/
private function commitAll() : void
private function commitAll(): void
{
while ($this->transactionNestingLevel !== 0) {
if ($this->autoCommit === false && $this->transactionNestingLevel === 1) {
Expand Down
1 change: 1 addition & 0 deletions lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Doctrine\DBAL\Event\ConnectionEventArgs;
use Doctrine\DBAL\Events;
use InvalidArgumentException;

use function array_rand;
use function assert;
use function count;
Expand Down
Loading

0 comments on commit dbc623d

Please sign in to comment.