Unverified Commit aa521b7d authored by Sergei Morozov's avatar Sergei Morozov

Merge pull request #2854 from Majkl578/strict-types

Enable strict types
parents 93f89e3f 4c22e805
<?php
declare(strict_types=1);
use Doctrine\DBAL\Tools\Console\ConsoleRunner;
use Symfony\Component\Console\Helper\HelperSet;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Cache;
use ArrayIterator;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Cache;
use Doctrine\DBAL\DBALException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Cache;
use Doctrine\Common\Cache\Cache;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Cache;
use ArrayIterator;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL;
use Doctrine\Common\Cache\Cache;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL;
use Closure;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL;
class ConnectionException extends DBALException
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Connections;
use Doctrine\Common\EventManager;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL;
use Doctrine\DBAL\Driver\DriverException as DriverExceptionInterface;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL;
use Doctrine\DBAL\Platforms\AbstractPlatform;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\Connection;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
use Exception;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\Connection;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\Connection;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\Connection;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\Connection;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\Connection;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\Connection;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\DBALException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
use Throwable;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
/**
......
<?php
declare(strict_types=0);
namespace Doctrine\DBAL\Driver\IBMDB2;
use Doctrine\DBAL\Driver\Connection;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\IBMDB2;
use Doctrine\DBAL\Driver\AbstractDB2Driver;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\IBMDB2;
use Doctrine\DBAL\Driver\AbstractDriverException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\IBMDB2;
use Doctrine\DBAL\DBALException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\Mysqli;
use Doctrine\DBAL\DBALException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\Mysqli;
use Doctrine\DBAL\Driver\Connection;
......@@ -47,7 +49,7 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
*/
public function __construct(array $params, $username, $password, array $driverOptions = [])
{
$port = $params['port'] ?? ini_get('mysqli.default_port');
$port = $params['port'] ?? (int) ini_get('mysqli.default_port');
// Fallback to default MySQL port if not given.
if (! $port) {
......@@ -55,9 +57,9 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
}
$socket = $params['unix_socket'] ?? ini_get('mysqli.default_socket');
$dbname = $params['dbname'] ?? null;
$dbname = $params['dbname'] ?? '';
$flags = $driverOptions[static::OPTION_FLAGS] ?? null;
$flags = $driverOptions[static::OPTION_FLAGS] ?? 0;
$this->conn = mysqli_init();
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\Mysqli;
use Doctrine\DBAL\Driver\AbstractDriverException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\Mysqli;
use Doctrine\DBAL\DBALException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\OCI8;
use Doctrine\DBAL\DBALException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\OCI8;
use Doctrine\DBAL\Driver\Connection;
......@@ -180,7 +182,7 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection
public function commit() : void
{
if (! oci_commit($this->dbh)) {
throw OCI8Exception::fromErrorInfo($this->errorInfo());
throw OCI8Exception::fromErrorInfo(oci_error($this->dbh));
}
$this->executeMode = OCI_COMMIT_ON_SUCCESS;
......@@ -192,7 +194,7 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection
public function rollBack() : void
{
if (! oci_rollback($this->dbh)) {
throw OCI8Exception::fromErrorInfo($this->errorInfo());
throw OCI8Exception::fromErrorInfo(oci_error($this->dbh));
}
$this->executeMode = OCI_COMMIT_ON_SUCCESS;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\OCI8;
use Doctrine\DBAL\Driver\AbstractDriverException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\OCI8;
use Doctrine\DBAL\DBALException;
......@@ -300,7 +302,7 @@ class OCI8Statement implements IteratorAggregate, Statement
$length ?? -1,
$this->convertParameterType($type)
)) {
throw OCI8Exception::fromErrorInfo($this->errorInfo());
throw OCI8Exception::fromErrorInfo(oci_error($this->_sth));
}
}
......@@ -392,7 +394,7 @@ class OCI8Statement implements IteratorAggregate, Statement
$ret = @oci_execute($this->_sth, $this->_conn->getExecuteMode());
if (! $ret) {
throw OCI8Exception::fromErrorInfo($this->errorInfo());
throw OCI8Exception::fromErrorInfo(oci_error($this->_sth));
}
$this->result = true;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
use PDO;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\PDOMySql;
use Doctrine\DBAL\DBALException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\PDOOracle;
use Doctrine\DBAL\DBALException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\PDOPgSql;
use Doctrine\DBAL\DBALException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\PDOSqlite;
use Doctrine\DBAL\DBALException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\PDOSqlsrv;
use Doctrine\DBAL\Driver\PDOConnection;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\PDOSqlsrv;
use Doctrine\DBAL\Driver\AbstractSQLServerDriver;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\PDOSqlsrv;
use Doctrine\DBAL\Driver\PDOStatement;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\DBALException;
......@@ -10,6 +12,7 @@ use PDO;
use const E_USER_DEPRECATED;
use function array_slice;
use function assert;
use function count;
use function func_get_args;
use function is_array;
use function sprintf;
......@@ -80,10 +83,15 @@ class PDOStatement implements IteratorAggregate, Statement
*/
public function bindParam($column, &$variable, $type = ParameterType::STRING, $length = null, $driverOptions = null) : void
{
$type = $this->convertParamType($type);
$type = $this->convertParamType($type);
$extraParameters = array_slice(func_get_args(), 3);
if (count($extraParameters) !== 0) {
$extraParameters[0] = $extraParameters[0] ?? 0;
}
try {
$this->stmt->bindParam($column, $variable, $type, ...array_slice(func_get_args(), 3));
$this->stmt->bindParam($column, $variable, $type, ...$extraParameters);
} catch (\PDOException $exception) {
throw new PDOException($exception);
}
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
use Traversable;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\SQLAnywhere;
use Doctrine\DBAL\DBALException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\SQLAnywhere;
use Doctrine\DBAL\Driver\Connection;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\SQLAnywhere;
use Doctrine\DBAL\Driver\AbstractDriverException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\SQLAnywhere;
use Doctrine\DBAL\DBALException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\SQLSrv;
use Doctrine\DBAL\Driver\AbstractSQLServerDriver;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\SQLSrv;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\SQLSrv;
use Doctrine\DBAL\Driver\Connection;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\SQLSrv;
use Doctrine\DBAL\Driver\AbstractDriverException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\SQLSrv;
use Doctrine\DBAL\DBALException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\ParameterType;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
use IteratorAggregate;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL;
use Doctrine\Common\EventManager;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Event;
use Doctrine\Common\EventArgs;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Event\Listeners;
use Doctrine\Common\EventSubscriber;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Event\Listeners;
use Doctrine\Common\EventSubscriber;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Event\Listeners;
use Doctrine\Common\EventSubscriber;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Event;
use Doctrine\DBAL\Platforms\AbstractPlatform;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Event;
use Doctrine\DBAL\Platforms\AbstractPlatform;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Event;
use Doctrine\DBAL\Platforms\AbstractPlatform;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Event;
use Doctrine\DBAL\Platforms\AbstractPlatform;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Event;
use Doctrine\DBAL\Platforms\AbstractPlatform;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Event;
use Doctrine\DBAL\Connection;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Event;
use Doctrine\DBAL\Platforms\AbstractPlatform;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Event;
use Doctrine\DBAL\Platforms\AbstractPlatform;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Event;
use Doctrine\DBAL\Platforms\AbstractPlatform;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Event;
use Doctrine\Common\EventArgs;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Event;
use Doctrine\DBAL\Connection;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
use Doctrine\DBAL\DBALException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
use Doctrine\DBAL\DBALException;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Id;
use Doctrine\DBAL\Connection;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Id;
use Doctrine\DBAL\Schema\Column;
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL;
/**
......
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Logging;
use function microtime;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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