Skip to content

Commit

Permalink
Small cleanup after review
Browse files Browse the repository at this point in the history
  • Loading branch information
Zombaya committed Feb 26, 2024
1 parent f58810f commit a1189b2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/DependencyInjection/DoctrineEncryptExtension.php
Expand Up @@ -59,17 +59,20 @@ public function load(array $configs, ContainerBuilder $container): void
$loader->load('services_with_secret.yml');
}

// Symfony 1-3
if (Kernel::MAJOR_VERSION < 5) {
throw new \RuntimeException('doctrineencryptbundle/doctrine-encrypt-bundle expects symfony-version >= 4.1!');
// Symfony 4-6
} elseif (Kernel::MAJOR_VERSION < 7) {
// Symfony 1-4
// Sanity-check since this should be blocked by composer.json
if (Kernel::MAJOR_VERSION < 5 || (Kernel::MAJOR_VERSION === 5 && Kernel::MINOR_VERSION < 4)) {
throw new \RuntimeException('doctrineencryptbundle/doctrine-encrypt-bundle expects symfony-version >= 5.4!');
}

// Symfony 5-6
if (Kernel::MAJOR_VERSION < 7) {
// PHP 7.x (no attributes)
if (PHP_VERSION_ID < 80000) {
$loader->load('services_subscriber_sf4_php7.yml');
$loader->load('services_subscriber_with_annotations.yml');
// PHP 8.x (annotations and attributes)
} else {
$loader->load('services_subscriber_sf4_php8.yml');
$loader->load('services_subscriber_with_annotations_and_attributes.yml');
}
// Symfony 7 (only attributes)
} else {
Expand Down

0 comments on commit a1189b2

Please sign in to comment.