Skip to content

Commit

Permalink
chore(autoloader): Dump autoloader
Browse files Browse the repository at this point in the history
Co-authored-by: nextcloud-command <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
nextcloud-command authored and susnux committed Jan 27, 2025
1 parent 5d3e54e commit 22a4dca
Show file tree
Hide file tree
Showing 125 changed files with 287 additions and 419 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ doctrine/dbal/.doctrine-project.json
doctrine/dbal/.gitmodules
doctrine/dbal/build.*
doctrine/dbal/docs
doctrine/dbal/phpstan-baseline.neon
doctrine/dbal/run-all.sh
doctrine/dbal/static-analysis

Expand Down
1 change: 1 addition & 0 deletions composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,7 @@
'Doctrine\\DBAL\\Exception\\SyntaxErrorException' => $vendorDir . '/doctrine/dbal/src/Exception/SyntaxErrorException.php',
'Doctrine\\DBAL\\Exception\\TableExistsException' => $vendorDir . '/doctrine/dbal/src/Exception/TableExistsException.php',
'Doctrine\\DBAL\\Exception\\TableNotFoundException' => $vendorDir . '/doctrine/dbal/src/Exception/TableNotFoundException.php',
'Doctrine\\DBAL\\Exception\\TransactionRolledBack' => $vendorDir . '/doctrine/dbal/src/Exception/TransactionRolledBack.php',
'Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException' => $vendorDir . '/doctrine/dbal/src/Exception/UniqueConstraintViolationException.php',
'Doctrine\\DBAL\\ExpandArrayParameters' => $vendorDir . '/doctrine/dbal/src/ExpandArrayParameters.php',
'Doctrine\\DBAL\\FetchMode' => $vendorDir . '/doctrine/dbal/src/FetchMode.php',
Expand Down
1 change: 1 addition & 0 deletions composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -1946,6 +1946,7 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
'Doctrine\\DBAL\\Exception\\SyntaxErrorException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/SyntaxErrorException.php',
'Doctrine\\DBAL\\Exception\\TableExistsException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/TableExistsException.php',
'Doctrine\\DBAL\\Exception\\TableNotFoundException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/TableNotFoundException.php',
'Doctrine\\DBAL\\Exception\\TransactionRolledBack' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/TransactionRolledBack.php',
'Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException' => __DIR__ . '/..' . '/doctrine/dbal/src/Exception/UniqueConstraintViolationException.php',
'Doctrine\\DBAL\\ExpandArrayParameters' => __DIR__ . '/..' . '/doctrine/dbal/src/ExpandArrayParameters.php',
'Doctrine\\DBAL\\FetchMode' => __DIR__ . '/..' . '/doctrine/dbal/src/FetchMode.php',
Expand Down
49 changes: 23 additions & 26 deletions composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,17 +546,17 @@
},
{
"name": "doctrine/dbal",
"version": "3.9.1",
"version_normalized": "3.9.1.0",
"version": "3.9.4",
"version_normalized": "3.9.4.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
"reference": "d7dc08f98cba352b2bab5d32c5e58f7e745c11a7"
"reference": "ec16c82f20be1a7224e65ac67144a29199f87959"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/d7dc08f98cba352b2bab5d32c5e58f7e745c11a7",
"reference": "d7dc08f98cba352b2bab5d32c5e58f7e745c11a7",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/ec16c82f20be1a7224e65ac67144a29199f87959",
"reference": "ec16c82f20be1a7224e65ac67144a29199f87959",
"shasum": ""
},
"require": {
Expand All @@ -572,20 +572,18 @@
"doctrine/coding-standard": "12.0.0",
"fig/log-test": "^1",
"jetbrains/phpstorm-stubs": "2023.1",
"phpstan/phpstan": "1.12.0",
"phpstan/phpstan-strict-rules": "^1.6",
"phpunit/phpunit": "9.6.20",
"psalm/plugin-phpunit": "0.18.4",
"phpstan/phpstan": "2.1.1",
"phpstan/phpstan-strict-rules": "^2",
"phpunit/phpunit": "9.6.22",
"slevomat/coding-standard": "8.13.1",
"squizlabs/php_codesniffer": "3.10.2",
"symfony/cache": "^5.4|^6.0|^7.0",
"symfony/console": "^4.4|^5.4|^6.0|^7.0",
"vimeo/psalm": "4.30.0"
"symfony/console": "^4.4|^5.4|^6.0|^7.0"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
},
"time": "2024-09-01T13:49:23+00:00",
"time": "2025-01-16T08:28:55+00:00",
"bin": [
"bin/doctrine-dbal"
],
Expand Down Expand Up @@ -642,7 +640,7 @@
],
"support": {
"issues": "https://github.com/doctrine/dbal/issues",
"source": "https://github.com/doctrine/dbal/tree/3.9.1"
"source": "https://github.com/doctrine/dbal/tree/3.9.4"
},
"funding": [
{
Expand Down Expand Up @@ -710,33 +708,32 @@
},
{
"name": "doctrine/event-manager",
"version": "1.2.0",
"version_normalized": "1.2.0.0",
"version": "2.0.1",
"version_normalized": "2.0.1.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/event-manager.git",
"reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520"
"reference": "b680156fa328f1dfd874fd48c7026c41570b9c6e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/event-manager/zipball/95aa4cb529f1e96576f3fda9f5705ada4056a520",
"reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520",
"url": "https://api.github.com/repos/doctrine/event-manager/zipball/b680156fa328f1dfd874fd48c7026c41570b9c6e",
"reference": "b680156fa328f1dfd874fd48c7026c41570b9c6e",
"shasum": ""
},
"require": {
"doctrine/deprecations": "^0.5.3 || ^1",
"php": "^7.1 || ^8.0"
"php": "^8.1"
},
"conflict": {
"doctrine/common": "<2.9"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^10",
"phpstan/phpstan": "~1.4.10 || ^1.8.8",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"vimeo/psalm": "^4.24"
"doctrine/coding-standard": "^12",
"phpstan/phpstan": "^1.8.8",
"phpunit/phpunit": "^10.5",
"vimeo/psalm": "^5.24"
},
"time": "2022-10-12T20:51:15+00:00",
"time": "2024-05-22T20:47:39+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand Down Expand Up @@ -785,7 +782,7 @@
],
"support": {
"issues": "https://github.com/doctrine/event-manager/issues",
"source": "https://github.com/doctrine/event-manager/tree/1.2.0"
"source": "https://github.com/doctrine/event-manager/tree/2.0.1"
},
"funding": [
{
Expand Down
12 changes: 6 additions & 6 deletions composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@
'dev_requirement' => false,
),
'doctrine/dbal' => array(
'pretty_version' => '3.9.1',
'version' => '3.9.1.0',
'reference' => 'd7dc08f98cba352b2bab5d32c5e58f7e745c11a7',
'pretty_version' => '3.9.4',
'version' => '3.9.4.0',
'reference' => 'ec16c82f20be1a7224e65ac67144a29199f87959',
'type' => 'library',
'install_path' => __DIR__ . '/../doctrine/dbal',
'aliases' => array(),
Expand All @@ -101,9 +101,9 @@
'dev_requirement' => false,
),
'doctrine/event-manager' => array(
'pretty_version' => '1.2.0',
'version' => '1.2.0.0',
'reference' => '95aa4cb529f1e96576f3fda9f5705ada4056a520',
'pretty_version' => '2.0.1',
'version' => '2.0.1.0',
'reference' => 'b680156fa328f1dfd874fd48c7026c41570b9c6e',
'type' => 'library',
'install_path' => __DIR__ . '/../doctrine/event-manager',
'aliases' => array(),
Expand Down
4 changes: 2 additions & 2 deletions doctrine/dbal/src/ArrayParameterType.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ final class ArrayParameterType
/**
* @internal
*
* @psalm-param self::* $type
* @phpstan-param self::* $type
*
* @psalm-return ParameterType::INTEGER|ParameterType::STRING|ParameterType::ASCII|ParameterType::BINARY
* @phpstan-return ParameterType::INTEGER|ParameterType::STRING|ParameterType::ASCII|ParameterType::BINARY
*/
public static function toElementParameterType(int $type): int
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

use function sprintf;

/** @psalm-immutable */
class MissingNamedParameter extends LogicException implements Exception
{
public static function new(string $name): self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@

use function sprintf;

/**
* @internal
*
* @psalm-immutable
*/
/** @internal */
class MissingPositionalParameter extends LogicException implements Exception
{
public static function new(int $index): self
Expand Down
1 change: 0 additions & 1 deletion doctrine/dbal/src/Cache/CacheException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Doctrine\DBAL\Exception;

/** @psalm-immutable */
class CacheException extends Exception
{
/** @return CacheException */
Expand Down
71 changes: 54 additions & 17 deletions doctrine/dbal/src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@
use Doctrine\DBAL\Cache\QueryCacheProfile;
use Doctrine\DBAL\Driver\API\ExceptionConverter;
use Doctrine\DBAL\Driver\Connection as DriverConnection;
use Doctrine\DBAL\Driver\Exception as TheDriverException;
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
use Doctrine\DBAL\Driver\Statement as DriverStatement;
use Doctrine\DBAL\Event\TransactionBeginEventArgs;
use Doctrine\DBAL\Event\TransactionCommitEventArgs;
use Doctrine\DBAL\Event\TransactionRollBackEventArgs;
use Doctrine\DBAL\Exception\ConnectionLost;
use Doctrine\DBAL\Exception\DeadlockException;
use Doctrine\DBAL\Exception\DriverException;
use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException;
use Doctrine\DBAL\Exception\InvalidArgumentException;
use Doctrine\DBAL\Exception\TransactionRolledBack;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Query\Expression\ExpressionBuilder;
use Doctrine\DBAL\Query\QueryBuilder;
Expand Down Expand Up @@ -48,8 +53,8 @@
* A database abstraction-level connection that implements features like events, transaction isolation levels,
* configuration, emulated transaction nesting, lazy connecting and more.
*
* @psalm-import-type Params from DriverManager
* @psalm-consistent-constructor
* @phpstan-import-type Params from DriverManager
* @phpstan-consistent-constructor
*/
class Connection
{
Expand Down Expand Up @@ -131,7 +136,7 @@ class Connection
* The parameters used during creation of the Connection instance.
*
* @var array<string,mixed>
* @psalm-var Params
* @phpstan-var Params
*/
private array $params;

Expand Down Expand Up @@ -175,7 +180,7 @@ class Connection
* @param Driver $driver The driver to use.
* @param Configuration|null $config The configuration, optional.
* @param EventManager|null $eventManager The event manager, optional.
* @psalm-param Params $params
* @phpstan-param Params $params
*
* @throws Exception
*/
Expand Down Expand Up @@ -239,7 +244,7 @@ public function __construct(
* @internal
*
* @return array<string,mixed>
* @psalm-return Params
* @phpstan-return Params
*/
public function getParams()
{
Expand Down Expand Up @@ -360,7 +365,7 @@ public function getExpressionBuilder()
*
* @throws Exception
*
* @psalm-assert !null $this->_conn
* @phpstan-assert !null $this->_conn
*/
public function connect()
{
Expand Down Expand Up @@ -1278,16 +1283,41 @@ public function lastInsertId($name = null)
public function transactional(Closure $func)
{
$this->beginTransaction();

$successful = false;

try {
$res = $func($this);

$successful = true;
} finally {
if (! $successful) {
$this->rollBack();
}
}

$shouldRollback = true;
try {
$this->commit();

return $res;
} catch (Throwable $e) {
$this->rollBack();
$shouldRollback = false;
} catch (TheDriverException $t) {
$convertedException = $this->handleDriverException($t, null);
$shouldRollback = ! (
$convertedException instanceof TransactionRolledBack
|| $convertedException instanceof UniqueConstraintViolationException
|| $convertedException instanceof ForeignKeyConstraintViolationException
|| $convertedException instanceof DeadlockException
);

throw $e;
throw $t;
} finally {
if ($shouldRollback) {
$this->rollBack();
}
}

return $res;
}

/**
Expand Down Expand Up @@ -1419,12 +1449,21 @@ public function commit()

$connection = $this->getWrappedConnection();

if ($this->transactionNestingLevel === 1) {
$result = $this->doCommit($connection);
} elseif ($this->nestTransactionsWithSavepoints) {
$this->releaseSavepoint($this->_getNestedTransactionSavePointName());
try {
if ($this->transactionNestingLevel === 1) {
$result = $this->doCommit($connection);
} elseif ($this->nestTransactionsWithSavepoints) {
$this->releaseSavepoint($this->_getNestedTransactionSavePointName());
}
} finally {
$this->updateTransactionStateAfterCommit();
}

return $result;
}

private function updateTransactionStateAfterCommit(): void
{
--$this->transactionNestingLevel;

$eventManager = $this->getEventManager();
Expand All @@ -1441,12 +1480,10 @@ public function commit()
}

if ($this->autoCommit !== false || $this->transactionNestingLevel !== 0) {
return $result;
return;
}

$this->beginTransaction();

return $result;
}

/**
Expand Down
1 change: 0 additions & 1 deletion doctrine/dbal/src/ConnectionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Doctrine\DBAL;

/** @psalm-immutable */
class ConnectionException extends Exception
{
/** @return ConnectionException */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
*
* Instantiation through the DriverManager looks like:
*
* @psalm-import-type Params from DriverManager
* @phpstan-import-type Params from DriverManager
* @example
*
* $conn = DriverManager::getConnection(array(
Expand Down Expand Up @@ -98,7 +98,7 @@ class PrimaryReadReplicaConnection extends Connection
* @internal The connection can be only instantiated by the driver manager.
*
* @param array<string,mixed> $params
* @psalm-param Params $params
* @phpstan-param Params $params
*
* @throws Exception
* @throws InvalidArgumentException
Expand Down
4 changes: 2 additions & 2 deletions doctrine/dbal/src/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
* Driver interface.
* Interface that all DBAL drivers must implement.
*
* @psalm-import-type Params from DriverManager
* @phpstan-import-type Params from DriverManager
*/
interface Driver
{
/**
* Attempts to create a connection with the database.
*
* @param array<string, mixed> $params All connection parameters.
* @psalm-param Params $params All connection parameters.
* @phpstan-param Params $params All connection parameters.
*
* @return DriverConnection The database connection.
*
Expand Down
Loading

0 comments on commit 22a4dca

Please sign in to comment.