diff --git a/README.md b/README.md
index bde2a080c..37314e529 100644
--- a/README.md
+++ b/README.md
@@ -7,19 +7,19 @@ This component is part of "Step-up Authentication as-a Service". See [Stepup-Dep
## Requirements
- * PHP 5.6+ or PHP7
+ * PHP 8.2
* [Composer](https://getcomposer.org/)
* A web server (Apache, Nginx)
- * MariaDB 10
+ * MariaDB 10.6
* A working [Gateway](https://github.com/OpenConext/Stepup-Gateway)
## Installation
Clone the repository or download the archive to a directory. Install the dependencies by running `composer install` and fill out the database credentials et cetera.
-Make sure to run database migrations using `bin/console middleware:migrations:migrate`.
+Make sure to run database migrations using `bin/console doctrine:migrations:migrate`.
-When using 'Stepup-Deploy' the 'deploy' entity manager should be used in order to use the correct credentials e.g. `bin/console middleware:migrations:migrate --em=deploy`
+When using 'Stepup-Deploy' the 'deploy' entity manager should be used in order to use the correct credentials e.g. `bin/console doctrine:migrations:migrate --em=deploy`
## Management API
@@ -31,6 +31,9 @@ Some of the configuration of the components is static (i.e. stored in parametere
## Development Notes
+### Technical debt
+ * https://github.com/broadway/event-store-dbal is blocks upgrade to `doctrine/dbal:^4.0`
+
### Adding new events
Whenever adding a new event, be sure to update `bin/config/events.yml`.
diff --git a/ci/qa/phpstan-baseline.neon b/ci/qa/phpstan-baseline.neon
index 351a6ce71..a3f03eb61 100644
--- a/ci/qa/phpstan-baseline.neon
+++ b/ci/qa/phpstan-baseline.neon
@@ -2850,12 +2850,6 @@ parameters:
count: 1
path: ../../src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/DateTimeType.php
- -
- message: '#^Parameter \#2 \$datetime of static method DateTime\:\:createFromFormat\(\) expects string, mixed given\.$#'
- identifier: argument.type
- count: 1
- path: ../../src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/DateTimeType.php
-
-
message: '#^Parameter \#1 \$documentNumber of class Surfnet\\Stepup\\Identity\\Value\\DocumentNumber constructor expects string, mixed given\.$#'
identifier: argument.type
@@ -2928,12 +2922,6 @@ parameters:
count: 1
path: ../../src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/NameIdType.php
- -
- message: '#^Cannot cast T of mixed to int\.$#'
- identifier: cast.int
- count: 1
- path: ../../src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/NumberOfTokensPerIdentityType.php
-
-
message: '#^Parameter \#1 \$raLocationName of class Surfnet\\Stepup\\Configuration\\Value\\RaLocationName constructor expects string, mixed given\.$#'
identifier: argument.type
@@ -4566,30 +4554,6 @@ parameters:
count: 1
path: ../../src/Surfnet/StepupMiddleware/ManagementBundle/Validator/ServiceProviderConfigurationValidator.php
- -
- message: '#^Parameter \#1 \$value of static method Assert\\Assertion\:\:nullOrDate\(\) expects string\|null, mixed given\.$#'
- identifier: argument.type
- count: 1
- path: ../../src/Surfnet/StepupMiddleware/MiddlewareBundle/Console/Command/EmailVerifiedSecondFactorRemindersCommand.php
-
- -
- message: '#^Parameter \#2 \$datetime of static method DateTime\:\:createFromFormat\(\) expects string, mixed given\.$#'
- identifier: argument.type
- count: 1
- path: ../../src/Surfnet/StepupMiddleware/MiddlewareBundle/Console/Command/EmailVerifiedSecondFactorRemindersCommand.php
-
- -
- message: '#^Parameter \#2 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#'
- identifier: argument.type
- count: 1
- path: ../../src/Surfnet/StepupMiddleware/MiddlewareBundle/Console/Command/EmailVerifiedSecondFactorRemindersCommand.php
-
- -
- message: '#^Property Surfnet\\StepupMiddleware\\CommandHandlingBundle\\Identity\\Command\\SendVerifiedSecondFactorRemindersCommand\:\:\$dryRun \(bool\) does not accept mixed\.$#'
- identifier: assign.propertyType
- count: 1
- path: ../../src/Surfnet/StepupMiddleware/MiddlewareBundle/Console/Command/EmailVerifiedSecondFactorRemindersCommand.php
-
-
message: '#^Cannot access property \$id on Surfnet\\StepupMiddleware\\ApiBundle\\Identity\\Entity\\Identity\|null\.$#'
identifier: property.nonObject
@@ -4614,18 +4578,6 @@ parameters:
count: 1
path: ../../src/Surfnet/StepupMiddleware/MiddlewareBundle/Console/Command/MigrateSecondFactorCommand.php
- -
- message: '#^Cannot cast mixed to int\.$#'
- identifier: cast.int
- count: 1
- path: ../../src/Surfnet/StepupMiddleware/MiddlewareBundle/Console/Command/ReplayEventsCommand.php
-
- -
- message: '#^Parameter \#2 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#'
- identifier: argument.type
- count: 1
- path: ../../src/Surfnet/StepupMiddleware/MiddlewareBundle/Console/Command/ReplayEventsCommand.php
-
-
message: '#^Parameter \#1 \$projector of method Surfnet\\StepupMiddleware\\MiddlewareBundle\\Service\\TransactionAwareEventDispatcher\:\:registerProjector\(\) expects Broadway\\EventHandling\\EventListener, mixed given\.$#'
identifier: argument.type
diff --git a/component_info b/component_info
index 7c1720a07..22d3e04a3 100644
--- a/component_info
+++ b/component_info
@@ -1,5 +1,5 @@
PHP_VERSION=82
-SYMFONY_VERSION=6
+SYMFONY_VERSION=7
ENCORE=no
ASSETIC=no
NODE_VERSION=20
diff --git a/composer.json b/composer.json
index 80a34d30b..40ea0f809 100644
--- a/composer.json
+++ b/composer.json
@@ -16,7 +16,14 @@
"src/Surfnet/StepupMiddleware/ApiBundle/Tests/Request/commands.php"
]
},
- "minimum-stability": "stable",
+ "repositories": [
+ {
+ "type": "vcs",
+ "url": "https://github.com/johanib/event-store-dbal"
+ }
+ ],
+ "minimum-stability": "dev",
+ "prefer-stable": true,
"require": {
"php": "^8.2",
"ext-gmp": "*",
@@ -24,8 +31,9 @@
"ext-openssl": "*",
"ext-pdo": "*",
"broadway/broadway": "^2.5",
- "broadway/event-store-dbal": "^0.6",
+ "broadway/event-store-dbal": "dev-feature/dbal4#35c9fa7d938cccb874f53042b5a1aca9f67dba96",
"doctrine/annotations": "^2.0",
+ "doctrine/dbal": "^4",
"doctrine/doctrine-bundle": "^2.13.2",
"doctrine/doctrine-migrations-bundle": "^3.4.1",
"doctrine/orm": "^3.3.2",
diff --git a/composer.lock b/composer.lock
index bf36ea57f..1ab7155eb 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": "6400ab9c8bde2340c2bdda954f98b18d",
+ "content-hash": "e4754e4505fea59dd4a964609ffa69a2",
"packages": [
{
"name": "beberlei/assert",
@@ -224,28 +224,30 @@
},
{
"name": "broadway/event-store-dbal",
- "version": "0.6.0",
+ "version": "dev-feature/dbal4",
"source": {
"type": "git",
- "url": "https://github.com/broadway/event-store-dbal.git",
- "reference": "7cc0b51cdd8312c4f8919d3b2f6688d85b65cc58"
+ "url": "https://github.com/johanib/event-store-dbal.git",
+ "reference": "35c9fa7d938cccb874f53042b5a1aca9f67dba96"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/broadway/event-store-dbal/zipball/7cc0b51cdd8312c4f8919d3b2f6688d85b65cc58",
- "reference": "7cc0b51cdd8312c4f8919d3b2f6688d85b65cc58",
+ "url": "https://api.github.com/repos/johanib/event-store-dbal/zipball/35c9fa7d938cccb874f53042b5a1aca9f67dba96",
+ "reference": "35c9fa7d938cccb874f53042b5a1aca9f67dba96",
"shasum": ""
},
"require": {
- "broadway/broadway": "^2.3.1",
- "doctrine/dbal": "^3.1",
- "php": ">=7.2"
+ "broadway/broadway": "^2.5",
+ "doctrine/dbal": "^4.3",
+ "php": "^8.1"
},
"require-dev": {
"broadway/coding-standard": "^1.2",
"ext-pdo_sqlite": "*",
+ "phpspec/prophecy": "^1.15",
+ "phpspec/prophecy-phpunit": "^2.2",
"phpstan/phpstan": "@stable",
- "phpunit/phpunit": "^9.5",
+ "phpunit/phpunit": "^10.5",
"ramsey/uuid": "^4.0"
},
"type": "library",
@@ -259,7 +261,11 @@
"Broadway\\EventStore\\Dbal\\": "src/"
}
},
- "notification-url": "https://packagist.org/downloads/",
+ "autoload-dev": {
+ "psr-4": {
+ "Broadway\\EventStore\\Dbal\\": "test/"
+ }
+ },
"license": [
"MIT"
],
@@ -291,10 +297,9 @@
],
"description": "Event store implementation using doctrine/dbal",
"support": {
- "issues": "https://github.com/broadway/event-store-dbal/issues",
- "source": "https://github.com/broadway/event-store-dbal/tree/0.6.0"
+ "source": "https://github.com/johanib/event-store-dbal/tree/feature/dbal4"
},
- "time": "2021-06-24T09:42:53+00:00"
+ "time": "2025-11-27T13:46:13+00:00"
},
{
"name": "broadway/uuid-generator",
@@ -581,48 +586,40 @@
},
{
"name": "doctrine/dbal",
- "version": "3.10.3",
+ "version": "4.3.4",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
- "reference": "65edaca19a752730f290ec2fb89d593cb40afb43"
+ "reference": "1a2fbd0e93b8dec7c3d1ac2b6396a7b929b130dc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/dbal/zipball/65edaca19a752730f290ec2fb89d593cb40afb43",
- "reference": "65edaca19a752730f290ec2fb89d593cb40afb43",
+ "url": "https://api.github.com/repos/doctrine/dbal/zipball/1a2fbd0e93b8dec7c3d1ac2b6396a7b929b130dc",
+ "reference": "1a2fbd0e93b8dec7c3d1ac2b6396a7b929b130dc",
"shasum": ""
},
"require": {
- "composer-runtime-api": "^2",
- "doctrine/deprecations": "^0.5.3|^1",
- "doctrine/event-manager": "^1|^2",
- "php": "^7.4 || ^8.0",
+ "doctrine/deprecations": "^1.1.5",
+ "php": "^8.2",
"psr/cache": "^1|^2|^3",
"psr/log": "^1|^2|^3"
},
- "conflict": {
- "doctrine/cache": "< 1.11"
- },
"require-dev": {
- "doctrine/cache": "^1.11|^2.0",
"doctrine/coding-standard": "14.0.0",
"fig/log-test": "^1",
- "jetbrains/phpstorm-stubs": "2023.1",
+ "jetbrains/phpstorm-stubs": "2023.2",
"phpstan/phpstan": "2.1.30",
+ "phpstan/phpstan-phpunit": "2.0.7",
"phpstan/phpstan-strict-rules": "^2",
- "phpunit/phpunit": "9.6.29",
+ "phpunit/phpunit": "11.5.23",
"slevomat/coding-standard": "8.24.0",
"squizlabs/php_codesniffer": "4.0.0",
- "symfony/cache": "^5.4|^6.0|^7.0",
- "symfony/console": "^4.4|^5.4|^6.0|^7.0"
+ "symfony/cache": "^6.3.8|^7.0",
+ "symfony/console": "^5.4|^6.3|^7.0"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
},
- "bin": [
- "bin/doctrine-dbal"
- ],
"type": "library",
"autoload": {
"psr-4": {
@@ -675,7 +672,7 @@
],
"support": {
"issues": "https://github.com/doctrine/dbal/issues",
- "source": "https://github.com/doctrine/dbal/tree/3.10.3"
+ "source": "https://github.com/doctrine/dbal/tree/4.3.4"
},
"funding": [
{
@@ -691,7 +688,7 @@
"type": "tidelift"
}
],
- "time": "2025-10-09T09:05:12+00:00"
+ "time": "2025-10-09T09:11:36+00:00"
},
{
"name": "doctrine/deprecations",
@@ -12139,11 +12136,12 @@
}
],
"aliases": [],
- "minimum-stability": "stable",
+ "minimum-stability": "dev",
"stability-flags": {
+ "broadway/event-store-dbal": 20,
"mockery/mockery": 20
},
- "prefer-stable": false,
+ "prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": "^8.2",
diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml
index a4059ac3b..ac9751383 100644
--- a/config/packages/doctrine.yaml
+++ b/config/packages/doctrine.yaml
@@ -119,7 +119,6 @@ doctrine:
auto_mapping: false
entity_managers:
middleware:
- report_fields_where_declared: true
connection: middleware
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
mappings:
@@ -144,7 +143,6 @@ doctrine:
schema_ignore_classes:
- Surfnet\StepupMiddleware\ApiBundle\Identity\Entity\RaCandidate
gateway:
- report_fields_where_declared: true
connection: gateway
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
mappings:
@@ -153,7 +151,6 @@ doctrine:
type: attribute
is_bundle: true
deploy:
- report_fields_where_declared: true
connection: deploy
when@dev:
diff --git a/src/Surfnet/Migrations/Version20141031133057.php b/src/Surfnet/Migrations/Version20141031133057.php
index fcd621039..3aa341ff1 100644
--- a/src/Surfnet/Migrations/Version20141031133057.php
+++ b/src/Surfnet/Migrations/Version20141031133057.php
@@ -29,7 +29,7 @@ class Version20141031133057 extends AbstractMigration
public function up(Schema $schema): void
{
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -52,7 +52,7 @@ public function up(Schema $schema): void
public function down(Schema $schema): void
{
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141031144721.php b/src/Surfnet/Migrations/Version20141031144721.php
index 3e3dd53d9..c27461aee 100644
--- a/src/Surfnet/Migrations/Version20141031144721.php
+++ b/src/Surfnet/Migrations/Version20141031144721.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -43,7 +43,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141031163549.php b/src/Surfnet/Migrations/Version20141031163549.php
index e0abedaa1..f967e838f 100644
--- a/src/Surfnet/Migrations/Version20141031163549.php
+++ b/src/Surfnet/Migrations/Version20141031163549.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -43,7 +43,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141031164140.php b/src/Surfnet/Migrations/Version20141031164140.php
index cf2861bdc..927bdad1f 100644
--- a/src/Surfnet/Migrations/Version20141031164140.php
+++ b/src/Surfnet/Migrations/Version20141031164140.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -44,7 +44,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141112093720.php b/src/Surfnet/Migrations/Version20141112093720.php
index 2388dcd9c..bdbd4e8c0 100644
--- a/src/Surfnet/Migrations/Version20141112093720.php
+++ b/src/Surfnet/Migrations/Version20141112093720.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -46,7 +46,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141112094457.php b/src/Surfnet/Migrations/Version20141112094457.php
index 0d183dca7..d659c5a28 100644
--- a/src/Surfnet/Migrations/Version20141112094457.php
+++ b/src/Surfnet/Migrations/Version20141112094457.php
@@ -31,7 +31,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -46,7 +46,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141114095245.php b/src/Surfnet/Migrations/Version20141114095245.php
index db0fca27c..27aa7a5f2 100644
--- a/src/Surfnet/Migrations/Version20141114095245.php
+++ b/src/Surfnet/Migrations/Version20141114095245.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -46,7 +46,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141117230116.php b/src/Surfnet/Migrations/Version20141117230116.php
index 2c97e5947..61e083adf 100644
--- a/src/Surfnet/Migrations/Version20141117230116.php
+++ b/src/Surfnet/Migrations/Version20141117230116.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -43,7 +43,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141118114026.php b/src/Surfnet/Migrations/Version20141118114026.php
index ae90e61eb..cc2ec785c 100644
--- a/src/Surfnet/Migrations/Version20141118114026.php
+++ b/src/Surfnet/Migrations/Version20141118114026.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -42,7 +42,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141119093423.php b/src/Surfnet/Migrations/Version20141119093423.php
index b7d6b81ea..ecfc27891 100644
--- a/src/Surfnet/Migrations/Version20141119093423.php
+++ b/src/Surfnet/Migrations/Version20141119093423.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -43,7 +43,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141119113444.php b/src/Surfnet/Migrations/Version20141119113444.php
index 9227046b0..c7b85658a 100644
--- a/src/Surfnet/Migrations/Version20141119113444.php
+++ b/src/Surfnet/Migrations/Version20141119113444.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -43,7 +43,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141119113553.php b/src/Surfnet/Migrations/Version20141119113553.php
index 9219c2c06..abd6b81c2 100644
--- a/src/Surfnet/Migrations/Version20141119113553.php
+++ b/src/Surfnet/Migrations/Version20141119113553.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -43,7 +43,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141120150430.php b/src/Surfnet/Migrations/Version20141120150430.php
index 8052f5031..6bf13cc64 100644
--- a/src/Surfnet/Migrations/Version20141120150430.php
+++ b/src/Surfnet/Migrations/Version20141120150430.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -43,7 +43,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141120152310.php b/src/Surfnet/Migrations/Version20141120152310.php
index 4801976d6..d98284b6f 100644
--- a/src/Surfnet/Migrations/Version20141120152310.php
+++ b/src/Surfnet/Migrations/Version20141120152310.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -41,7 +41,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141125154133.php b/src/Surfnet/Migrations/Version20141125154133.php
index f26870c78..302280213 100644
--- a/src/Surfnet/Migrations/Version20141125154133.php
+++ b/src/Surfnet/Migrations/Version20141125154133.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -41,7 +41,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141125154214.php b/src/Surfnet/Migrations/Version20141125154214.php
index be52f6174..765b453fb 100644
--- a/src/Surfnet/Migrations/Version20141125154214.php
+++ b/src/Surfnet/Migrations/Version20141125154214.php
@@ -29,7 +29,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -40,7 +40,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141125155001.php b/src/Surfnet/Migrations/Version20141125155001.php
index 731e9e24e..b4c94c9f1 100644
--- a/src/Surfnet/Migrations/Version20141125155001.php
+++ b/src/Surfnet/Migrations/Version20141125155001.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -41,7 +41,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141125173004.php b/src/Surfnet/Migrations/Version20141125173004.php
index f8df2b3a6..0048d891c 100644
--- a/src/Surfnet/Migrations/Version20141125173004.php
+++ b/src/Surfnet/Migrations/Version20141125173004.php
@@ -37,7 +37,7 @@ public function up(Schema $schema): void
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -59,7 +59,7 @@ public function down(Schema $schema): void
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141128143908.php b/src/Surfnet/Migrations/Version20141128143908.php
index 3473c4d01..6d5347f84 100644
--- a/src/Surfnet/Migrations/Version20141128143908.php
+++ b/src/Surfnet/Migrations/Version20141128143908.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -47,7 +47,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141128143946.php b/src/Surfnet/Migrations/Version20141128143946.php
index 3a4763528..8709beddf 100644
--- a/src/Surfnet/Migrations/Version20141128143946.php
+++ b/src/Surfnet/Migrations/Version20141128143946.php
@@ -29,7 +29,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -40,7 +40,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141202121811.php b/src/Surfnet/Migrations/Version20141202121811.php
index 0fa7aeac4..c91e5c8ef 100644
--- a/src/Surfnet/Migrations/Version20141202121811.php
+++ b/src/Surfnet/Migrations/Version20141202121811.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -41,7 +41,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141204140639.php b/src/Surfnet/Migrations/Version20141204140639.php
index 1952502ff..e3f7b2d20 100644
--- a/src/Surfnet/Migrations/Version20141204140639.php
+++ b/src/Surfnet/Migrations/Version20141204140639.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -41,7 +41,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141205112641.php b/src/Surfnet/Migrations/Version20141205112641.php
index 6567d3889..09329e2de 100644
--- a/src/Surfnet/Migrations/Version20141205112641.php
+++ b/src/Surfnet/Migrations/Version20141205112641.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -43,7 +43,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141208121040.php b/src/Surfnet/Migrations/Version20141208121040.php
index 170013440..49017defa 100644
--- a/src/Surfnet/Migrations/Version20141208121040.php
+++ b/src/Surfnet/Migrations/Version20141208121040.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -43,7 +43,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141208162045.php b/src/Surfnet/Migrations/Version20141208162045.php
index 3f56ce5ba..b21b66961 100644
--- a/src/Surfnet/Migrations/Version20141208162045.php
+++ b/src/Surfnet/Migrations/Version20141208162045.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -46,7 +46,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141208172438.php b/src/Surfnet/Migrations/Version20141208172438.php
index dc8afb8ea..a526783eb 100644
--- a/src/Surfnet/Migrations/Version20141208172438.php
+++ b/src/Surfnet/Migrations/Version20141208172438.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -43,7 +43,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141209150426.php b/src/Surfnet/Migrations/Version20141209150426.php
index 3bb0ee217..e1a8b466e 100644
--- a/src/Surfnet/Migrations/Version20141209150426.php
+++ b/src/Surfnet/Migrations/Version20141209150426.php
@@ -38,7 +38,7 @@ public function up(Schema $schema): void
$middlewareUser = $this->getMiddlewareUser();
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -63,7 +63,7 @@ public function down(Schema $schema): void
$middlewareUser = $this->getMiddlewareUser();
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141210174213.php b/src/Surfnet/Migrations/Version20141210174213.php
index d0a4ff6ab..e1ab15db1 100644
--- a/src/Surfnet/Migrations/Version20141210174213.php
+++ b/src/Surfnet/Migrations/Version20141210174213.php
@@ -36,7 +36,7 @@ public function up(Schema $schema): void
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -54,7 +54,7 @@ public function down(Schema $schema): void
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20141215150518.php b/src/Surfnet/Migrations/Version20141215150518.php
index 97f046187..f5093c151 100644
--- a/src/Surfnet/Migrations/Version20141215150518.php
+++ b/src/Surfnet/Migrations/Version20141215150518.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -41,7 +41,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150217122017.php b/src/Surfnet/Migrations/Version20150217122017.php
index 5b8bfea1b..fe274306d 100644
--- a/src/Surfnet/Migrations/Version20150217122017.php
+++ b/src/Surfnet/Migrations/Version20150217122017.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -41,7 +41,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150225155343.php b/src/Surfnet/Migrations/Version20150225155343.php
index 07f7c92c6..f7981d094 100644
--- a/src/Surfnet/Migrations/Version20150225155343.php
+++ b/src/Surfnet/Migrations/Version20150225155343.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -43,7 +43,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150305114932.php b/src/Surfnet/Migrations/Version20150305114932.php
index 25d09c2f6..a402b5673 100644
--- a/src/Surfnet/Migrations/Version20150305114932.php
+++ b/src/Surfnet/Migrations/Version20150305114932.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -44,7 +44,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150305115030.php b/src/Surfnet/Migrations/Version20150305115030.php
index f2c58e05e..369c96831 100644
--- a/src/Surfnet/Migrations/Version20150305115030.php
+++ b/src/Surfnet/Migrations/Version20150305115030.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -42,7 +42,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150305134846.php b/src/Surfnet/Migrations/Version20150305134846.php
index 9ecfc3b85..eb684f57d 100644
--- a/src/Surfnet/Migrations/Version20150305134846.php
+++ b/src/Surfnet/Migrations/Version20150305134846.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -47,7 +47,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150312134629.php b/src/Surfnet/Migrations/Version20150312134629.php
index f1b78a853..ce11c9524 100644
--- a/src/Surfnet/Migrations/Version20150312134629.php
+++ b/src/Surfnet/Migrations/Version20150312134629.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -50,7 +50,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150312162849.php b/src/Surfnet/Migrations/Version20150312162849.php
index 170300ecf..09e6631cd 100644
--- a/src/Surfnet/Migrations/Version20150312162849.php
+++ b/src/Surfnet/Migrations/Version20150312162849.php
@@ -34,7 +34,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -51,7 +51,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150330160809.php b/src/Surfnet/Migrations/Version20150330160809.php
index 4bb54cecc..921c37f13 100644
--- a/src/Surfnet/Migrations/Version20150330160809.php
+++ b/src/Surfnet/Migrations/Version20150330160809.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -43,7 +43,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150407103950.php b/src/Surfnet/Migrations/Version20150407103950.php
index c8e92a004..f4fd967fc 100644
--- a/src/Surfnet/Migrations/Version20150407103950.php
+++ b/src/Surfnet/Migrations/Version20150407103950.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -41,7 +41,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150408122247.php b/src/Surfnet/Migrations/Version20150408122247.php
index 8cfb9fef3..9c1105a35 100644
--- a/src/Surfnet/Migrations/Version20150408122247.php
+++ b/src/Surfnet/Migrations/Version20150408122247.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -43,7 +43,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150409142404.php b/src/Surfnet/Migrations/Version20150409142404.php
index c64f5fc02..6f85534fe 100644
--- a/src/Surfnet/Migrations/Version20150409142404.php
+++ b/src/Surfnet/Migrations/Version20150409142404.php
@@ -30,7 +30,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -43,7 +43,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150422162952.php b/src/Surfnet/Migrations/Version20150422162952.php
index 4919e38ec..d6893a816 100644
--- a/src/Surfnet/Migrations/Version20150422162952.php
+++ b/src/Surfnet/Migrations/Version20150422162952.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -49,7 +49,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150428153351.php b/src/Surfnet/Migrations/Version20150428153351.php
index a3864a6e2..23e0df627 100644
--- a/src/Surfnet/Migrations/Version20150428153351.php
+++ b/src/Surfnet/Migrations/Version20150428153351.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -49,7 +49,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150428174400.php b/src/Surfnet/Migrations/Version20150428174400.php
index e1bbbb113..eb68de23b 100644
--- a/src/Surfnet/Migrations/Version20150428174400.php
+++ b/src/Surfnet/Migrations/Version20150428174400.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -49,7 +49,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150501123735.php b/src/Surfnet/Migrations/Version20150501123735.php
index fc2221cd7..d928397f6 100644
--- a/src/Surfnet/Migrations/Version20150501123735.php
+++ b/src/Surfnet/Migrations/Version20150501123735.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -53,7 +53,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150504102420.php b/src/Surfnet/Migrations/Version20150504102420.php
index 968e9b8ad..c00a230c4 100644
--- a/src/Surfnet/Migrations/Version20150504102420.php
+++ b/src/Surfnet/Migrations/Version20150504102420.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -48,7 +48,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150507124421.php b/src/Surfnet/Migrations/Version20150507124421.php
index a04bda692..dc2c813bf 100644
--- a/src/Surfnet/Migrations/Version20150507124421.php
+++ b/src/Surfnet/Migrations/Version20150507124421.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -68,7 +68,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150508085838.php b/src/Surfnet/Migrations/Version20150508085838.php
index 43b0c7c65..da00b9fab 100644
--- a/src/Surfnet/Migrations/Version20150508085838.php
+++ b/src/Surfnet/Migrations/Version20150508085838.php
@@ -37,7 +37,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -59,7 +59,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150518152006.php b/src/Surfnet/Migrations/Version20150518152006.php
index 9b68543d2..5f45968fc 100644
--- a/src/Surfnet/Migrations/Version20150518152006.php
+++ b/src/Surfnet/Migrations/Version20150518152006.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -49,7 +49,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150522163053.php b/src/Surfnet/Migrations/Version20150522163053.php
index c121b3ab1..555c9daa7 100644
--- a/src/Surfnet/Migrations/Version20150522163053.php
+++ b/src/Surfnet/Migrations/Version20150522163053.php
@@ -39,7 +39,7 @@ public function up(Schema $schema): void
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -59,7 +59,7 @@ public function down(Schema $schema): void
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150522164907.php b/src/Surfnet/Migrations/Version20150522164907.php
index 9b679a350..fa1654320 100644
--- a/src/Surfnet/Migrations/Version20150522164907.php
+++ b/src/Surfnet/Migrations/Version20150522164907.php
@@ -39,7 +39,7 @@ public function up(Schema $schema): void
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -60,7 +60,7 @@ public function down(Schema $schema): void
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150526152956.php b/src/Surfnet/Migrations/Version20150526152956.php
index 501dca23f..4d46bd155 100644
--- a/src/Surfnet/Migrations/Version20150526152956.php
+++ b/src/Surfnet/Migrations/Version20150526152956.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -47,7 +47,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150528154959.php b/src/Surfnet/Migrations/Version20150528154959.php
index abce6140d..7838fb1c3 100644
--- a/src/Surfnet/Migrations/Version20150528154959.php
+++ b/src/Surfnet/Migrations/Version20150528154959.php
@@ -37,7 +37,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -53,7 +53,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150601154557.php b/src/Surfnet/Migrations/Version20150601154557.php
index 051ad51d3..7d5264a98 100644
--- a/src/Surfnet/Migrations/Version20150601154557.php
+++ b/src/Surfnet/Migrations/Version20150601154557.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -47,7 +47,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150601154942.php b/src/Surfnet/Migrations/Version20150601154942.php
index cf8ea69e6..eca8799e6 100644
--- a/src/Surfnet/Migrations/Version20150601154942.php
+++ b/src/Surfnet/Migrations/Version20150601154942.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -47,7 +47,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150604143755.php b/src/Surfnet/Migrations/Version20150604143755.php
index 4230552cd..1fcad9a81 100644
--- a/src/Surfnet/Migrations/Version20150604143755.php
+++ b/src/Surfnet/Migrations/Version20150604143755.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -57,7 +57,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150604143756.php b/src/Surfnet/Migrations/Version20150604143756.php
index 21cc0a045..5508d8b33 100644
--- a/src/Surfnet/Migrations/Version20150604143756.php
+++ b/src/Surfnet/Migrations/Version20150604143756.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -57,7 +57,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150604143757.php b/src/Surfnet/Migrations/Version20150604143757.php
index 7d39a0717..4c885dd4f 100644
--- a/src/Surfnet/Migrations/Version20150604143757.php
+++ b/src/Surfnet/Migrations/Version20150604143757.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -47,7 +47,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150604143758.php b/src/Surfnet/Migrations/Version20150604143758.php
index 2a4ea45ea..e23ad6f61 100644
--- a/src/Surfnet/Migrations/Version20150604143758.php
+++ b/src/Surfnet/Migrations/Version20150604143758.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -47,7 +47,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150611105956.php b/src/Surfnet/Migrations/Version20150611105956.php
index 12c126b17..7c0a2a77e 100644
--- a/src/Surfnet/Migrations/Version20150611105956.php
+++ b/src/Surfnet/Migrations/Version20150611105956.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -58,7 +58,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150611163038.php b/src/Surfnet/Migrations/Version20150611163038.php
index 27040d946..aaf6dba5d 100644
--- a/src/Surfnet/Migrations/Version20150611163038.php
+++ b/src/Surfnet/Migrations/Version20150611163038.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -55,7 +55,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150615114646.php b/src/Surfnet/Migrations/Version20150615114646.php
index f784f9c46..0369b6256 100644
--- a/src/Surfnet/Migrations/Version20150615114646.php
+++ b/src/Surfnet/Migrations/Version20150615114646.php
@@ -38,7 +38,7 @@ public function up(Schema $schema): void
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -71,7 +71,7 @@ public function down(Schema $schema): void
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150617141129.php b/src/Surfnet/Migrations/Version20150617141129.php
index 17e9e9bb8..ae7318cdd 100644
--- a/src/Surfnet/Migrations/Version20150617141129.php
+++ b/src/Surfnet/Migrations/Version20150617141129.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -49,7 +49,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20150618121907.php b/src/Surfnet/Migrations/Version20150618121907.php
index 96d033b63..15d5eaa97 100644
--- a/src/Surfnet/Migrations/Version20150618121907.php
+++ b/src/Surfnet/Migrations/Version20150618121907.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -47,7 +47,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20160607142244.php b/src/Surfnet/Migrations/Version20160607142244.php
index f6d3dad93..3a9620d95 100644
--- a/src/Surfnet/Migrations/Version20160607142244.php
+++ b/src/Surfnet/Migrations/Version20160607142244.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20160617163830.php b/src/Surfnet/Migrations/Version20160617163830.php
index af7f45469..7cd48f803 100644
--- a/src/Surfnet/Migrations/Version20160617163830.php
+++ b/src/Surfnet/Migrations/Version20160617163830.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -74,7 +74,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20160620153812.php b/src/Surfnet/Migrations/Version20160620153812.php
index ac08989ce..3c0d351c9 100644
--- a/src/Surfnet/Migrations/Version20160620153812.php
+++ b/src/Surfnet/Migrations/Version20160620153812.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -72,7 +72,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20160621112027.php b/src/Surfnet/Migrations/Version20160621112027.php
index 5177f42b5..1110431ed 100644
--- a/src/Surfnet/Migrations/Version20160621112027.php
+++ b/src/Surfnet/Migrations/Version20160621112027.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -49,7 +49,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20160622100140.php b/src/Surfnet/Migrations/Version20160622100140.php
index d89237784..f5ecb5171 100644
--- a/src/Surfnet/Migrations/Version20160622100140.php
+++ b/src/Surfnet/Migrations/Version20160622100140.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -49,7 +49,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20160622160146.php b/src/Surfnet/Migrations/Version20160622160146.php
index 5343cbaf5..dcfb27b5e 100644
--- a/src/Surfnet/Migrations/Version20160622160146.php
+++ b/src/Surfnet/Migrations/Version20160622160146.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -50,7 +50,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20160719090050.php b/src/Surfnet/Migrations/Version20160719090050.php
index d5ae89866..7c181bc9b 100644
--- a/src/Surfnet/Migrations/Version20160719090050.php
+++ b/src/Surfnet/Migrations/Version20160719090050.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -49,7 +49,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20160719090051.php b/src/Surfnet/Migrations/Version20160719090051.php
index c534a9d61..59239a9bb 100644
--- a/src/Surfnet/Migrations/Version20160719090051.php
+++ b/src/Surfnet/Migrations/Version20160719090051.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -49,7 +49,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20170210140051.php b/src/Surfnet/Migrations/Version20170210140051.php
index 450cf9e1b..3e9cc37f9 100644
--- a/src/Surfnet/Migrations/Version20170210140051.php
+++ b/src/Surfnet/Migrations/Version20170210140051.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -49,7 +49,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20170216085513.php b/src/Surfnet/Migrations/Version20170216085513.php
index ff79dd3d0..70b846059 100644
--- a/src/Surfnet/Migrations/Version20170216085513.php
+++ b/src/Surfnet/Migrations/Version20170216085513.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -48,7 +48,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20171113123232.php b/src/Surfnet/Migrations/Version20171113123232.php
index 309e4447c..8bf132a21 100644
--- a/src/Surfnet/Migrations/Version20171113123232.php
+++ b/src/Surfnet/Migrations/Version20171113123232.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -48,7 +48,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20180116091349.php b/src/Surfnet/Migrations/Version20180116091349.php
index 13dd0cc0e..0fbb9c1fe 100644
--- a/src/Surfnet/Migrations/Version20180116091349.php
+++ b/src/Surfnet/Migrations/Version20180116091349.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -49,7 +49,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20180131150800.php b/src/Surfnet/Migrations/Version20180131150800.php
index 005e978bf..2f5250766 100644
--- a/src/Surfnet/Migrations/Version20180131150800.php
+++ b/src/Surfnet/Migrations/Version20180131150800.php
@@ -37,7 +37,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -54,7 +54,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20180330094402.php b/src/Surfnet/Migrations/Version20180330094402.php
index 9805c85ff..bff840e08 100644
--- a/src/Surfnet/Migrations/Version20180330094402.php
+++ b/src/Surfnet/Migrations/Version20180330094402.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -49,7 +49,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20180409100948.php b/src/Surfnet/Migrations/Version20180409100948.php
index 47cde0ba0..167cd68f3 100644
--- a/src/Surfnet/Migrations/Version20180409100948.php
+++ b/src/Surfnet/Migrations/Version20180409100948.php
@@ -34,7 +34,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -53,7 +53,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() != 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
$this->addSql('ALTER TABLE institution_configuration_options DROP number_of_tokens_per_identity_option');
diff --git a/src/Surfnet/Migrations/Version20180926144517.php b/src/Surfnet/Migrations/Version20180926144517.php
index 180e5d7f8..54c9db6a2 100644
--- a/src/Surfnet/Migrations/Version20180926144517.php
+++ b/src/Surfnet/Migrations/Version20180926144517.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -49,7 +49,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20181023151546.php b/src/Surfnet/Migrations/Version20181023151546.php
index 34107ca4d..bce7171ce 100644
--- a/src/Surfnet/Migrations/Version20181023151546.php
+++ b/src/Surfnet/Migrations/Version20181023151546.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -68,7 +68,7 @@ public function down(Schema $schema): void
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20181101103348.php b/src/Surfnet/Migrations/Version20181101103348.php
index 5dcb5067e..aa00bd380 100644
--- a/src/Surfnet/Migrations/Version20181101103348.php
+++ b/src/Surfnet/Migrations/Version20181101103348.php
@@ -38,7 +38,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -52,7 +52,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20190211163604.php b/src/Surfnet/Migrations/Version20190211163604.php
index 25db5f005..397c11ce5 100644
--- a/src/Surfnet/Migrations/Version20190211163604.php
+++ b/src/Surfnet/Migrations/Version20190211163604.php
@@ -33,7 +33,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
@@ -54,7 +54,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20200416135127.php b/src/Surfnet/Migrations/Version20200416135127.php
index 65fb9e749..28bf2dc7f 100644
--- a/src/Surfnet/Migrations/Version20200416135127.php
+++ b/src/Surfnet/Migrations/Version20200416135127.php
@@ -29,7 +29,7 @@ class Version20200416135127 extends AbstractMigration
public function up(Schema $schema): void
{
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
diff --git a/src/Surfnet/Migrations/Version20210308092347.php b/src/Surfnet/Migrations/Version20210308092347.php
index 1fe1f1417..40d53b5cb 100644
--- a/src/Surfnet/Migrations/Version20210308092347.php
+++ b/src/Surfnet/Migrations/Version20210308092347.php
@@ -32,7 +32,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
$this->addSql('ALTER TABLE institution_configuration_options ADD self_vet_option INT DEFAULT \'0\' NOT NULL');
@@ -42,7 +42,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
$this->addSql('ALTER TABLE institution_configuration_options DROP self_vet_option');
diff --git a/src/Surfnet/Migrations/Version20210610131957.php b/src/Surfnet/Migrations/Version20210610131957.php
index f463e4586..792fdb3c1 100644
--- a/src/Surfnet/Migrations/Version20210610131957.php
+++ b/src/Surfnet/Migrations/Version20210610131957.php
@@ -68,7 +68,7 @@ public function up(Schema $schema): void
$this->write("Migating: {$uuid}#{$playhead}");
$payload = $this->stripSensitiveData($rawPayload);
- $this->connection->executeUpdate(
+ $this->connection->executeStatement(
self::$update,
[
'payload' => $payload,
diff --git a/src/Surfnet/Migrations/Version20220519134637.php b/src/Surfnet/Migrations/Version20220519134637.php
index 1eba25a72..1727ffb33 100644
--- a/src/Surfnet/Migrations/Version20220519134637.php
+++ b/src/Surfnet/Migrations/Version20220519134637.php
@@ -36,7 +36,7 @@ public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
$this->addSql(
@@ -77,7 +77,7 @@ public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
$this->addSql('ALTER TABLE institution_configuration_options DROP self_asserted_tokens_option');
diff --git a/src/Surfnet/Migrations/Version20221102143350.php b/src/Surfnet/Migrations/Version20221102143350.php
index 5da598094..9b42f7b1c 100644
--- a/src/Surfnet/Migrations/Version20221102143350.php
+++ b/src/Surfnet/Migrations/Version20221102143350.php
@@ -32,7 +32,7 @@ final class Version20221102143350 extends AbstractMigration implements Configura
public function up(Schema $schema): void
{
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
// Create the new sso_on_2fa option, note the name conversion 'error' made by doctrine.
@@ -50,7 +50,7 @@ public function up(Schema $schema): void
public function down(Schema $schema): void
{
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
// Down the Middleware schema change
diff --git a/src/Surfnet/Migrations/Version20250501121457.php b/src/Surfnet/Migrations/Version20250501121457.php
index 084ca5507..297f6c705 100644
--- a/src/Surfnet/Migrations/Version20250501121457.php
+++ b/src/Surfnet/Migrations/Version20250501121457.php
@@ -32,7 +32,7 @@ final class Version20250501121457 extends AbstractMigration implements Configura
public function up(Schema $schema): void
{
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
// Create the new sso_on_2fa option, note the name conversion 'error' made by doctrine.
@@ -55,7 +55,7 @@ public function up(Schema $schema): void
public function down(Schema $schema): void
{
$this->abortIf(
- $this->connection->getDatabasePlatform()->getName() !== 'mysql',
+ !($this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MySQLPlatform || $this->connection->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\MariaDBPlatform),
'Migration can only be executed safely on \'mysql\'.',
);
// Down the Middleware schema change
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/AuthorityRoleType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/AuthorityRoleType.php
index d55845991..ef85e3531 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/AuthorityRoleType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/AuthorityRoleType.php
@@ -19,7 +19,7 @@
namespace Surfnet\StepupMiddleware\ApiBundle\Doctrine\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\Type;
use Surfnet\StepupMiddleware\ApiBundle\Exception\InvalidArgumentException;
use Surfnet\StepupMiddleware\ApiBundle\Identity\Value\AuthorityRole;
@@ -49,7 +49,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
return (string)$value;
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?AuthorityRole
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?AuthorityRole
{
if (is_null($value)) {
return null;
@@ -58,13 +58,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?Authorit
try {
$authorityRole = new AuthorityRole($value);
} catch (InvalidArgumentException $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $authorityRole;
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/CommonNameType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/CommonNameType.php
index 9252c8da5..ebb430a81 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/CommonNameType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/CommonNameType.php
@@ -19,7 +19,7 @@
namespace Surfnet\StepupMiddleware\ApiBundle\Doctrine\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Exception\InvalidArgumentException;
use Surfnet\Stepup\Identity\Value\CommonName;
@@ -34,6 +34,7 @@ class CommonNameType extends Type
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
{
+ $column['length'] = $column['length'] ?? 255;
return $platform->getStringTypeDeclarationSQL($column);
}
@@ -46,7 +47,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
return (string)$value;
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?CommonName
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?CommonName
{
if (is_null($value)) {
return null;
@@ -55,13 +56,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?CommonNa
try {
$commonName = new CommonName($value);
} catch (InvalidArgumentException|TypeError $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $commonName;
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ConfigurationContactInformationType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ConfigurationContactInformationType.php
index ef3167b99..56a9591e0 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ConfigurationContactInformationType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ConfigurationContactInformationType.php
@@ -22,6 +22,7 @@
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Configuration\Value\ContactInformation;
use Surfnet\Stepup\Exception\InvalidArgumentException;
@@ -58,7 +59,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): mixe
return $value->getContactInformation();
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?ContactInformation
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?ContactInformation
{
if (is_null($value)) {
return null;
@@ -67,13 +68,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?ContactI
try {
$contactInformation = new ContactInformation($value);
} catch (InvalidArgumentException|TypeError $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $contactInformation;
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ConfigurationInstitutionType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ConfigurationInstitutionType.php
index 18de4be50..597953870 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ConfigurationInstitutionType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ConfigurationInstitutionType.php
@@ -20,6 +20,7 @@
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Configuration\Value\Institution;
use Surfnet\Stepup\Exception\InvalidArgumentException;
@@ -33,6 +34,7 @@ class ConfigurationInstitutionType extends Type
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
{
+ $column['length'] = $column['length'] ?? 255;
return $platform->getStringTypeDeclarationSQL($column);
}
@@ -55,7 +57,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): mixe
return $value->getInstitution();
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?Institution
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Institution
{
if (is_null($value)) {
return null;
@@ -64,13 +66,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?Institut
try {
$institution = new Institution($value);
} catch (InvalidArgumentException $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $institution;
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ConfigurationLocationType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ConfigurationLocationType.php
index 55f0324f1..5c21e8fa5 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ConfigurationLocationType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ConfigurationLocationType.php
@@ -22,6 +22,7 @@
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Configuration\Value\Location;
use Surfnet\Stepup\Exception\InvalidArgumentException;
@@ -58,7 +59,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): mixe
return $value->getLocation();
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?Location
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Location
{
if (is_null($value)) {
return null;
@@ -67,13 +68,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?Location
try {
$location = new Location($value);
} catch (InvalidArgumentException|TypeError $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $location;
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ContactInformationType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ContactInformationType.php
index d9b399dab..f2fe8b363 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ContactInformationType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ContactInformationType.php
@@ -21,7 +21,7 @@
namespace Surfnet\StepupMiddleware\ApiBundle\Doctrine\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Exception\InvalidArgumentException;
use Surfnet\Stepup\Identity\Value\ContactInformation;
@@ -48,7 +48,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): mixe
return (string)$value;
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?ContactInformation
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?ContactInformation
{
if (is_null($value)) {
return null;
@@ -57,13 +57,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?ContactI
try {
$contactInformation = new ContactInformation($value);
} catch (InvalidArgumentException|TypeError $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $contactInformation;
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/DateTimeType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/DateTimeType.php
index 0457837a5..06869f1a2 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/DateTimeType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/DateTimeType.php
@@ -22,6 +22,7 @@
use DateTimeZone;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\InvalidFormat;
use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\DateTime\DateTime;
@@ -63,6 +64,14 @@ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Da
return null;
}
+ if (!is_string($value)) {
+ throw InvalidFormat::new(
+ is_scalar($value) ? (string)$value : get_debug_type($value),
+ $this->getName(),
+ $platform->getDateTimeFormatString(),
+ );
+ }
+
$dateTime = CoreDateTime::createFromFormat(
$platform->getDateTimeFormatString(),
$value,
@@ -70,7 +79,7 @@ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Da
);
if (!$dateTime) {
- throw ConversionException::conversionFailedFormat(
+ throw InvalidFormat::new(
$value,
$this->getName(),
$platform->getDateTimeFormatString(),
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/DocumentNumberType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/DocumentNumberType.php
index 49eea8447..8a9fc5538 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/DocumentNumberType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/DocumentNumberType.php
@@ -35,6 +35,7 @@ class DocumentNumberType extends Type
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
{
+ $column['length'] = $column['length'] ?? 255;
return $platform->getStringTypeDeclarationSQL($column);
}
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/EmailType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/EmailType.php
index 330510131..4d825d0c6 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/EmailType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/EmailType.php
@@ -19,7 +19,7 @@
namespace Surfnet\StepupMiddleware\ApiBundle\Doctrine\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Exception\InvalidArgumentException;
use Surfnet\Stepup\Identity\Value\Email;
@@ -33,6 +33,7 @@ class EmailType extends Type
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
{
+ $column['length'] = $column['length'] ?? 255;
return $platform->getStringTypeDeclarationSQL($column);
}
@@ -45,7 +46,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
return (string)$value;
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?Email
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Email
{
if (is_null($value)) {
return null;
@@ -54,13 +55,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?Email
try {
$email = new Email($value);
} catch (InvalidArgumentException $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $email;
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/InstitutionRoleType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/InstitutionRoleType.php
index b300d21da..324b50ba9 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/InstitutionRoleType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/InstitutionRoleType.php
@@ -20,6 +20,7 @@
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Configuration\Value\InstitutionRole;
use Surfnet\Stepup\Exception\InvalidArgumentException;
@@ -33,6 +34,7 @@ class InstitutionRoleType extends Type
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
{
+ $column['length'] = $column['length'] ?? 255;
return $platform->getStringTypeDeclarationSQL($column);
}
@@ -55,7 +57,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): mixe
return $value->getType();
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?InstitutionRole
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?InstitutionRole
{
if (is_null($value)) {
return null;
@@ -64,13 +66,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?Institut
try {
$institutionRole = new InstitutionRole($value);
} catch (InvalidArgumentException $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $institutionRole;
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/InstitutionType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/InstitutionType.php
index 1de1dc879..549d51aa9 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/InstitutionType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/InstitutionType.php
@@ -19,7 +19,7 @@
namespace Surfnet\StepupMiddleware\ApiBundle\Doctrine\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Exception\InvalidArgumentException;
use Surfnet\Stepup\Identity\Value\Institution;
@@ -33,6 +33,7 @@ class InstitutionType extends Type
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
{
+ $column['length'] = $column['length'] ?? 255;
return $platform->getStringTypeDeclarationSQL($column);
}
@@ -45,7 +46,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
return (string)$value;
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?Institution
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Institution
{
if (is_null($value)) {
return null;
@@ -54,13 +55,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?Institut
try {
$institution = new Institution($value);
} catch (InvalidArgumentException $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $institution;
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/LocaleType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/LocaleType.php
index 1520fd75c..e62b93b4b 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/LocaleType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/LocaleType.php
@@ -21,7 +21,7 @@
namespace Surfnet\StepupMiddleware\ApiBundle\Doctrine\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Exception\InvalidArgumentException;
use Surfnet\Stepup\Identity\Value\Locale;
@@ -36,6 +36,7 @@ class LocaleType extends Type
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
{
+ $column['length'] = $column['length'] ?? 255;
return $platform->getStringTypeDeclarationSQL($column);
}
@@ -48,7 +49,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
return (string)$value;
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?Locale
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Locale
{
if (is_null($value)) {
return null;
@@ -57,13 +58,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?Locale
try {
$locale = new Locale($value);
} catch (InvalidArgumentException|TypeError $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $locale;
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/LocationType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/LocationType.php
index 1a4bfe8a7..bf1ad7295 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/LocationType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/LocationType.php
@@ -21,7 +21,7 @@
namespace Surfnet\StepupMiddleware\ApiBundle\Doctrine\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Exception\InvalidArgumentException;
use Surfnet\Stepup\Identity\Value\Location;
@@ -48,7 +48,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
return (string)$value;
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?Location
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Location
{
if (is_null($value)) {
return null;
@@ -57,13 +57,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?Location
try {
$location = new Location($value);
} catch (InvalidArgumentException|TypeError $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $location;
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/NameIdType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/NameIdType.php
index f1c4138d9..17c3b5ee3 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/NameIdType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/NameIdType.php
@@ -19,7 +19,7 @@
namespace Surfnet\StepupMiddleware\ApiBundle\Doctrine\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Exception\InvalidArgumentException;
use Surfnet\Stepup\Identity\Value\NameId;
@@ -33,6 +33,7 @@ class NameIdType extends Type
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
{
+ $column['length'] = $column['length'] ?? 255;
return $platform->getStringTypeDeclarationSQL($column);
}
@@ -45,7 +46,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
return (string)$value;
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?NameId
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?NameId
{
if (is_null($value)) {
return null;
@@ -54,13 +55,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?NameId
try {
$nameId = new NameId($value);
} catch (InvalidArgumentException $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $nameId;
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/NumberOfTokensPerIdentityType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/NumberOfTokensPerIdentityType.php
index 8ac75e8bb..d11033426 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/NumberOfTokensPerIdentityType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/NumberOfTokensPerIdentityType.php
@@ -18,16 +18,18 @@
namespace Surfnet\StepupMiddleware\ApiBundle\Doctrine\Type;
+use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
-use Doctrine\DBAL\Types\IntegerType;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
+use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Configuration\Value\NumberOfTokensPerIdentityOption;
use Surfnet\Stepup\Exception\InvalidArgumentException;
/**
* Custom Type for the NumberOfTokensPerIdentityOption Value Object
*/
-class NumberOfTokensPerIdentityType extends IntegerType
+class NumberOfTokensPerIdentityType extends Type
{
public const NAME = 'stepup_number_of_tokens_per_identity_option';
@@ -56,22 +58,28 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): mixe
return $value->getNumberOfTokensPerIdentity();
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?NumberOfTokensPerIdentityOption
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?NumberOfTokensPerIdentityOption
{
if (is_null($value)) {
return null;
}
+ if (!is_numeric($value)) {
+ throw ValueNotConvertible::new(
+ $value,
+ $this->getName(),
+ );
+ }
+
try {
$numberOfTokensPerIdentityOption = new NumberOfTokensPerIdentityOption((int)$value);
} catch (InvalidArgumentException $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $numberOfTokensPerIdentityOption;
@@ -81,4 +89,9 @@ public function getName(): string
{
return self::NAME;
}
+
+ public function getBindingType(): ParameterType
+ {
+ return ParameterType::INTEGER;
+ }
}
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/RaLocationNameType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/RaLocationNameType.php
index eefeefad1..55e0184bf 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/RaLocationNameType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/RaLocationNameType.php
@@ -20,6 +20,7 @@
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Configuration\Value\RaLocationName;
use Surfnet\Stepup\Exception\InvalidArgumentException;
@@ -33,7 +34,8 @@ class RaLocationNameType extends Type
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
{
- return $platform->getStringTypeDeclarationSQL([]);
+ $column['length'] = $column['length'] ?? 255;
+ return $platform->getStringTypeDeclarationSQL($column);
}
public function convertToDatabaseValue($value, AbstractPlatform $platform): mixed
@@ -55,7 +57,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): mixe
return $value->getRaLocationName();
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?RaLocationName
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?RaLocationName
{
if (is_null($value)) {
return null;
@@ -64,13 +66,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?RaLocati
try {
$raLocationName = new RaLocationName($value);
} catch (InvalidArgumentException $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $raLocationName;
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SecondFactorTypeType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SecondFactorTypeType.php
index 74d2a6a48..c0243a1d0 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SecondFactorTypeType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SecondFactorTypeType.php
@@ -19,7 +19,7 @@
namespace Surfnet\StepupMiddleware\ApiBundle\Doctrine\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Exception\InvalidArgumentException;
use Surfnet\StepupBundle\Value\SecondFactorType;
@@ -33,6 +33,7 @@ class SecondFactorTypeType extends Type
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
{
+ $column['length'] = $column['length'] ?? 255;
return $platform->getStringTypeDeclarationSQL($column);
}
@@ -45,7 +46,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
return (string)$value;
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?SecondFactorType
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?SecondFactorType
{
if (is_null($value)) {
return null;
@@ -54,13 +55,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?SecondFa
try {
$secondFactorType = new SecondFactorType($value);
} catch (InvalidArgumentException $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $secondFactorType;
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SelfAssertedTokensOptionType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SelfAssertedTokensOptionType.php
index 57a49af4e..06345f39a 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SelfAssertedTokensOptionType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SelfAssertedTokensOptionType.php
@@ -18,16 +18,18 @@
namespace Surfnet\StepupMiddleware\ApiBundle\Doctrine\Type;
+use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
-use Doctrine\DBAL\Types\IntegerType;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
+use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Configuration\Value\SelfAssertedTokensOption;
use TypeError;
/**
* Custom Type for the SelfAssertedTokens options Value Object
*/
-class SelfAssertedTokensOptionType extends IntegerType
+class SelfAssertedTokensOptionType extends Type
{
public const NAME = 'stepup_self_asserted_tokens_option';
@@ -56,7 +58,7 @@ public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform)
return (int)$value->isEnabled();
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?SelfAssertedTokensOption
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?SelfAssertedTokensOption
{
if (is_null($value)) {
return null;
@@ -65,13 +67,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?SelfAsse
try {
$selfAssertedTokensOption = new SelfAssertedTokensOption((bool)$value);
} catch (TypeError $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $selfAssertedTokensOption;
@@ -81,4 +82,9 @@ public function getName(): string
{
return self::NAME;
}
+
+ public function getBindingType(): ParameterType
+ {
+ return ParameterType::INTEGER;
+ }
}
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SelfVetOptionType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SelfVetOptionType.php
index 6a32eb222..338028014 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SelfVetOptionType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SelfVetOptionType.php
@@ -18,16 +18,18 @@
namespace Surfnet\StepupMiddleware\ApiBundle\Doctrine\Type;
+use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
-use Doctrine\DBAL\Types\IntegerType;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
+use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Configuration\Value\SelfVetOption;
use TypeError;
/**
* Custom Type for the SelfVetOption Value Object
*/
-class SelfVetOptionType extends IntegerType
+class SelfVetOptionType extends Type
{
public const NAME = 'stepup_self_vet_option';
@@ -56,7 +58,7 @@ public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform)
return (int)$value->isEnabled();
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?SelfVetOption
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?SelfVetOption
{
if (is_null($value)) {
return null;
@@ -65,13 +67,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?SelfVetO
try {
$selfVetOption = new SelfVetOption((bool)$value);
} catch (TypeError $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $selfVetOption;
@@ -81,4 +82,9 @@ public function getName(): string
{
return self::NAME;
}
+
+ public function getBindingType(): ParameterType
+ {
+ return ParameterType::INTEGER;
+ }
}
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ShowRaaContactInformationOptionType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ShowRaaContactInformationOptionType.php
index 263320b61..8fe8ba82c 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ShowRaaContactInformationOptionType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/ShowRaaContactInformationOptionType.php
@@ -20,6 +20,7 @@
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Configuration\Value\ShowRaaContactInformationOption;
use Surfnet\Stepup\Exception\InvalidArgumentException;
@@ -55,7 +56,7 @@ public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform)
return (int)$value->isEnabled();
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?ShowRaaContactInformationOption
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?ShowRaaContactInformationOption
{
if (is_null($value)) {
return null;
@@ -66,13 +67,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?ShowRaaC
$platform->convertFromBoolean($value),
);
} catch (InvalidArgumentException $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $showRaaContactInformationOption;
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SsoOn2faOptionType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SsoOn2faOptionType.php
index 96818bc31..a739f090a 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SsoOn2faOptionType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SsoOn2faOptionType.php
@@ -18,16 +18,18 @@
namespace Surfnet\StepupMiddleware\ApiBundle\Doctrine\Type;
+use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
-use Doctrine\DBAL\Types\IntegerType;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
+use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Configuration\Value\SsoOn2faOption;
use TypeError;
/**
* Custom Type for the SsoOn2faOption Value Object
*/
-class SsoOn2faOptionType extends IntegerType
+class SsoOn2faOptionType extends Type
{
public const NAME = 'stepup_sso_on_2fa_option';
@@ -56,7 +58,7 @@ public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform)
return (int)$value->isEnabled();
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?SsoOn2faOption
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?SsoOn2faOption
{
if (is_null($value)) {
return null;
@@ -65,13 +67,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?SsoOn2fa
try {
$ssoOn2faOption = new SsoOn2faOption((bool)$value);
} catch (TypeError $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $ssoOn2faOption;
@@ -81,4 +82,9 @@ public function getName(): string
{
return self::NAME;
}
+
+ public function getBindingType(): ParameterType
+ {
+ return ParameterType::INTEGER;
+ }
}
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SsoRegistrationBypassOptionType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SsoRegistrationBypassOptionType.php
index 90924cb55..2a053a5ea 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SsoRegistrationBypassOptionType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/SsoRegistrationBypassOptionType.php
@@ -18,9 +18,11 @@
namespace Surfnet\StepupMiddleware\ApiBundle\Doctrine\Type;
+use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
-use Doctrine\DBAL\Types\IntegerType;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
+use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Configuration\Value\SsoRegistrationBypassOption;
use TypeError;
@@ -31,7 +33,7 @@
* "GSSP fallback" forwards the second factor authentications at LoA 1.5 to the fallback GSSP when a user does not have
* any active tokens
*/
-class SsoRegistrationBypassOptionType extends IntegerType
+class SsoRegistrationBypassOptionType extends Type
{
public const NAME = 'stepup_sso_registration_bypass_option';
@@ -60,7 +62,7 @@ public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform)
return (int)$value->isEnabled();
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?SsoRegistrationBypassOption
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?SsoRegistrationBypassOption
{
if (is_null($value)) {
return null;
@@ -69,13 +71,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?SsoRegis
try {
$ssoRegistrationBypassOption = new SsoRegistrationBypassOption((bool)$value);
} catch (TypeError $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $ssoRegistrationBypassOption;
@@ -85,4 +86,9 @@ public function getName(): string
{
return self::NAME;
}
+
+ public function getBindingType(): ParameterType
+ {
+ return ParameterType::INTEGER;
+ }
}
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/UseRaLocationsOptionType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/UseRaLocationsOptionType.php
index b4473bde8..6b71f0cc8 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/UseRaLocationsOptionType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/UseRaLocationsOptionType.php
@@ -20,6 +20,7 @@
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Configuration\Value\UseRaLocationsOption;
use Surfnet\Stepup\Exception\InvalidArgumentException;
@@ -55,7 +56,7 @@ public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform)
return (int)$value->isEnabled();
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?UseRaLocationsOption
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?UseRaLocationsOption
{
if (is_null($value)) {
return null;
@@ -64,13 +65,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?UseRaLoc
try {
$useRaLocationsOption = new UseRaLocationsOption($platform->convertFromBoolean($value));
} catch (InvalidArgumentException $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $useRaLocationsOption;
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/VerifyEmailOptionType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/VerifyEmailOptionType.php
index d0c153b79..27223f6fc 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/VerifyEmailOptionType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/VerifyEmailOptionType.php
@@ -18,16 +18,18 @@
namespace Surfnet\StepupMiddleware\ApiBundle\Doctrine\Type;
+use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\AbstractPlatform;
-use Doctrine\DBAL\Types\BooleanType;
use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
+use Doctrine\DBAL\Types\Type;
use Surfnet\Stepup\Configuration\Value\VerifyEmailOption;
use Surfnet\Stepup\Exception\InvalidArgumentException;
/**
* Custom Type for the VerifyEmailOption Value Object
*/
-class VerifyEmailOptionType extends BooleanType
+class VerifyEmailOptionType extends Type
{
public const NAME = 'stepup_verify_email_option';
@@ -55,7 +57,7 @@ public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform)
return (int)$value->isEnabled();
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?VerifyEmailOption
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?VerifyEmailOption
{
if (is_null($value)) {
return null;
@@ -64,13 +66,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?VerifyEm
try {
$verifyEmailOption = new VerifyEmailOption($platform->convertFromBoolean($value));
} catch (InvalidArgumentException $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $verifyEmailOption;
@@ -80,4 +81,9 @@ public function getName(): string
{
return self::NAME;
}
+
+ public function getBindingType(): ParameterType
+ {
+ return ParameterType::INTEGER;
+ }
}
diff --git a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/VettingTypeHintsType.php b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/VettingTypeHintsType.php
index 2034d71b7..5349abf02 100644
--- a/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/VettingTypeHintsType.php
+++ b/src/Surfnet/StepupMiddleware/ApiBundle/Doctrine/Type/VettingTypeHintsType.php
@@ -19,7 +19,7 @@
namespace Surfnet\StepupMiddleware\ApiBundle\Doctrine\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
use Doctrine\DBAL\Types\JsonType;
use Surfnet\Stepup\Exception\InvalidArgumentException;
use Surfnet\Stepup\Identity\Collection\VettingTypeHintCollection;
@@ -36,7 +36,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform): st
return $platform->getJsonTypeDeclarationSQL($column);
}
- public function convertToPHPValue($value, AbstractPlatform $platform): ?VettingTypeHintCollection
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?VettingTypeHintCollection
{
if (is_null($value)) {
return null;
@@ -46,13 +46,12 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?VettingT
$data = json_decode((string)$value, true);
$vettingTypeHints = VettingTypeHintCollection::deserialize($data);
} catch (InvalidArgumentException $e) {
- // get nice standard message, so we can throw it keeping the exception chain
- $doctrineExceptionMessage = ConversionException::conversionFailed(
+ throw ValueNotConvertible::new(
$value,
$this->getName(),
- )->getMessage();
-
- throw new ConversionException($doctrineExceptionMessage, 0, $e);
+ $e->getMessage(),
+ $e,
+ );
}
return $vettingTypeHints;
diff --git a/src/Surfnet/StepupMiddleware/MiddlewareBundle/Console/Command/EmailVerifiedSecondFactorRemindersCommand.php b/src/Surfnet/StepupMiddleware/MiddlewareBundle/Console/Command/EmailVerifiedSecondFactorRemindersCommand.php
index 51fc71928..35e9cc6f6 100644
--- a/src/Surfnet/StepupMiddleware/MiddlewareBundle/Console/Command/EmailVerifiedSecondFactorRemindersCommand.php
+++ b/src/Surfnet/StepupMiddleware/MiddlewareBundle/Console/Command/EmailVerifiedSecondFactorRemindersCommand.php
@@ -30,9 +30,8 @@
use Surfnet\StepupMiddleware\CommandHandlingBundle\Pipeline\TransactionAwarePipeline;
use Surfnet\StepupMiddleware\MiddlewareBundle\Service\DBALConnectionHelper;
use Symfony\Component\Console\Attribute\AsCommand;
+use Symfony\Component\Console\Attribute\Option;
use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
@@ -41,6 +40,9 @@
* The command utilizes a specific service for this task (VerifiedSecondFactorReminderService). Input validation is
* performed on the incoming request parameters.
*
+ * @TODO Once on Symfony 7.4, remove the `extends Command` and the parent constructor call
+ * @see https://github.com/symfony/symfony/commit/1886c105df2772c0a1a17fa739318c3bfb731ce9
+ *
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
*/
#[AsCommand(
@@ -49,46 +51,38 @@
)]
final class EmailVerifiedSecondFactorRemindersCommand extends Command
{
- protected function configure(): void
- {
- $this
- ->addOption(
- 'dry-run',
- null,
- InputOption::VALUE_NONE,
- 'Run in dry mode, not sending any email',
- )
- ->addOption(
- 'date',
- null,
- InputOption::VALUE_OPTIONAL,
- 'The date (Y-m-d) that should be used for sending reminder email messages, defaults to TODAY - 7',
- );
- }
-
public function __construct(
private readonly TransactionAwarePipeline $pipeline,
private readonly BufferedEventBus $eventBus,
private readonly DBALConnectionHelper $connection,
- private readonly LoggerInterface $logger,
+ private readonly LoggerInterface $logger
) {
parent::__construct();
}
- protected function execute(InputInterface $input, OutputInterface $output): int
- {
+ public function __invoke(
+ OutputInterface $output,
+ #[Option(description: 'Run in dry mode, not sending any email', name: 'dry-run')]
+ bool $dryRun = false,
+ #[Option(description: 'The date (Y-m-d) that should be used for sending reminder email messages, defaults to TODAY - 7', name: 'date')]
+ ?string $date = null,
+ ): int {
try {
- $this->validateInput($input);
+ Assertion::nullOrDate(
+ $date,
+ 'Y-m-d',
+ 'Expected date to be a string and formatted in the Y-m-d date format',
+ );
} catch (InvalidArgumentException $e) {
$output->writeln('' . $e->getMessage() . '');
$this->logger->error(sprintf('Invalid arguments passed to the %s', $this->getName()), [$e->getMessage()]);
return 1;
}
- $date = new DateTime();
- $date->sub(new DateInterval('P7D'));
- if ($input->hasOption('date') && !is_null($input->getOption('date'))) {
- $receivedDate = $input->getOption('date');
+ $now = new DateTime();
+ $now->sub(new DateInterval('P7D'));
+ if ($date) {
+ $receivedDate = $date;
$date = DateTime::createFromFormat('Y-m-d', $receivedDate);
if ($date === false) {
$output->writeln(
@@ -101,13 +95,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}
}
- $dryRun = false;
- if ($input->hasOption('dry-run') && !is_null($input->getOption('dry-run'))) {
- $dryRun = $input->getOption('dry-run');
- }
-
$command = new SendVerifiedSecondFactorRemindersCommand();
- $command->requestedAt = $date;
+ $command->requestedAt = $date ?: $now;
$command->dryRun = $dryRun;
$command->UUID = Uuid::uuid4()->toString();
@@ -124,21 +113,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}
return 0;
}
-
- private function validateInput(InputInterface $input): void
- {
- if ($input->hasOption('date')) {
- $date = $input->getOption('date');
- Assertion::nullOrDate(
- $date,
- 'Y-m-d',
- 'Expected date to be a string and formatted in the Y-m-d date format',
- );
- }
-
- if ($input->hasOption('dry-run')) {
- $dryRun = $input->getOption('dry-run');
- Assertion::nullOrBoolean($dryRun, 'Expected dry-run parameter to be a boolean value.');
- }
- }
}
diff --git a/src/Surfnet/StepupMiddleware/MiddlewareBundle/Console/Command/ReplayEventsCommand.php b/src/Surfnet/StepupMiddleware/MiddlewareBundle/Console/Command/ReplayEventsCommand.php
index 9ffd9648d..55d0c4536 100644
--- a/src/Surfnet/StepupMiddleware/MiddlewareBundle/Console/Command/ReplayEventsCommand.php
+++ b/src/Surfnet/StepupMiddleware/MiddlewareBundle/Console/Command/ReplayEventsCommand.php
@@ -20,11 +20,10 @@
use Surfnet\StepupMiddleware\MiddlewareBundle\Service\EventStreamReplayer;
use Symfony\Component\Console\Attribute\AsCommand;
-use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Attribute\Option;
use Symfony\Component\Console\Helper\FormatterHelper;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;
@@ -33,34 +32,26 @@
description: 'Wipes all read models and repopulates the tables from the event store. Use the
--no-interaction option to perform the event replay without the additional confirmation question.'
)]
-class ReplayEventsCommand extends Command
+class ReplayEventsCommand
{
- public function __construct(
- private readonly EventStreamReplayer $replayer,
- private readonly string $environment,
- ) {
- parent::__construct();
- }
-
- protected function configure(): void
+ public function __construct(private readonly EventStreamReplayer $replayer, private readonly string $environment)
{
- $this
- ->addOption(
- 'increments',
- 'i',
- InputOption::VALUE_REQUIRED,
- 'The amount of events that are replayed at once (repeated until all events are replayed)',
- 1000,
- );
}
- protected function execute(InputInterface $input, OutputInterface $output): int
- {
- /** @var FormatterHelper $formatter */
- $formatter = $this->getHelper('formatter');
+ public function __invoke(
+ OutputInterface $output,
+ InputInterface $input,
+ #[Option(
+ description: 'The amount of events that are replayed at once (repeated until all events are replayed)',
+ name: 'increments',
+ shortcut: 'i'
+ )
+ ]
+ int $increments = 1000,
+ ): int {
+ $formatter = new FormatterHelper();
// Be careful, when using the no-interaction option you will not get the confirmation question
- $noInteraction = $input->getOption('no-interaction');
if (!in_array($this->environment, ['dev_event_replay', 'prod_event_replay', 'smoketest_event_replay'])) {
$output->writeln(
@@ -78,8 +69,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return 1;
}
- /** @var QuestionHelper $interrogator */
- $interrogator = $this->getHelper('question');
+ $interrogator = new QuestionHelper();
if ($this->environment === 'prod_event_replay') {
$wantToRunOnProd = new ConfirmationQuestion(
'You have selected to run this on production. Have you disabled all access to the production '
@@ -93,12 +83,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return 1;
}
}
-
- $increments = (int)$input->getOption('increments');
if ($increments < 1) {
$output->writeln(
$formatter->formatBlock(
- sprintf('Increments must be a positive integer, "%s" given', $input->getOption('increments')),
+ sprintf('Increments must be a positive integer, "%s" given', $increments),
'error',
),
);
@@ -106,7 +94,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return 1;
}
- if (!$noInteraction) {
+ if ($input->isInteractive()) {
$output->writeln(['', $formatter->formatBlock(['', 'WARNING!!!!', ''], 'error'), '']);
$question = <<addOption(
- self::OPTION_LIST_EVENTS,
- null,
- InputOption::VALUE_NONE,
- 'List all events available to replay',
- )
- ->addOption(
- self::OPTION_LIST_PROJECTORS,
- null,
- InputOption::VALUE_NONE,
- 'List all projectors available for which events can be replayed',
- );
- }
-
public function __construct(
private readonly EventCollection $collection,
private readonly ProjectorCollection $projectorCollection,
private readonly PastEventsService $pastEventsService,
- private readonly TransactionAwareEventDispatcher $eventDispatcher,
+ private readonly TransactionAwareEventDispatcher $eventDispatcher
) {
- parent::__construct();
}
- protected function execute(InputInterface $input, OutputInterface $output): int
- {
+ public function __invoke(
+ InputInterface $input,
+ OutputInterface $output,
+ #[Option(description: 'List all events available to replay', name: self::OPTION_LIST_EVENTS)]
+ bool $listEvents = false,
+ #[Option(description: 'List all projectors available for which events can be replayed', name: self::OPTION_LIST_PROJECTORS)]
+ bool $listProjectors = false,
+ ): int {
$availableEvents = $this->collection->getEventNames();
$availableProjectors = $this->projectorCollection->getProjectorNames();
- if ($input->getOption(self::OPTION_LIST_EVENTS)) {
+ if ($listEvents) {
$output->writeln('The following events can be replayed:');
$output->writeln($availableEvents === [] ? 'None.' : $availableEvents);
return 0;
}
- if ($input->getOption(self::OPTION_LIST_PROJECTORS)) {
+ if ($listProjectors) {
$output->writeln('Events can be replayed for the following projectors:');
$output->writeln($availableProjectors === [] ? 'None.' : $availableProjectors);
@@ -90,8 +77,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return 1;
}
- /** @var QuestionHelper $questionHelper */
- $questionHelper = $this->getHelper('question');
+ $questionHelper = new QuestionHelper();
$selectEventsQuestion = new ChoiceQuestion(
'Which events would you like to replay? Please supply a comma-separated list of numbers.',
diff --git a/src/Surfnet/StepupMiddleware/MiddlewareBundle/EventSourcing/DBALEventHydrator.php b/src/Surfnet/StepupMiddleware/MiddlewareBundle/EventSourcing/DBALEventHydrator.php
index 67702b702..6f7ab766b 100644
--- a/src/Surfnet/StepupMiddleware/MiddlewareBundle/EventSourcing/DBALEventHydrator.php
+++ b/src/Surfnet/StepupMiddleware/MiddlewareBundle/EventSourcing/DBALEventHydrator.php
@@ -24,8 +24,8 @@
use Broadway\Serializer\SimpleInterfaceSerializer;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Exception;
+use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Statement;
-use PDO;
use Surfnet\StepupMiddleware\CommandHandlingBundle\SensitiveData\Forgettable;
use Surfnet\StepupMiddleware\CommandHandlingBundle\SensitiveData\SensitiveData;
@@ -63,8 +63,8 @@ public function getCount(): int
public function getFromTill(int $limit, int $offset): DomainEventStream
{
$statement = $this->prepareLoadStatement();
- $statement->bindValue('limit', $limit, PDO::PARAM_INT);
- $statement->bindValue('offset', $offset, PDO::PARAM_INT);
+ $statement->bindValue('limit', $limit, ParameterType::INTEGER);
+ $statement->bindValue('offset', $offset, ParameterType::INTEGER);
$result = $statement->executeQuery();
@@ -98,7 +98,10 @@ public function fetchByEventTypes(array $eventTypes): DomainEventStream
);
$statement = $this->connection->prepare($query);
- $results = $statement->executeQuery($eventTypes);
+ foreach ($eventTypes as $position => $parameter) {
+ $statement->bindValue($position + 1, $parameter);
+ }
+ $results = $statement->executeQuery();
$events = [];
foreach ($results->fetchAllAssociative() as $row) {
diff --git a/src/Surfnet/StepupMiddleware/MiddlewareBundle/Resources/config/services.yml b/src/Surfnet/StepupMiddleware/MiddlewareBundle/Resources/config/services.yml
index e3528efe9..d15802dee 100644
--- a/src/Surfnet/StepupMiddleware/MiddlewareBundle/Resources/config/services.yml
+++ b/src/Surfnet/StepupMiddleware/MiddlewareBundle/Resources/config/services.yml
@@ -9,12 +9,6 @@ services:
alias: 'monolog.logger'
public: true
- # Load services from src/ directory
- Surfnet\StepupMiddleware\MiddlewareBundle\:
- resource: '../../'
- exclude:
- - '../../Tests'
-
surfnet_stepup_middleware_middleware.dbal_connection_helper:
class: Surfnet\StepupMiddleware\MiddlewareBundle\Service\DBALConnectionHelper
arguments:
diff --git a/src/Surfnet/StepupMiddleware/MiddlewareBundle/Tests/Console/Command/EmailVerifiedSecondFactorRemindersCommandTest.php b/src/Surfnet/StepupMiddleware/MiddlewareBundle/Tests/Console/Command/EmailVerifiedSecondFactorRemindersCommandTest.php
new file mode 100644
index 000000000..b11ab36ad
--- /dev/null
+++ b/src/Surfnet/StepupMiddleware/MiddlewareBundle/Tests/Console/Command/EmailVerifiedSecondFactorRemindersCommandTest.php
@@ -0,0 +1,276 @@
+pipeline = m::mock(TransactionAwarePipeline::class);
+ $this->eventBus = m::mock(BufferedEventBus::class);
+ $this->connection = m::mock(DBALConnectionHelper::class);
+ $this->logger = new NullLogger();
+
+ $this->command = new EmailVerifiedSecondFactorRemindersCommand(
+ $this->pipeline,
+ $this->eventBus,
+ $this->connection,
+ $this->logger,
+ );
+
+ $application = new Application();
+ $application->add($this->command);
+
+ $this->commandTester = new CommandTester($this->command);
+ }
+
+ #[Test]
+ public function it_successfully_executes_with_default_date(): void
+ {
+ // Expect transaction handling
+ $this->connection->shouldReceive('beginTransaction')->once();
+ $this->connection->shouldReceive('commit')->once();
+
+ // Capture the command passed to pipeline
+ $this->pipeline->shouldReceive('process')
+ ->once()
+ ->with(m::type(SendVerifiedSecondFactorRemindersCommand::class))
+ ->andReturnUsing(function (SendVerifiedSecondFactorRemindersCommand $cmd) {
+ // Verify the command has correct properties
+ $this->assertInstanceOf(DateTime::class, $cmd->requestedAt);
+ $this->assertFalse($cmd->dryRun);
+ $this->assertNotEmpty($cmd->UUID);
+
+ // Verify date is 7 days ago
+ $expectedDate = new DateTime();
+ $expectedDate->sub(new DateInterval('P7D'));
+ $this->assertEquals($expectedDate->format('Y-m-d'), $cmd->requestedAt->format('Y-m-d'));
+
+ return $cmd;
+ });
+
+ $this->eventBus->shouldReceive('flush')->once();
+
+ // Execute command
+ $exitCode = $this->commandTester->execute([]);
+
+ $this->assertEquals(0, $exitCode);
+ }
+
+ #[Test]
+ public function it_successfully_executes_with_custom_date(): void
+ {
+ $customDate = '2024-12-15';
+
+ // Expect transaction handling
+ $this->connection->shouldReceive('beginTransaction')->once();
+ $this->connection->shouldReceive('commit')->once();
+
+ // Capture the command passed to pipeline
+ $this->pipeline->shouldReceive('process')
+ ->once()
+ ->with(m::type(SendVerifiedSecondFactorRemindersCommand::class))
+ ->andReturnUsing(function (SendVerifiedSecondFactorRemindersCommand $cmd) use ($customDate) {
+ $this->assertEquals($customDate, $cmd->requestedAt->format('Y-m-d'));
+ $this->assertFalse($cmd->dryRun);
+ return $cmd;
+ });
+
+ $this->eventBus->shouldReceive('flush')->once();
+
+ // Execute command with --date option
+ $exitCode = $this->commandTester->execute([
+ '--date' => $customDate,
+ ]);
+
+ $this->assertEquals(0, $exitCode);
+ }
+
+ #[Test]
+ public function it_successfully_executes_in_dry_run_mode(): void
+ {
+ // Expect transaction handling
+ $this->connection->shouldReceive('beginTransaction')->once();
+ $this->connection->shouldReceive('commit')->once();
+
+ // Capture the command passed to pipeline
+ $this->pipeline->shouldReceive('process')
+ ->once()
+ ->with(m::type(SendVerifiedSecondFactorRemindersCommand::class))
+ ->andReturnUsing(function (SendVerifiedSecondFactorRemindersCommand $cmd) {
+ $this->assertTrue($cmd->dryRun);
+ return $cmd;
+ });
+
+ $this->eventBus->shouldReceive('flush')->once();
+
+ // Execute command with --dry-run option
+ $exitCode = $this->commandTester->execute([
+ '--dry-run' => true,
+ ]);
+
+ $this->assertEquals(0, $exitCode);
+ }
+
+ #[Test]
+ public function it_successfully_executes_with_both_date_and_dry_run(): void
+ {
+ $customDate = '2024-11-20';
+
+ // Expect transaction handling
+ $this->connection->shouldReceive('beginTransaction')->once();
+ $this->connection->shouldReceive('commit')->once();
+
+ // Capture the command passed to pipeline
+ $this->pipeline->shouldReceive('process')
+ ->once()
+ ->with(m::type(SendVerifiedSecondFactorRemindersCommand::class))
+ ->andReturnUsing(function (SendVerifiedSecondFactorRemindersCommand $cmd) use ($customDate) {
+ $this->assertEquals($customDate, $cmd->requestedAt->format('Y-m-d'));
+ $this->assertTrue($cmd->dryRun);
+ return $cmd;
+ });
+
+ $this->eventBus->shouldReceive('flush')->once();
+
+ // Execute command with both options
+ $exitCode = $this->commandTester->execute([
+ '--date' => $customDate,
+ '--dry-run' => true,
+ ]);
+
+ $this->assertEquals(0, $exitCode);
+ }
+
+ #[Test]
+ public function it_returns_error_for_invalid_date_format(): void
+ {
+ $invalidDate = 'not-a-date';
+
+ // No transaction should be started for invalid input
+ $this->connection->shouldNotReceive('beginTransaction');
+ $this->pipeline->shouldNotReceive('process');
+ $this->eventBus->shouldNotReceive('flush');
+
+ // Execute command with invalid date
+ $exitCode = $this->commandTester->execute([
+ '--date' => $invalidDate,
+ ]);
+
+ $this->assertEquals(1, $exitCode);
+ $this->assertStringContainsString('date', $this->commandTester->getDisplay());
+ }
+
+ #[Test]
+ public function it_returns_error_for_incorrectly_formatted_date(): void
+ {
+ $invalidDate = '15-12-2024'; // Wrong format, should be Y-m-d
+
+ // No transaction should be started for invalid input
+ $this->connection->shouldNotReceive('beginTransaction');
+ $this->pipeline->shouldNotReceive('process');
+ $this->eventBus->shouldNotReceive('flush');
+
+ // Execute command with incorrectly formatted date
+ $exitCode = $this->commandTester->execute([
+ '--date' => $invalidDate,
+ ]);
+
+ $this->assertEquals(1, $exitCode);
+ $this->assertStringContainsString('date', $this->commandTester->getDisplay());
+ }
+
+ #[Test]
+ public function it_rolls_back_transaction_on_exception(): void
+ {
+ // Expect transaction handling
+ $this->connection->shouldReceive('beginTransaction')->once();
+ $this->connection->shouldReceive('rollBack')->once();
+
+ // Pipeline throws an exception
+ $exception = new Exception('Pipeline processing failed');
+ $this->pipeline->shouldReceive('process')
+ ->once()
+ ->andThrow($exception);
+
+ // Event bus should not be flushed when exception occurs
+ $this->eventBus->shouldNotReceive('flush');
+
+ // Execute command and expect exception to be re-thrown
+ $this->expectException(Exception::class);
+ $this->expectExceptionMessage('Pipeline processing failed');
+
+ $this->commandTester->execute([]);
+ }
+
+ #[Test]
+ public function it_rolls_back_transaction_when_event_bus_flush_fails(): void
+ {
+ // Expect transaction handling
+ $this->connection->shouldReceive('beginTransaction')->once();
+ $this->connection->shouldReceive('rollBack')->once();
+
+ // Pipeline succeeds
+ $this->pipeline->shouldReceive('process')->once();
+
+ // Event bus flush throws an exception
+ $exception = new Exception('Event bus flush failed');
+ $this->eventBus->shouldReceive('flush')
+ ->once()
+ ->andThrow($exception);
+
+ // Execute command and expect exception to be re-thrown
+ $this->expectException(Exception::class);
+ $this->expectExceptionMessage('Event bus flush failed');
+
+ $this->commandTester->execute([]);
+ }
+}