Unverified Commit d4c78642 authored by Grégoire Paris's avatar Grégoire Paris

Merge branch '3.0.x'

parents 18908c39 80306bce
name: "Continuous Integration"
on:
pull_request:
jobs:
static-analysis-psalm:
name: Static Analysis with Psalm
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: "Install PHP"
uses: "shivammathur/setup-php@1.8.1"
with:
coverage: "none"
php-version: "7.4"
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1.0.3"
with:
path: "~/.composer/cache"
key: "composer-${{ hashFiles('composer.json') }}"
restore-keys: "composer-"
- name: "Install dependencies with composer"
run: "composer update --no-interaction --no-progress --no-suggest"
- name: Psalm
run: "vendor/bin/psalm"
......@@ -40,11 +40,13 @@
"require-dev": {
"doctrine/coding-standard": "^7.0",
"jetbrains/phpstorm-stubs": "^2019.1",
"nikic/php-parser": "^4.4",
"phpstan/phpstan": "^0.12.18",
"phpstan/phpstan-phpunit": "^0.12",
"phpstan/phpstan-strict-rules": "^0.12.2",
"phpunit/phpunit": "^9.1.1",
"symfony/console": "^2.0.5|^3.0|^4.0|^5.0"
"symfony/console": "^2.0.5|^3.0|^4.0|^5.0",
"vimeo/psalm": "^3.11"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c4f3212f2eb936c849f99146f9ad2d9c",
"content-hash": "380f0866b260bf8eb74733a2461f927f",
"packages": [
{
"name": "doctrine/cache",
......@@ -206,6 +206,260 @@
}
],
"packages-dev": [
{
"name": "amphp/amp",
"version": "v2.4.2",
"source": {
"type": "git",
"url": "https://github.com/amphp/amp.git",
"reference": "feca077369a47263b22156b3c6389e55f3809f24"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/amphp/amp/zipball/feca077369a47263b22156b3c6389e55f3809f24",
"reference": "feca077369a47263b22156b3c6389e55f3809f24",
"shasum": ""
},
"require": {
"php": ">=7"
},
"require-dev": {
"amphp/php-cs-fixer-config": "dev-master",
"amphp/phpunit-util": "^1",
"ext-json": "*",
"jetbrains/phpstorm-stubs": "^2019.3",
"phpunit/phpunit": "^6.0.9 | ^7",
"react/promise": "^2",
"vimeo/psalm": "^3.9@dev"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"autoload": {
"psr-4": {
"Amp\\": "lib"
},
"files": [
"lib/functions.php",
"lib/Internal/functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Daniel Lowrey",
"email": "rdlowrey@php.net"
},
{
"name": "Aaron Piotrowski",
"email": "aaron@trowski.com"
},
{
"name": "Bob Weinand",
"email": "bobwei9@hotmail.com"
},
{
"name": "Niklas Keller",
"email": "me@kelunik.com"
}
],
"description": "A non-blocking concurrency framework for PHP applications.",
"homepage": "http://amphp.org/amp",
"keywords": [
"async",
"asynchronous",
"awaitable",
"concurrency",
"event",
"event-loop",
"future",
"non-blocking",
"promise"
],
"time": "2020-04-04T15:05:26+00:00"
},
{
"name": "amphp/byte-stream",
"version": "v1.7.3",
"source": {
"type": "git",
"url": "https://github.com/amphp/byte-stream.git",
"reference": "b867505edb79dda8f253ca3c3a2bbadae4b16592"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/amphp/byte-stream/zipball/b867505edb79dda8f253ca3c3a2bbadae4b16592",
"reference": "b867505edb79dda8f253ca3c3a2bbadae4b16592",
"shasum": ""
},
"require": {
"amphp/amp": "^2"
},
"require-dev": {
"amphp/php-cs-fixer-config": "dev-master",
"amphp/phpunit-util": "^1",
"friendsofphp/php-cs-fixer": "^2.3",
"jetbrains/phpstorm-stubs": "^2019.3",
"phpunit/phpunit": "^6 || ^7 || ^8",
"vimeo/psalm": "^3.9@dev"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"Amp\\ByteStream\\": "lib"
},
"files": [
"lib/functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Aaron Piotrowski",
"email": "aaron@trowski.com"
},
{
"name": "Niklas Keller",
"email": "me@kelunik.com"
}
],
"description": "A stream abstraction to make working with non-blocking I/O simple.",
"homepage": "http://amphp.org/byte-stream",
"keywords": [
"amp",
"amphp",
"async",
"io",
"non-blocking",
"stream"
],
"time": "2020-04-04T16:56:54+00:00"
},
{
"name": "composer/semver",
"version": "1.5.1",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
"reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/semver/zipball/c6bea70230ef4dd483e6bbcab6005f682ed3a8de",
"reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.5 || ^5.0.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"Composer\\Semver\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nils Adermann",
"email": "naderman@naderman.de",
"homepage": "http://www.naderman.de"
},
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be"
},
{
"name": "Rob Bast",
"email": "rob.bast@gmail.com",
"homepage": "http://robbast.nl"
}
],
"description": "Semver library that offers utilities, version constraint parsing and validation.",
"keywords": [
"semantic",
"semver",
"validation",
"versioning"
],
"time": "2020-01-13T12:06:48+00:00"
},
{
"name": "composer/xdebug-handler",
"version": "1.4.1",
"source": {
"type": "git",
"url": "https://github.com/composer/xdebug-handler.git",
"reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/xdebug-handler/zipball/1ab9842d69e64fb3a01be6b656501032d1b78cb7",
"reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0 || ^8.0",
"psr/log": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8"
},
"type": "library",
"autoload": {
"psr-4": {
"Composer\\XdebugHandler\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "John Stevenson",
"email": "john-stevenson@blueyonder.co.uk"
}
],
"description": "Restarts a process without Xdebug.",
"keywords": [
"Xdebug",
"performance"
],
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
}
],
"time": "2020-03-01T12:26:26+00:00"
},
{
"name": "dealerdirect/phpcodesniffer-composer-installer",
"version": "v0.5.0",
......@@ -389,6 +643,94 @@
],
"time": "2019-10-21T16:45:58+00:00"
},
{
"name": "felixfbecker/advanced-json-rpc",
"version": "v3.1.1",
"source": {
"type": "git",
"url": "https://github.com/felixfbecker/php-advanced-json-rpc.git",
"reference": "0ed363f8de17d284d479ec813c9ad3f6834b5c40"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/0ed363f8de17d284d479ec813c9ad3f6834b5c40",
"reference": "0ed363f8de17d284d479ec813c9ad3f6834b5c40",
"shasum": ""
},
"require": {
"netresearch/jsonmapper": "^1.0 || ^2.0",
"php": ">=7.0",
"phpdocumentor/reflection-docblock": "^4.0.0 || ^5.0.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0.0"
},
"type": "library",
"autoload": {
"psr-4": {
"AdvancedJsonRpc\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"ISC"
],
"authors": [
{
"name": "Felix Becker",
"email": "felix.b@outlook.com"
}
],
"description": "A more advanced JSONRPC implementation",
"time": "2020-03-11T15:21:41+00:00"
},
{
"name": "felixfbecker/language-server-protocol",
"version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/felixfbecker/php-language-server-protocol.git",
"reference": "378801f6139bb74ac215d81cca1272af61df9a9f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/378801f6139bb74ac215d81cca1272af61df9a9f",
"reference": "378801f6139bb74ac215d81cca1272af61df9a9f",
"shasum": ""
},
"require": {
"php": "^7.0"
},
"require-dev": {
"phpstan/phpstan": "*",
"phpunit/phpunit": "^6.3",
"squizlabs/php_codesniffer": "^3.1"
},
"type": "library",
"autoload": {
"psr-4": {
"LanguageServerProtocol\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"ISC"
],
"authors": [
{
"name": "Felix Becker",
"email": "felix.b@outlook.com"
}
],
"description": "PHP classes for the Language Server Protocol",
"keywords": [
"language",
"microsoft",
"php",
"server"
],
"time": "2019-06-23T21:03:50+00:00"
},
{
"name": "jetbrains/phpstorm-stubs",
"version": "v2019.1",
......@@ -476,6 +818,153 @@
],
"time": "2020-01-17T21:11:47+00:00"
},
{
"name": "netresearch/jsonmapper",
"version": "v2.1.0",
"source": {
"type": "git",
"url": "https://github.com/cweiske/jsonmapper.git",
"reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/e0f1e33a71587aca81be5cffbb9746510e1fe04e",
"reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-pcre": "*",
"ext-reflection": "*",
"ext-spl": "*",
"php": ">=5.6"
},
"require-dev": {
"phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4 || ~7.0",
"squizlabs/php_codesniffer": "~3.5"
},
"type": "library",
"autoload": {
"psr-0": {
"JsonMapper": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"OSL-3.0"
],
"authors": [
{
"name": "Christian Weiske",
"email": "cweiske@cweiske.de",
"homepage": "http://github.com/cweiske/jsonmapper/",
"role": "Developer"
}
],
"description": "Map nested JSON structures onto PHP classes",
"time": "2020-04-16T18:48:43+00:00"
},
{
"name": "nikic/php-parser",
"version": "v4.4.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120",
"reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=7.0"
},
"require-dev": {
"ircmaxell/php-yacc": "0.0.5",
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0"
},
"bin": [
"bin/php-parse"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.3-dev"
}
},
"autoload": {
"psr-4": {
"PhpParser\\": "lib/PhpParser"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Nikita Popov"
}
],
"description": "A PHP parser written in PHP",
"keywords": [
"parser",
"php"
],
"time": "2020-04-10T16:34:50+00:00"
},
{
"name": "openlss/lib-array2xml",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/nullivex/lib-array2xml.git",
"reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90",
"reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"autoload": {
"psr-0": {
"LSS": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Bryan Tong",
"email": "bryan@nullivex.com",
"homepage": "https://www.nullivex.com"
},
{
"name": "Tony Butler",
"email": "spudz76@gmail.com",
"homepage": "https://www.nullivex.com"
}
],
"description": "Array2XML conversion library credit to lalit.org",
"homepage": "https://www.nullivex.com",
"keywords": [
"array",
"array conversion",
"xml",
"xml conversion"
],
"time": "2019-03-29T20:06:56+00:00"
},
{
"name": "phar-io/manifest",
"version": "1.0.3",
......@@ -2547,13 +3036,111 @@
"authors": [
{
"name": "Arne Blankerts",
"role": "Developer",
"email": "arne@blankerts.de"
"email": "arne@blankerts.de",
"role": "Developer"
}
],
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
"time": "2019-06-13T22:48:21+00:00"
},
{
"name": "vimeo/psalm",
"version": "3.11.2",
"source": {
"type": "git",
"url": "https://github.com/vimeo/psalm.git",
"reference": "d470903722cfcbc1cd04744c5491d3e6d13ec3d9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vimeo/psalm/zipball/d470903722cfcbc1cd04744c5491d3e6d13ec3d9",
"reference": "d470903722cfcbc1cd04744c5491d3e6d13ec3d9",
"shasum": ""
},
"require": {
"amphp/amp": "^2.1",
"amphp/byte-stream": "^1.5",
"composer/semver": "^1.4",
"composer/xdebug-handler": "^1.1",
"ext-dom": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-simplexml": "*",
"ext-tokenizer": "*",
"felixfbecker/advanced-json-rpc": "^3.0.3",
"felixfbecker/language-server-protocol": "^1.4",
"netresearch/jsonmapper": "^1.0 || ^2.0",
"nikic/php-parser": "^4.3",
"ocramius/package-versions": "^1.2",
"openlss/lib-array2xml": "^1.0",
"php": "^7.1.3|^8",
"sebastian/diff": "^3.0 || ^4.0",
"symfony/console": "^3.4.17 || ^4.1.6 || ^5.0",
"webmozart/glob": "^4.1",
"webmozart/path-util": "^2.3"
},
"provide": {
"psalm/psalm": "self.version"
},
"require-dev": {
"amphp/amp": "^2.4.2",
"bamarni/composer-bin-plugin": "^1.2",
"brianium/paratest": "^4.0.0",
"ext-curl": "*",
"php-coveralls/php-coveralls": "^2.2",
"phpmyadmin/sql-parser": "5.1.0",
"phpspec/prophecy": ">=1.9.0",
"phpunit/phpunit": "^7.5.16 || ^8.5 || ^9.0",
"psalm/plugin-phpunit": "^0.10",
"slevomat/coding-standard": "^5.0",
"squizlabs/php_codesniffer": "^3.5",
"symfony/process": "^4.3"
},
"suggest": {
"ext-igbinary": "^2.0.5"
},
"bin": [
"psalm",
"psalm-language-server",
"psalm-plugin",
"psalm-refactor",
"psalter"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev",
"dev-2.x": "2.x-dev",
"dev-1.x": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"Psalm\\Plugin\\": "src/Psalm/Plugin",
"Psalm\\": "src/Psalm"
},
"files": [
"src/functions.php",
"src/spl_object_id.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Matthew Brown"
}
],
"description": "A static analysis tool for finding errors in PHP applications",
"keywords": [
"code",
"inspection",
"php"
],
"time": "2020-04-13T12:47:11+00:00"
},
{
"name": "webmozart/assert",
"version": "1.7.0",
......@@ -2601,6 +3188,99 @@
"validate"
],
"time": "2020-02-14T12:15:55+00:00"
},
{
"name": "webmozart/glob",
"version": "4.1.0",
"source": {
"type": "git",
"url": "https://github.com/webmozart/glob.git",
"reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/glob/zipball/3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe",
"reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe",
"shasum": ""
},
"require": {
"php": "^5.3.3|^7.0",
"webmozart/path-util": "^2.2"
},
"require-dev": {
"phpunit/phpunit": "^4.6",
"sebastian/version": "^1.0.1",
"symfony/filesystem": "^2.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
}
},
"autoload": {
"psr-4": {
"Webmozart\\Glob\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bernhard Schussek",
"email": "bschussek@gmail.com"
}
],
"description": "A PHP implementation of Ant's glob.",
"time": "2015-12-29T11:14:33+00:00"
},
{
"name": "webmozart/path-util",
"version": "2.3.0",
"source": {
"type": "git",
"url": "https://github.com/webmozart/path-util.git",
"reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725",
"reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"webmozart/assert": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "^4.6",
"sebastian/version": "^1.0.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.3-dev"
}
},
"autoload": {
"psr-4": {
"Webmozart\\PathUtil\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bernhard Schussek",
"email": "bschussek@gmail.com"
}
],
"description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.",
"time": "2015-12-17T08:42:14+00:00"
}
],
"aliases": [],
......
<?xml version="1.0"?>
<psalm
totallyTyped="false"
errorLevel="8"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
<directory name="tests" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<stubs>
<file name="vendor/jetbrains/phpstorm-stubs/PDO/PDO.php" />
<file name="vendor/jetbrains/phpstorm-stubs/ibm_db2/ibm_db2.php" />
<file name="vendor/jetbrains/phpstorm-stubs/mysqli/mysqli.php" />
<file name="vendor/jetbrains/phpstorm-stubs/oci8/oci8.php" />
<file name="vendor/jetbrains/phpstorm-stubs/pgsql/pgsql.php" />
<file name="vendor/jetbrains/phpstorm-stubs/sqlsrv/sqlsrv.php" />
</stubs>
<issueHandlers>
<ImpureMethodCall>
<errorLevel type="suppress">
<!--
Requires a release of
https://github.com/vimeo/psalm/pull/3171
-->
<file name="src/Exception/DriverException.php"/>
</errorLevel>
</ImpureMethodCall>
<TooFewArguments>
<errorLevel type="suppress">
<!--
Requires a release of
https://github.com/JetBrains/phpstorm-stubs/pull/727
-->
<file name="src/Driver/SQLSrv/SQLSrvStatement.php"/>
</errorLevel>
</TooFewArguments>
<UndefinedConstant>
<errorLevel type="suppress">
<directory name="src/Driver/SQLAnywhere"/>
<!--
Requires a release of
https://github.com/JetBrains/phpstorm-stubs/pull/732
-->
<file name="tests/Driver/PDOPgSql/DriverTest.php" />
</errorLevel>
</UndefinedConstant>
<UndefinedFunction>
<errorLevel type="suppress">
<directory name="src/Driver/SQLAnywhere"/>
</errorLevel>
</UndefinedFunction>
<UndefinedClass>
<errorLevel type="suppress">
<!-- Contains references to optional dependencies -->
<file name="src/Tools/Dumper.php"/>
</errorLevel>
</UndefinedClass>
</issueHandlers>
</psalm>
......@@ -6,6 +6,9 @@ namespace Doctrine\DBAL\Cache;
use Doctrine\DBAL\DBALException;
/**
* @psalm-immutable
*/
class CacheException extends DBALException
{
}
......@@ -6,6 +6,9 @@ namespace Doctrine\DBAL\Cache\Exception;
use Doctrine\DBAL\Cache\CacheException;
/**
* @psalm-immutable
*/
final class NoCacheKey extends CacheException
{
public static function new() : self
......
......@@ -6,6 +6,9 @@ namespace Doctrine\DBAL\Cache\Exception;
use Doctrine\DBAL\Cache\CacheException;
/**
* @psalm-immutable
*/
final class NoResultDriverConfigured extends CacheException
{
public static function new() : self
......
......@@ -4,6 +4,9 @@ declare(strict_types=1);
namespace Doctrine\DBAL;
/**
* @psalm-immutable
*/
class ConnectionException extends DBALException
{
}
......@@ -18,6 +18,9 @@ use function json_encode;
use function preg_replace;
use function sprintf;
/**
* @psalm-immutable
*/
class DBALException extends Exception
{
/**
......
......@@ -9,6 +9,8 @@ use Throwable;
/**
* Abstract base implementation of the {@link DriverException} interface.
*
* @psalm-immutable
*/
abstract class AbstractDriverException extends Exception implements DriverException
{
......
......@@ -11,6 +11,8 @@ use Throwable;
*
* Driver exceptions provide the SQLSTATE of the driver
* and the driver specific error code at the time the error occurred.
*
* @psalm-immutable
*/
interface DriverException extends Throwable
{
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Driver\Exception;
use Doctrine\DBAL\DBALException;
use function sprintf;
/**
* @psalm-immutable
*/
final class UnknownFetchMode extends DBALException
{
public static function new(int $fetchMode) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Driver\Exception;
use Doctrine\DBAL\DBALException;
use function sprintf;
/**
* @psalm-immutable
*/
final class UnknownParamType extends DBALException
{
public static function new(int $type) : self
......
......@@ -10,6 +10,9 @@ use function db2_conn_errormsg;
use function db2_stmt_error;
use function db2_stmt_errormsg;
/**
* @psalm-immutable
*/
class DB2Exception extends AbstractDriverException
{
/**
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Driver\Mysqli\Exception;
use Doctrine\DBAL\Driver\Mysqli\MysqliException;
use mysqli;
/**
* @psalm-immutable
*/
final class ConnectionError extends MysqliException
{
public static function new(mysqli $connection) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Driver\Mysqli\Exception;
use Doctrine\DBAL\Driver\Mysqli\MysqliException;
use function sprintf;
/**
* @psalm-immutable
*/
final class FailedReadingStreamOffset extends MysqliException
{
public static function new(int $offset) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Driver\Mysqli\Exception;
use Doctrine\DBAL\Driver\Mysqli\MysqliException;
use mysqli_stmt;
/**
* @psalm-immutable
*/
final class StatementError extends MysqliException
{
public static function new(mysqli_stmt $statement) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Driver\Mysqli\Exception;
use Doctrine\DBAL\Driver\Mysqli\MysqliException;
use function sprintf;
/**
* @psalm-immutable
*/
final class UnknownFetchMode extends MysqliException
{
public static function new(int $fetchMode) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Driver\Mysqli\Exception;
use Doctrine\DBAL\Driver\Mysqli\MysqliException;
use function sprintf;
/**
* @psalm-immutable
*/
final class UnknownType extends MysqliException
{
/**
......
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL\Driver\Mysqli;
/**
* @internal
*
* @psalm-immutable
*/
final class HostRequired extends MysqliException
{
......
......@@ -8,6 +8,8 @@ use Doctrine\DBAL\Driver\AbstractDriverException;
/**
* Exception thrown in case the mysqli driver errors.
*
* @psalm-immutable
*/
class MysqliException extends AbstractDriverException
{
......
......@@ -6,6 +6,9 @@ namespace Doctrine\DBAL\Driver\OCI8;
use function sprintf;
/**
* @psalm-immutable
*/
final class NonTerminatedStringLiteral extends OCI8Exception
{
public static function new(int $offset) : self
......
......@@ -6,6 +6,9 @@ namespace Doctrine\DBAL\Driver\OCI8;
use Doctrine\DBAL\Driver\AbstractDriverException;
/**
* @psalm-immutable
*/
class OCI8Exception extends AbstractDriverException
{
/**
......
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL\Driver;
/**
* Tiny wrapper for PDOException instances to implement the {@link DriverException} interface.
*
* @psalm-immutable
*/
class PDOException extends AbstractDriverException
{
......
......@@ -13,6 +13,8 @@ use function sasql_stmt_error;
/**
* SAP Sybase SQL Anywhere driver exception.
*
* @psalm-immutable
*/
class SQLAnywhereException extends AbstractDriverException
{
......
......@@ -9,6 +9,9 @@ use function rtrim;
use function sqlsrv_errors;
use const SQLSRV_ERR_ERRORS;
/**
* @psalm-immutable
*/
class SQLSrvException extends AbstractDriverException
{
/**
......
......@@ -8,6 +8,9 @@ use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use function sprintf;
/**
* @psalm-immutable
*/
final class ColumnLengthRequired extends DBALException
{
/**
......
......@@ -6,6 +6,9 @@ namespace Doctrine\DBAL\Exception;
use Doctrine\DBAL\ConnectionException;
/**
* @psalm-immutable
*/
final class CommitFailedRollbackOnly extends ConnectionException
{
public static function new() : self
......
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Base class for all connection related errors detected in the driver.
*
* @psalm-immutable
*/
class ConnectionException extends DriverException
{
......
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Base class for all constraint violation related errors detected in the driver.
*
* @psalm-immutable
*/
class ConstraintViolationException extends ServerException
{
......
......@@ -10,6 +10,8 @@ namespace Doctrine\DBAL\Exception;
* A database object is considered any asset that can be created in a database
* such as schemas, tables, views, sequences, triggers, constraints, indexes,
* functions, stored procedures etc.
*
* @psalm-immutable
*/
class DatabaseObjectExistsException extends ServerException
{
......
......@@ -10,6 +10,8 @@ namespace Doctrine\DBAL\Exception;
* A database object is considered any asset that can be created in a database
* such as schemas, tables, views, sequences, triggers, constraints, indexes,
* functions, stored procedures etc.
*
* @psalm-immutable
*/
class DatabaseObjectNotFoundException extends ServerException
{
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Exception;
use Doctrine\DBAL\DBALException;
use function sprintf;
/**
* @psalm-immutable
*/
class DatabaseRequired extends DBALException
{
public static function new(string $methodName) : self
......
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for a deadlock error of a transaction detected in the driver.
*
* @psalm-immutable
*/
class DeadlockException extends ServerException implements RetryableException
{
......
......@@ -10,6 +10,8 @@ use function assert;
/**
* Base class for all errors detected in the driver.
*
* @psalm-immutable
*/
class DriverException extends DBALException implements DriverExceptionInterface
{
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Exception;
use Doctrine\DBAL\DBALException;
use function sprintf;
/**
* @psalm-immutable
*/
final class DriverRequired extends DBALException
{
/**
......
......@@ -4,6 +4,9 @@ declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
* @psalm-immutable
*/
final class EmptyCriteriaNotAllowed extends InvalidArgumentException
{
public static function new() : self
......
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for a foreign key constraint violation detected in the driver.
*
* @psalm-immutable
*/
class ForeignKeyConstraintViolationException extends ConstraintViolationException
{
......
......@@ -8,6 +8,8 @@ use Doctrine\DBAL\DBALException;
/**
* Exception to be thrown when invalid arguments are passed to any DBAL API
*
* @psalm-immutable
*/
class InvalidArgumentException extends DBALException
{
......
......@@ -8,6 +8,9 @@ use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver;
use function sprintf;
/**
* @psalm-immutable
*/
final class InvalidDriverClass extends DBALException
{
public static function new(string $driverClass) : self
......
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for an invalid specified field name in a statement detected in the driver.
*
* @psalm-immutable
*/
class InvalidFieldNameException extends ServerException
{
......
......@@ -10,6 +10,9 @@ use function get_class;
use function is_object;
use function sprintf;
/**
* @psalm-immutable
*/
final class InvalidPlatformType extends DBALException
{
/**
......
......@@ -8,6 +8,9 @@ use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException;
use function sprintf;
/**
* @psalm-immutable
*/
final class InvalidWrapperClass extends DBALException
{
public static function new(string $wrapperClass) : self
......
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for a lock wait timeout error of a transaction detected in the driver.
*
* @psalm-immutable
*/
class LockWaitTimeoutException extends ServerException implements RetryableException
{
......
......@@ -6,6 +6,9 @@ namespace Doctrine\DBAL\Exception;
use Doctrine\DBAL\ConnectionException;
/**
* @psalm-immutable
*/
final class MayNotAlterNestedTransactionWithSavepointsInTransaction extends ConnectionException
{
public static function new() : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Exception;
use Doctrine\DBAL\SQLParserUtilsException;
use function sprintf;
/**
* @psalm-immutable
*/
final class MissingArrayParameter extends SQLParserUtilsException
{
public static function new(string $paramName) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Exception;
use Doctrine\DBAL\SQLParserUtilsException;
use function sprintf;
/**
* @psalm-immutable
*/
final class MissingArrayParameterType extends SQLParserUtilsException
{
public static function new(string $paramName) : self
......
......@@ -6,6 +6,9 @@ namespace Doctrine\DBAL\Exception;
use Doctrine\DBAL\ConnectionException;
/**
* @psalm-immutable
*/
final class NoActiveTransaction extends ConnectionException
{
public static function new() : self
......
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for a non-unique/ambiguous specified field name in a statement detected in the driver.
*
* @psalm-immutable
*/
class NonUniqueFieldNameException extends ServerException
{
......
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for a NOT NULL constraint violation detected in the driver.
*
* @psalm-immutable
*/
class NotNullConstraintViolationException extends ConstraintViolationException
{
......
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for a write operation attempt on a read-only database element detected in the driver.
*
* @psalm-immutable
*/
class ReadOnlyException extends ServerException
{
......
......@@ -6,6 +6,9 @@ namespace Doctrine\DBAL\Exception;
use Doctrine\DBAL\ConnectionException;
/**
* @psalm-immutable
*/
final class SavepointsNotSupported extends ConnectionException
{
public static function new() : self
......
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Base class for all server related errors detected in the driver.
*
* @psalm-immutable
*/
class ServerException extends DriverException
{
......
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for a syntax error in a statement detected in the driver.
*
* @psalm-immutable
*/
class SyntaxErrorException extends ServerException
{
......
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for an already existing table referenced in a statement detected in the driver.
*
* @psalm-immutable
*/
class TableExistsException extends DatabaseObjectExistsException
{
......
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for an unknown table referenced in a statement detected in the driver.
*
* @psalm-immutable
*/
class TableNotFoundException extends DatabaseObjectNotFoundException
{
......
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL\Exception;
/**
* Exception for a unique constraint violation detected in the driver.
*
* @psalm-immutable
*/
class UniqueConstraintViolationException extends ConstraintViolationException
{
......
......@@ -8,6 +8,9 @@ use Doctrine\DBAL\DBALException;
use function implode;
use function sprintf;
/**
* @psalm-immutable
*/
final class UnknownDriver extends DBALException
{
/**
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Platforms\Exception;
use Doctrine\DBAL\DBALException;
use function sprintf;
/**
* @psalm-immutable
*/
final class InvalidPlatformVersion extends DBALException implements PlatformException
{
/**
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Platforms\Exception;
use Doctrine\DBAL\DBALException;
use function sprintf;
/**
* @psalm-immutable
*/
final class NoColumnsSpecifiedForTable extends DBALException implements PlatformException
{
public static function new(string $tableName) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Platforms\Exception;
use Doctrine\DBAL\DBALException;
use function sprintf;
/**
* @psalm-immutable
*/
final class NotSupported extends DBALException implements PlatformException
{
public static function new(string $method) : self
......
......@@ -697,6 +697,8 @@ class SqlitePlatform extends AbstractPlatform
/**
* {@inheritDoc}
*
* @param int|null $createFlags
*/
public function getCreateTableSQL(Table $table, int $createFlags = self::CREATE_INDEXES | self::CREATE_FOREIGNKEYS) : array
{
......
......@@ -8,6 +8,9 @@ use Doctrine\DBAL\Query\QueryException;
use function implode;
use function sprintf;
/**
* @psalm-immutable
*/
final class NonUniqueAlias extends QueryException
{
/**
......
......@@ -8,6 +8,9 @@ use Doctrine\DBAL\Query\QueryException;
use function implode;
use function sprintf;
/**
* @psalm-immutable
*/
final class UnknownAlias extends QueryException
{
/**
......
......@@ -6,6 +6,9 @@ namespace Doctrine\DBAL\Query;
use Doctrine\DBAL\DBALException;
/**
* @psalm-immutable
*/
class QueryException extends DBALException
{
}
......@@ -6,6 +6,8 @@ namespace Doctrine\DBAL;
/**
* Doctrine\DBAL\ConnectionException
*
* @psalm-immutable
*/
class SQLParserUtilsException extends DBALException
{
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Schema\Exception;
use Doctrine\DBAL\Schema\SchemaException;
use function sprintf;
/**
* @psalm-immutable
*/
final class ColumnAlreadyExists extends SchemaException
{
public static function new(string $tableName, string $columnName) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Schema\Exception;
use Doctrine\DBAL\Schema\SchemaException;
use function sprintf;
/**
* @psalm-immutable
*/
final class ColumnDoesNotExist extends SchemaException
{
public static function new(string $columnName, string $table) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Schema\Exception;
use Doctrine\DBAL\Schema\SchemaException;
use function sprintf;
/**
* @psalm-immutable
*/
final class ForeignKeyDoesNotExist extends SchemaException
{
public static function new(string $foreignKeyName, string $table) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Schema\Exception;
use Doctrine\DBAL\Schema\SchemaException;
use function sprintf;
/**
* @psalm-immutable
*/
final class IndexAlreadyExists extends SchemaException
{
public static function new(string $indexName, string $table) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Schema\Exception;
use Doctrine\DBAL\Schema\SchemaException;
use function sprintf;
/**
* @psalm-immutable
*/
final class IndexDoesNotExist extends SchemaException
{
public static function new(string $indexName, string $table) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Schema\Exception;
use Doctrine\DBAL\Schema\SchemaException;
use function sprintf;
/**
* @psalm-immutable
*/
final class IndexNameInvalid extends SchemaException
{
public static function new(string $indexName) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Schema\Exception;
use Doctrine\DBAL\Schema\SchemaException;
use function sprintf;
/**
* @psalm-immutable
*/
final class InvalidTableName extends SchemaException
{
public static function new(string $tableName) : self
......
......@@ -10,6 +10,9 @@ use Doctrine\DBAL\Schema\Table;
use function implode;
use function sprintf;
/**
* @psalm-immutable
*/
final class NamedForeignKeyRequired extends SchemaException
{
public static function new(Table $localTable, ForeignKeyConstraint $foreignKey) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Schema\Exception;
use Doctrine\DBAL\Schema\SchemaException;
use function sprintf;
/**
* @psalm-immutable
*/
final class NamespaceAlreadyExists extends SchemaException
{
public static function new(string $namespaceName) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Schema\Exception;
use Doctrine\DBAL\Schema\SchemaException;
use function sprintf;
/**
* @psalm-immutable
*/
final class SequenceAlreadyExists extends SchemaException
{
public static function new(string $sequenceName) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Schema\Exception;
use Doctrine\DBAL\Schema\SchemaException;
use function sprintf;
/**
* @psalm-immutable
*/
final class SequenceDoesNotExist extends SchemaException
{
public static function new(string $sequenceName) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Schema\Exception;
use Doctrine\DBAL\Schema\SchemaException;
use function sprintf;
/**
* @psalm-immutable
*/
final class TableAlreadyExists extends SchemaException
{
public static function new(string $tableName) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Schema\Exception;
use Doctrine\DBAL\Schema\SchemaException;
use function sprintf;
/**
* @psalm-immutable
*/
final class TableDoesNotExist extends SchemaException
{
public static function new(string $tableName) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Schema\Exception;
use Doctrine\DBAL\Schema\SchemaException;
use function sprintf;
/**
* @psalm-immutable
*/
final class UniqueConstraintDoesNotExist extends SchemaException
{
public static function new(string $constraintName, string $table) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Schema\Exception;
use Doctrine\DBAL\Schema\SchemaException;
use function sprintf;
/**
* @psalm-immutable
*/
final class UnknownColumnOption extends SchemaException
{
public static function new(string $name) : self
......
......@@ -6,6 +6,9 @@ namespace Doctrine\DBAL\Schema;
use Doctrine\DBAL\DBALException;
/**
* @psalm-immutable
*/
class SchemaException extends DBALException
{
public const TABLE_DOESNT_EXIST = 10;
......
......@@ -8,6 +8,8 @@ use Doctrine\DBAL\DBALException;
/**
* Conversion Exception is thrown when the database to PHP conversion fails.
*
* @psalm-immutable
*/
class ConversionException extends DBALException
{
......
......@@ -13,6 +13,8 @@ use function substr;
/**
* Thrown when a Database to Doctrine Type Conversion fails and we can make a statement
* about the expected format.
*
* @psalm-immutable
*/
final class InvalidFormat extends ConversionException implements TypesException
{
......
......@@ -15,6 +15,8 @@ use function sprintf;
/**
* Thrown when the PHP value passed to the converter was not of the expected type.
*
* @psalm-immutable
*/
final class InvalidType extends ConversionException implements TypesException
{
......
......@@ -11,6 +11,9 @@ use function gettype;
use function is_object;
use function sprintf;
/**
* @psalm-immutable
*/
final class SerializationFailed extends ConversionException implements TypesException
{
/**
......
......@@ -10,6 +10,9 @@ use function get_class;
use function spl_object_hash;
use function sprintf;
/**
* @psalm-immutable
*/
final class TypeAlreadyRegistered extends DBALException implements TypesException
{
public static function new(Type $type) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Types\Exception;
use Doctrine\DBAL\DBALException;
use function sprintf;
/**
* @psalm-immutable
*/
final class TypeNotFound extends DBALException implements TypesException
{
public static function new(string $name) : self
......
......@@ -10,6 +10,9 @@ use function get_class;
use function spl_object_hash;
use function sprintf;
/**
* @psalm-immutable
*/
final class TypeNotRegistered extends DBALException implements TypesException
{
public static function new(Type $type) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Types\Exception;
use Doctrine\DBAL\DBALException;
use function sprintf;
/**
* @psalm-immutable
*/
final class TypesAlreadyExists extends DBALException implements TypesException
{
public static function new(string $name) : self
......
......@@ -7,6 +7,9 @@ namespace Doctrine\DBAL\Types\Exception;
use Doctrine\DBAL\DBALException;
use function sprintf;
/**
* @psalm-immutable
*/
final class UnknownColumnType extends DBALException implements TypesException
{
public static function new(string $name) : self
......
......@@ -13,6 +13,8 @@ use function substr;
/**
* Thrown when a Database to Doctrine Type Conversion fails.
*
* @psalm-immutable
*/
final class ValueNotConvertible extends ConversionException implements TypesException
{
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Tests\Functional;
use Doctrine\DBAL\Logging\SQLLogger;
use Doctrine\DBAL\Tests\FunctionalTestCase;
class LoggingTest extends FunctionalTestCase
{
public function testLogExecuteQuery() : void
{
$sql = $this->connection->getDatabasePlatform()->getDummySelectSQL();
$logMock = $this->createMock(SQLLogger::class);
$logMock->expects(self::at(0))
->method('startQuery')
->with(self::equalTo($sql), self::equalTo([]), self::equalTo([]));
$logMock->expects(self::at(1))
->method('stopQuery');
$this->connection->getConfiguration()->setSQLLogger($logMock);
$this->connection->executeQuery($sql, []);
}
public function testLogPrepareExecute() : void
{
$sql = $this->connection->getDatabasePlatform()->getDummySelectSQL();
$logMock = $this->createMock(SQLLogger::class);
$logMock->expects(self::once())
->method('startQuery')
->with(self::equalTo($sql), self::equalTo([]));
$logMock->expects(self::at(1))
->method('stopQuery');
$this->connection->getConfiguration()->setSQLLogger($logMock);
$stmt = $this->connection->prepare($sql);
$stmt->execute();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment