diff --git a/.gitignore b/.gitignore index dcd1e5738..7ce5213c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ tests/phpunit.xml phpunit.xml +.phpunit.result.cache /cli-config.php jackrabbit/ vendor/ diff --git a/bin/phpcrodm.php b/bin/phpcrodm.php index de55df0ea..06cda987c 100755 --- a/bin/phpcrodm.php +++ b/bin/phpcrodm.php @@ -21,7 +21,9 @@ use Doctrine\Common\Annotations\AnnotationRegistry; -AnnotationRegistry::registerLoader([$autoload, 'loadClass']); +if (method_exists(AnnotationRegistry::class, 'registerLoader')) { + AnnotationRegistry::registerLoader([$autoload, 'loadClass']); +} $configFile = getcwd().DIRECTORY_SEPARATOR.'cli-config.php'; diff --git a/composer.json b/composer.json index 25d715c83..2b01de2e0 100644 --- a/composer.json +++ b/composer.json @@ -14,11 +14,11 @@ "prefer-stable": true, "require": { "php": "^7.1 || ^8.0", - "doctrine/collections": "^1.0", + "doctrine/collections": "^1.0 || ^2.0", "doctrine/common": "^2.4 || ^3.0", - "doctrine/annotations": "^1.2", + "doctrine/annotations": "^1.2 || ^2.0", "doctrine/data-fixtures": "^1.0", - "doctrine/event-manager": "^1.0", + "doctrine/event-manager": "^1.0 || ^2.0", "doctrine/persistence": "^1.3.7 || ^2.0", "phpcr/phpcr": "^2.1.1", "phpcr/phpcr-implementation": "^2.1", diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 9e620099f..1efc8ce71 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -16,4 +16,6 @@ use Doctrine\Common\Annotations\AnnotationRegistry; -AnnotationRegistry::registerLoader([$autoload, 'loadClass']); +if (method_exists(AnnotationRegistry::class, 'registerLoader')) { + AnnotationRegistry::registerLoader([$autoload, 'loadClass']); +}