Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for DBAL 2, PHP 7.2, Symfony 3, Persistence 1 #1250

Merged
merged 4 commits into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ cache:

environment:
matrix:
- php: 7.2.25
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo: determine what our policy for testing on appveyor shall be

- php: 7.3.12
- php: 7.4.28

init:
- SET PATH=C:\Program Files\OpenSSL;c:\tools\php;C:\tools\composer;%PATH%
Expand Down
14 changes: 1 addition & 13 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,14 @@ jobs:

strategy:
matrix:
dbal-version:
- "^2.11"
- "^3.0"
php-version:
- "7.2"
- "7.3"
- "7.4"
- "8.0"
dependencies:
- "highest"
include:
- deps: "lowest"
php-version: "7.2"
exclude:
- dbal-version: "^3.0"
php-version: "7.2"
php-version: "7.4"

steps:
- name: "Checkout"
Expand All @@ -59,10 +51,6 @@ jobs:
- name: "Download box"
run: "./download-box.sh"

- name: "Require the right DBAL version"
run: "composer require doctrine/dbal:${{ matrix.dbal-version }} --no-update"
if: "${{ matrix.dbal-version }}"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
with:
Expand Down
18 changes: 2 additions & 16 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,9 @@ jobs:

strategy:
matrix:
dbal-version:
- "^2.11"
- "^3.0"
php-version:
- "7.2"
- "7.4"
- "8.0"
exclude:
- dbal-version: "^3.0"
php-version: "7.2"

steps:
- name: "Checkout code"
Expand All @@ -38,17 +31,10 @@ jobs:
php-version: "${{ matrix.php-version }}"
extensions: "pdo_sqlite"

- name: "Require the right DBAL version"
run: "composer require doctrine/dbal:${{ matrix.dbal-version }} --no-update"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run a static analysis with phpstan/phpstan (dbal v2)"
run: "vendor/bin/phpstan analyse -c phpstan-dbal-2.neon.dist"
if: "contains(matrix.dbal-version, '^2.')"
- name: "Run a static analysis with phpstan/phpstan (dbal v3)"
run: "vendor/bin/phpstan analyse -c phpstan-dbal-3.neon.dist"
if: "contains(matrix.dbal-version, '^3.')"
- name: "Run a static analysis with phpstan/phpstan"
run: "vendor/bin/phpstan analyse -c phpstan.neon.dist"
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,32 @@
}
],
"require": {
"php": "^7.2 || ^8.0",
"php": "^7.4 || ^8.0",
"composer-runtime-api": "^2",
"doctrine/dbal": "^2.11 || ^3.0",
"doctrine/dbal": "^3.3",
"doctrine/deprecations": "^0.5.3",
"doctrine/event-manager": "^1.0",
"friendsofphp/proxy-manager-lts": "^1.0",
"psr/log": "^1.1.3 || ^2 || ^3",
"symfony/console": "^3.4 || ^4.4.16 || ^5.0 || ^6.0",
"symfony/stopwatch": "^3.4 || ^4.0 || ^5.0 || ^6.0"
"symfony/console": "^4.4.16 || ^5.4 || ^6.0",
"symfony/stopwatch": "^4.4 || ^5.4 || ^6.0"
},
"require-dev": {
"ext-pdo_sqlite": "*",
"doctrine/coding-standard": "^9",
"doctrine/orm": "^2.6",
"doctrine/persistence": "^1.3 || ^2.0",
"doctrine/persistence": "^2.0",
"doctrine/sql-formatter": "^1.0",
"ergebnis/composer-normalize": "^2.9",
"phpstan/phpstan": "^1.5",
"phpstan/phpstan-deprecation-rules": "^1",
"phpstan/phpstan-phpunit": "^1.1",
"phpstan/phpstan-strict-rules": "^1.1",
"phpstan/phpstan-symfony": "^1.1",
"phpunit/phpunit": "^8.5 || ^9.4",
"symfony/cache": "^3.4.26 || ^4.2.12 || ^5.0 || ^6.0",
"symfony/process": "^3.4 || ^4.0 || ^5.0 || ^6.0",
"symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0"
"phpunit/phpunit": "^9.4",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"phpunit/phpunit": "^9.4",
"phpunit/phpunit": "^9.5",

PHPUnit 9.4 is dead and buried.

"symfony/cache": "^4.4 || ^5.4 || ^6.0",
"symfony/process": "^4.4 || ^5.4 || ^6.0",
"symfony/yaml": "^4.4 || ^5.4 || ^6.0"
},
"suggest": {
"doctrine/sql-formatter": "Allows to generate formatted SQL with the diff command.",
Expand Down
2 changes: 1 addition & 1 deletion download-box.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash

if [ ! -f box.phar ]; then
wget https://github.com/box-project/box/releases/download/$(php -r 'echo PHP_VERSION_ID >= 70300 ? "3.11.0" : "3.9.1";')/box.phar -O box.phar
wget https://github.com/box-project/box/releases/download/3.11.0/box.phar -O box.phar
fi
10 changes: 3 additions & 7 deletions lib/Doctrine/Migrations/AbstractMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Doctrine\Migrations\Query\Query;
use Psr\Log\LoggerInterface;

use function method_exists;
use function sprintf;

/**
Expand All @@ -34,18 +33,15 @@ abstract class AbstractMigration
/** @var AbstractPlatform */
protected $platform;

/** @var LoggerInterface */
private $logger;
private LoggerInterface $logger;

/** @var Query[] */
private $plannedSql = [];
private array $plannedSql = [];

public function __construct(Connection $connection, LoggerInterface $logger)
{
$this->connection = $connection;
$this->sm = method_exists($this->connection, 'createSchemaManager')
? $this->connection->createSchemaManager()
: $this->connection->getSchemaManager();
$this->sm = $this->connection->createSchemaManager();
$this->platform = $this->connection->getDatabasePlatform();
$this->logger = $logger;
}
Expand Down
37 changes: 13 additions & 24 deletions lib/Doctrine/Migrations/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,43 +21,32 @@ final class Configuration
public const VERSIONS_ORGANIZATION_BY_YEAR_AND_MONTH = 'year_and_month';

/** @var array<string, string> */
private $migrationsDirectories = [];
private array $migrationsDirectories = [];

/** @var string[] */
private $migrationClasses = [];
private array $migrationClasses = [];

/** @var bool */
private $migrationsAreOrganizedByYear = false;
private bool $migrationsAreOrganizedByYear = false;

/** @var bool */
private $migrationsAreOrganizedByYearAndMonth = false;
private bool $migrationsAreOrganizedByYearAndMonth = false;

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

/** @var bool */
private $isDryRun = false;
private bool $isDryRun = false;

/** @var bool */
private $allOrNothing = false;
private bool $allOrNothing = false;

/** @var bool */
private $transactional = true;
private bool $transactional = true;

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

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

/** @var bool */
private $checkDbPlatform = true;
private bool $checkDbPlatform = true;

/** @var MetadataStorageConfiguration */
private $metadataStorageConfiguration;
private ?MetadataStorageConfiguration $metadataStorageConfiguration = null;

/** @var bool */
private $frozen = false;
private bool $frozen = false;

public function freeze(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
*/
final class ConfigurationFile implements ConnectionLoader
{
/** @var string */
private $filename;
private string $filename;

public function __construct(string $filename)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@

final class ConnectionRegistryConnection implements ConnectionLoader
{
/** @var ConnectionRegistry */
private $registry;
private ConnectionRegistry $registry;

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

public static function withSimpleDefault(ConnectionRegistry $registry, ?string $connectionName = null): self
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

final class ExistingConnection implements ConnectionLoader
{
/** @var Connection */
private $connection;
private Connection $connection;

public function __construct(Connection $connection)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*/
final class ConfigurationFile implements EntityManagerLoader
{
/** @var string */
private $filename;
private string $filename;

public function __construct(string $filename)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

final class ExistingEntityManager implements EntityManagerLoader
{
/** @var EntityManagerInterface */
private $entityManager;
private EntityManagerInterface $entityManager;

public function __construct(EntityManagerInterface $entityManager)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@

final class ManagerRegistryEntityManager implements EntityManagerLoader
{
/** @var ManagerRegistry */
private $registry;
private ManagerRegistry $registry;

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

public static function withSimpleDefault(ManagerRegistry $registry, ?string $managerName = null): self
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
final class ConfigurationArray implements ConfigurationLoader
{
/** @var array<string,mixed> */
private $configurations;
private array $configurations;

/**
* @param array<string,mixed> $configurations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
*/
final class ConfigurationFileWithFallback implements ConfigurationLoader
{
/** @var string|null */
private $file;
private ?string $file = null;

public function __construct(?string $file = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

final class ExistingConfiguration implements ConfigurationLoader
{
/** @var Configuration */
private $configurations;
private Configuration $configurations;

public function __construct(Configuration $configurations)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
final class FormattedFile extends ConfigurationFile
{
/** @var callable[] */
private $loaders = [];
private array $loaders = [];

private function setDefaultLoaders(): void
{
Expand Down
15 changes: 5 additions & 10 deletions lib/Doctrine/Migrations/DbalMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,15 @@
*/
class DbalMigrator implements Migrator
{
/** @var Stopwatch */
private $stopwatch;
private Stopwatch $stopwatch;

/** @var LoggerInterface */
private $logger;
private LoggerInterface $logger;

/** @var Executor */
private $executor;
private Executor $executor;

/** @var Connection */
private $connection;
private Connection $connection;

/** @var EventDispatcher */
private $dispatcher;
private EventDispatcher $dispatcher;

public function __construct(
Connection $connection,
Expand Down