Skip to content

Commit

Permalink
Merge pull request #92 from facile-it/dependabot/composer/facile-it/f…
Browse files Browse the repository at this point in the history
…acile-coding-standard-tw-1.2.0

Update facile-it/facile-coding-standard requirement from ^0.5.2 to ^1.2.0
  • Loading branch information
Jean85 authored Sep 26, 2024
2 parents 7b94e71 + a37766e commit 216bf78
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"require-dev": {
"ext-pdo": "*",
"facile-it/facile-coding-standard": "^0.5.2",
"facile-it/facile-coding-standard": "^1.2.0",
"infection/infection": "^0.27.10",
"phpdocumentor/reflection-docblock": ">=4.0.1",
"phpspec/prophecy-phpunit": "^2.0",
Expand Down
4 changes: 1 addition & 3 deletions src/ConnectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@

use Doctrine\DBAL\Driver\Connection as DriverConnection;

interface ConnectionInterface extends DriverConnection
{
}
interface ConnectionInterface extends DriverConnection {}
9 changes: 3 additions & 6 deletions src/ConnectionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ public function resetAttemptCount(): void
$this->currentAttempts = 0;
}

/**
* @param string $connectionName
*/
public function connect(?string $connectionName = null): DriverConnection
{
$this->hasBeenClosedWithAnOpenTransaction = false;
Expand Down Expand Up @@ -147,13 +144,13 @@ public function prepare(string $sql): DBALStatement
}

/**
* @param list<mixed>|array<string, mixed> $params
* @param list<mixed>|array<string, mixed> $params
*
* @psalm-param WrapperParameterTypeArray $types
*/
public function executeQuery(string $sql, array $params = [], $types = [], ?QueryCacheProfile $qcp = null): Result
{
return $this->doWithRetry(fn (): Result => parent::executeQuery($sql, $params, $types, $qcp), $sql);
return $this->doWithRetry(fn(): Result => parent::executeQuery($sql, $params, $types, $qcp), $sql);
}

/**
Expand All @@ -167,7 +164,7 @@ public function executeQuery(string $sql, array $params = [], $types = [], ?Quer
*/
public function executeStatement(string $sql, array $params = [], array $types = []): int|string
{
return $this->doWithRetry(fn () => parent::executeStatement($sql, $params, $types), $sql);
return $this->doWithRetry(fn() => parent::executeStatement($sql, $params, $types), $sql);
}

public function beginTransaction(): void
Expand Down
4 changes: 2 additions & 2 deletions src/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ public function bindValue(string|int $param, mixed $value, string|ParameterType|

public function executeQuery(): Result
{
return $this->executeWithRetry(fn (): Result => parent::executeQuery());
return $this->executeWithRetry(fn(): Result => parent::executeQuery());
}

public function executeStatement(): int|string
{
return $this->executeWithRetry(fn (): int|string => parent::executeStatement());
return $this->executeWithRetry(fn(): int|string => parent::executeStatement());
}

/**
Expand Down
14 changes: 7 additions & 7 deletions tests/Functional/AbstractFunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ protected function createTestTable(DBALConnection $connection): void
{
$connection->executeStatement(
<<<'TABLE_WRAP'
CREATE TABLE IF NOT EXISTS test (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
updatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP()
);
TABLE_WRAP
CREATE TABLE IF NOT EXISTS test (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
updatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP()
);
TABLE_WRAP
);

$connection->executeStatement('DELETE FROM `test`;');
Expand Down Expand Up @@ -98,7 +98,7 @@ protected function getConnectionParams(): array
'user' => getenv('MYSQL_USER') !== false ? getenv('MYSQL_USER') : ($GLOBALS['db_user'] ?? 'root'),
'password' => getenv('MYSQL_PASS') !== false ? getenv('MYSQL_PASS') : ($GLOBALS['db_pass'] ?? ''),
'host' => getenv('MYSQL_HOST') !== false ? getenv('MYSQL_HOST') : ($GLOBALS['db_host'] ?? 'localhost'),
'port' => (int) (getenv('MYSQL_PORT') !== false ? getenv('MYSQL_PORT') : ($GLOBALS['db_port'] ?? 3306)),
'port' => (int) (getenv('MYSQL_PORT') !== false ? getenv('MYSQL_PORT') : ($GLOBALS['db_port'] ?? 3_306)),
];

if ($values['driver'] !== 'pdo_mysql') {
Expand All @@ -114,7 +114,7 @@ protected function getConnectionParams(): array
}

/**
* Disconnect other sessions
* Disconnect other sessions.
*/
protected function forceDisconnect(DBALConnection $connection): void
{
Expand Down

0 comments on commit 216bf78

Please sign in to comment.