Skip to content

Commit

Permalink
Drop support for PHP 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Aug 1, 2021
1 parent f3a70f3 commit dc4ad2a
Show file tree
Hide file tree
Showing 156 changed files with 370 additions and 673 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ jobs:
strategy:
matrix:
php-version:
- "7.3"
- "7.4"
- "8.0"
dependencies:
- "highest"
include:
- dependencies: "lowest"
php-version: "7.3"
php-version: "7.4"

steps:
- name: "Checkout"
Expand Down Expand Up @@ -280,12 +279,12 @@ jobs:
config-file-suffix:
- ""
include:
- php-version: "7.3"
- php-version: "7.4"
mysql-version: "8.0"
extension: "mysqli"
custom-entrypoint: >-
--entrypoint sh mysql:8 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"
- php-version: "7.3"
- php-version: "7.4"
mysql-version: "8.0"
extension: "pdo_mysql"
custom-entrypoint: >-
Expand Down Expand Up @@ -361,7 +360,6 @@ jobs:
strategy:
matrix:
php-version:
- "7.3"
- "7.4"
- "8.0"
extension:
Expand Down Expand Up @@ -426,7 +424,6 @@ jobs:
strategy:
matrix:
php-version:
- "7.3"
- "7.4"

services:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{"name": "Jonathan Wage", "email": "[email protected]"}
],
"require": {
"php": "^7.3 || ^8.0",
"php": "^7.4 || ^8.0",
"composer/package-versions-deprecated": "^1.11.99",
"doctrine/deprecations": "^0.5.3",
"doctrine/event-manager": "^1.0",
Expand All @@ -56,7 +56,7 @@
"bin": ["bin/doctrine-dbal"],
"config": {
"platform": {
"php": "7.3.0"
"php": "7.4.0"
},
"sort-packages": true
},
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- Show progress of the run and show sniff names -->
<arg value="ps"/>

<config name="php_version" value="70300"/>
<config name="php_version" value="70400"/>

<file>bin</file>
<file>src</file>
Expand Down
8 changes: 3 additions & 5 deletions src/Cache/ArrayResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
final class ArrayResult implements Result
{
/** @var mixed[] */
private $data;
private array $data;

/** @var int */
private $columnCount = 0;
private int $columnCount = 0;

/** @var int */
private $num = 0;
private int $num = 0;

/**
* @param mixed[] $data
Expand Down
17 changes: 6 additions & 11 deletions src/Cache/CachingResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,18 @@
*/
final class CachingResult implements DriverResult
{
/** @var CacheItemPoolInterface */
private $cache;
private CacheItemPoolInterface $cache;

/** @var string */
private $cacheKey;
private string $cacheKey;

/** @var string */
private $realKey;
private string $realKey;

/** @var int */
private $lifetime;
private int $lifetime;

/** @var Result */
private $result;
private Result $result;

/** @var array<int,array<string,mixed>>|null */
private $data;
private ?array $data = null;

public function __construct(
Result $result,
Expand Down
9 changes: 3 additions & 6 deletions src/Cache/QueryCacheProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@
*/
class QueryCacheProfile
{
/** @var CacheItemPoolInterface|null */
private $resultCache;
private ?CacheItemPoolInterface $resultCache = null;

/** @var int */
private $lifetime = 0;
private int $lifetime = 0;

/** @var string|null */
private $cacheKey;
private ?string $cacheKey = null;

public function __construct(
int $lifetime = 0,
Expand Down
14 changes: 4 additions & 10 deletions src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,17 @@
class Configuration
{
/** @var Middleware[] */
private $middlewares = [];
private array $middlewares = [];

/**
* The SQL logger in use. If null, SQL logging is disabled.
*
* @var SQLLogger|null
*/
protected $sqlLogger;
protected ?SQLLogger $sqlLogger = null;

/**
* The cache driver implementation that is used for query result caching.
*
* @var CacheItemPoolInterface|null
*/
private $resultCache;
private ?CacheItemPoolInterface $resultCache = null;

/**
* The callable to use to filter schema assets.
Expand All @@ -40,10 +36,8 @@ class Configuration

/**
* The default auto-commit mode for connections.
*
* @var bool
*/
protected $autoCommit = true;
protected bool $autoCommit = true;

/**
* Sets the SQL logger to use.
Expand Down
46 changes: 13 additions & 33 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,44 +68,32 @@ class Connection

/**
* The wrapped driver connection.
*
* @var \Doctrine\DBAL\Driver\Connection|null
*/
protected $_conn;
protected ?DriverConnection $_conn = null;

/** @var Configuration */
protected $_config;
protected Configuration $_config;

/** @var EventManager */
protected $_eventManager;
protected EventManager $_eventManager;

/**
* The current auto-commit mode of this connection.
*
* @var bool
*/
private $autoCommit = true;
private bool $autoCommit = true;

/**
* The transaction nesting level.
*
* @var int
*/
private $transactionNestingLevel = 0;
private int $transactionNestingLevel = 0;

/**
* The currently active transaction isolation level or NULL before it has been determined.
*
* @var int|null
*/
private $transactionIsolationLevel;
private ?int $transactionIsolationLevel = null;

/**
* If nested transactions should use savepoints.
*
* @var bool
*/
private $nestTransactionsWithSavepoints = false;
private bool $nestTransactionsWithSavepoints = false;

/**
* The parameters used during creation of the Connection instance.
Expand All @@ -114,34 +102,26 @@ class Connection
* @phpstan-var array<string,mixed>
* @psalm-var Params
*/
private $params;
private array $params;

/**
* The database platform object used by the connection or NULL before it's initialized.
*
* @var AbstractPlatform|null
*/
private $platform;
private ?AbstractPlatform $platform = null;

/** @var ExceptionConverter|null */
private $exceptionConverter;
private ?ExceptionConverter $exceptionConverter = null;

/** @var Parser|null */
private $parser;
private ?Parser $parser = null;

/**
* The used DBAL driver.
*
* @var Driver
*/
protected $_driver;
protected Driver $_driver;

/**
* Flag that indicates whether the current transaction is marked for rollback only.
*
* @var bool
*/
private $isRollbackOnly = false;
private bool $isRollbackOnly = false;

/**
* Initializes a new instance of the Connection class.
Expand Down
6 changes: 2 additions & 4 deletions src/Connections/PrimaryReadReplicaConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,13 @@ class PrimaryReadReplicaConnection extends Connection
*
* @var array<string, DriverConnection|null>
*/
protected $connections = ['primary' => null, 'replica' => null];
protected array $connections = ['primary' => null, 'replica' => null];

/**
* You can keep the replica connection and then switch back to it
* during the request if you know what you are doing.
*
* @var bool
*/
protected $keepReplica = false;
protected bool $keepReplica = false;

/**
* Creates Primary Replica Connection.
Expand Down
4 changes: 1 addition & 3 deletions src/Driver/AbstractException.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ abstract class AbstractException extends BaseException implements Exception
{
/**
* The SQLSTATE of the driver.
*
* @var string|null
*/
private $sqlState;
private ?string $sqlState = null;

/**
* @param string $message The driver error message.
Expand Down
3 changes: 1 addition & 2 deletions src/Driver/AbstractOracleDriver/EasyConnectString.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
*/
final class EasyConnectString
{
/** @var string */
private $string;
private string $string;

private function __construct(string $string)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Driver/IBMDB2/DataSourceName.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
*/
final class DataSourceName
{
/** @var string */
private $string;
private string $string;

private function __construct(string $string)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Driver/IBMDB2/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ final class Statement implements StatementInterface
private $stmt;

/** @var mixed[] */
private $bindParam = [];
private array $bindParam = [];

/**
* Map of LOB parameter positions to the tuples containing reference to the variable bound to the driver statement
* and the temporary file handle bound to the underlying statement
*
* @var mixed[][]
*/
private $lobs = [];
private array $lobs = [];

/**
* @internal The statement can be only instantiated by its driver connection.
Expand Down
3 changes: 1 addition & 2 deletions src/Driver/Mysqli/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ final class Connection implements ServerInfoAwareConnection
*/
public const OPTION_FLAGS = 'flags';

/** @var mysqli */
private $conn;
private mysqli $conn;

/**
* @internal The connection can be only instantiated by its driver.
Expand Down
3 changes: 1 addition & 2 deletions src/Driver/Mysqli/Initializer/Charset.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

final class Charset implements Initializer
{
/** @var string */
private $charset;
private string $charset;

public function __construct(string $charset)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/Mysqli/Initializer/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
final class Options implements Initializer
{
/** @var array<int,mixed> */
private $options;
private array $options;

/**
* @param array<int,mixed> $options
Expand Down
15 changes: 5 additions & 10 deletions src/Driver/Mysqli/Initializer/Secure.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,15 @@

final class Secure implements Initializer
{
/** @var string */
private $key;
private string $key;

/** @var string */
private $cert;
private string $cert;

/** @var string */
private $ca;
private string $ca;

/** @var string */
private $capath;
private string $capath;

/** @var string */
private $cipher;
private string $cipher;

public function __construct(string $key, string $cert, string $ca, string $capath, string $cipher)
{
Expand Down
Loading

0 comments on commit dc4ad2a

Please sign in to comment.