diff --git a/baseline.xml b/baseline.xml
deleted file mode 100644
index a75903a9716..00000000000
--- a/baseline.xml
+++ /dev/null
@@ -1,216 +0,0 @@
-
-
-
-
- int
-
-
-
-
- public function getMessage();
-
-
-
-
- PDO::SQLSRV_ENCODING_BINARY
-
-
-
-
- sasql_pconnect($dsn)
- sasql_connect($dsn)
- sasql_set_option($this->connection, 'verbose_errors', false)
- sasql_set_option($this->connection, 'auto_commit', 'on')
- sasql_set_option($this->connection, 'auto_commit', 'off')
- sasql_commit($this->connection)
- sasql_errorcode($this->connection)
- sasql_error($this->connection)
- sasql_real_query($this->connection, $statement)
- sasql_affected_rows($this->connection)
- sasql_insert_id($this->connection)
- sasql_escape_string($this->connection, $input)
- sasql_rollback($this->connection)
- sasql_set_option($this->connection, 'auto_commit', 'on')
-
-
-
-
- sasql_sqlstate($conn)
- sasql_sqlstate()
- sasql_stmt_errno($stmt)
- sasql_stmt_error($stmt)
- sasql_errorcode($conn)
- sasql_error($conn)
- sasql_errorcode()
- sasql_error()
-
-
-
-
- SASQL_BOTH
-
-
- sasql_prepare($conn, $sql)
- sasql_stmt_bind_param_ex($this->stmt, $column - 1, $variable, $type, $variable === null)
- sasql_stmt_reset($this->stmt)
- sasql_stmt_field_count($this->stmt)
- sasql_stmt_errno($this->stmt)
- sasql_stmt_error($this->stmt)
- sasql_stmt_execute($this->stmt)
- sasql_stmt_result_metadata($this->stmt)
- sasql_fetch_assoc($this->result)
- sasql_fetch_array($this->result, SASQL_BOTH)
- sasql_fetch_object($this->result)
- sasql_fetch_row($this->result)
- sasql_fetch_object($this->result)
- sasql_stmt_affected_rows($this->stmt)
-
-
-
-
- sqlsrv_get_field($this->stmt, 0)
-
-
-
-
- int
-
-
-
-
- string
-
-
-
-
- Collection
-
-
-
-
- PDO::PGSQL_ATTR_DISABLE_PREPARES
- PDO::PGSQL_ATTR_DISABLE_PREPARES
- PDO::PGSQL_ATTR_DISABLE_PREPARES
- PDO::PGSQL_ATTR_DISABLE_PREPARES
- PDO::PGSQL_ATTR_DISABLE_PREPARES
-
-
-
-
- MySqlPlatform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
- $this->platform
-
-
-
-
- $this->platform
- $this->platform
- $this->platform
- $this->platform
-
-
-
-
- $this->platform
- $this->platform
- $this->platform
- $this->platform
-
-
-
-
- $this->platform
-
-
-
diff --git a/composer.json b/composer.json
index fd88e428cf2..f17794bcec0 100644
--- a/composer.json
+++ b/composer.json
@@ -40,6 +40,7 @@
"require-dev": {
"doctrine/coding-standard": "^6.0",
"jetbrains/phpstorm-stubs": "^2019.1",
+ "nikic/php-parser": "^4.4",
"phpstan/phpstan": "^0.12",
"phpunit/phpunit": "^8.4.1",
"symfony/console": "^2.0.5|^3.0|^4.0|^5.0",
diff --git a/composer.lock b/composer.lock
index 4dda16ace6b..215798b08a1 100644
--- a/composer.lock
+++ b/composer.lock
@@ -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": "a0ee337c9500698eeb5d25f1e4a84b69",
+ "content-hash": "b7f970513c9756e5eaaba3974429c23c",
"packages": [
{
"name": "doctrine/cache",
@@ -816,16 +816,16 @@
},
{
"name": "nikic/php-parser",
- "version": "v4.3.0",
+ "version": "v4.4.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc"
+ "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9a9981c347c5c49d6dfe5cf826bb882b824080dc",
- "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120",
+ "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120",
"shasum": ""
},
"require": {
@@ -864,7 +864,7 @@
"parser",
"php"
],
- "time": "2019-11-08T13:50:10+00:00"
+ "time": "2020-04-10T16:34:50+00:00"
},
{
"name": "ocramius/package-versions",
diff --git a/lib/Doctrine/DBAL/Connection.php b/lib/Doctrine/DBAL/Connection.php
index e2d78ae1559..10da0f98f4d 100644
--- a/lib/Doctrine/DBAL/Connection.php
+++ b/lib/Doctrine/DBAL/Connection.php
@@ -823,7 +823,7 @@ public function quoteIdentifier($str)
/**
* {@inheritDoc}
*/
- public function quote($input, $type = null)
+ public function quote($input, $type = ParameterType::STRING)
{
$connection = $this->getWrappedConnection();
diff --git a/lib/Doctrine/DBAL/Driver/AbstractDriverException.php b/lib/Doctrine/DBAL/Driver/AbstractDriverException.php
index d9af92d1744..f57de38f09c 100644
--- a/lib/Doctrine/DBAL/Driver/AbstractDriverException.php
+++ b/lib/Doctrine/DBAL/Driver/AbstractDriverException.php
@@ -6,6 +6,8 @@
/**
* Abstract base implementation of the {@link DriverException} interface.
+ *
+ * @psalm-immutable
*/
abstract class AbstractDriverException extends Exception implements DriverException
{
diff --git a/lib/Doctrine/DBAL/Driver/DriverException.php b/lib/Doctrine/DBAL/Driver/DriverException.php
index 79480ac72be..14cd5186e4d 100644
--- a/lib/Doctrine/DBAL/Driver/DriverException.php
+++ b/lib/Doctrine/DBAL/Driver/DriverException.php
@@ -9,6 +9,8 @@
*
* 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
{
diff --git a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliException.php b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliException.php
index 1fa0c900fbd..8e8e697c4a3 100644
--- a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliException.php
+++ b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliException.php
@@ -6,6 +6,8 @@
/**
* Exception thrown in case the mysqli driver errors.
+ *
+ * @psalm-immutable
*/
class MysqliException extends AbstractDriverException
{
diff --git a/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php b/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php
index af3a9d1a7a9..42283e08a57 100644
--- a/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php
+++ b/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php
@@ -4,6 +4,9 @@
use Doctrine\DBAL\Driver\AbstractDriverException;
+/**
+ * @psalm-immutable
+ */
class OCI8Exception extends AbstractDriverException
{
/**
diff --git a/lib/Doctrine/DBAL/Driver/PDOException.php b/lib/Doctrine/DBAL/Driver/PDOException.php
index 277d7a62500..c2571032b80 100644
--- a/lib/Doctrine/DBAL/Driver/PDOException.php
+++ b/lib/Doctrine/DBAL/Driver/PDOException.php
@@ -4,6 +4,8 @@
/**
* Tiny wrapper for PDOException instances to implement the {@link DriverException} interface.
+ *
+ * @psalm-immutable
*/
class PDOException extends \PDOException implements DriverException
{
diff --git a/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereException.php b/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereException.php
index 0f8bc3e57e6..022cfe2dfa7 100644
--- a/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereException.php
+++ b/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereException.php
@@ -12,6 +12,8 @@
/**
* SAP Sybase SQL Anywhere driver exception.
+ *
+ * @psalm-immutable
*/
class SQLAnywhereException extends AbstractDriverException
{
diff --git a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php
index 1c1e8c472d7..5618ed73560 100644
--- a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php
+++ b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php
@@ -7,6 +7,9 @@
use function rtrim;
use function sqlsrv_errors;
+/**
+ * @psalm-immutable
+ */
class SQLSrvException extends AbstractDriverException
{
/**
diff --git a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
index b0e3713ab27..4eff83e8dcf 100644
--- a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
+++ b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
@@ -807,6 +807,8 @@ public function getCreateConstraintSQL(Constraint $constraint, $table)
/**
* {@inheritDoc}
+ *
+ * @param int|null $createFlags
*/
public function getCreateTableSQL(Table $table, $createFlags = null)
{
diff --git a/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php b/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php
index 9718f932ef5..dd10cd0f928 100644
--- a/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php
+++ b/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php
@@ -287,6 +287,8 @@ protected function _getPortableDatabaseDefinition($database)
/**
* {@inheritdoc}
*
+ * @param string|null $database
+ *
* Calling this method without an argument or by passing NULL is deprecated.
*/
public function createDatabase($database = null)
diff --git a/psalm.xml b/psalm.xml
index 2b9fdb0d21b..3db108eb2ac 100644
--- a/psalm.xml
+++ b/psalm.xml
@@ -6,7 +6,6 @@
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"
- errorBaseline="baseline.xml"
>
@@ -16,10 +15,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/Doctrine/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php b/tests/Doctrine/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php
index bbae08c5b2c..9bd0ae62f85 100644
--- a/tests/Doctrine/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php
+++ b/tests/Doctrine/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php
@@ -3,6 +3,7 @@
namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\AbstractPlatform;
+use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\DBAL\Schema\Comparator;
use Doctrine\DBAL\Schema\ForeignKeyConstraint;
use Doctrine\DBAL\Schema\Index;