diff --git a/GearmanBundle.php b/GearmanBundle.php index dc4fbbc..1d66ee0 100644 --- a/GearmanBundle.php +++ b/GearmanBundle.php @@ -3,6 +3,8 @@ namespace Mmoreram\GearmanBundle; use Doctrine\Common\Annotations\AnnotationRegistry; +use Mmoreram\GearmanBundle\Driver\Gearman\Job; +use Mmoreram\GearmanBundle\Driver\Gearman\Work; use Symfony\Component\HttpKernel\Bundle\Bundle; class GearmanBundle extends Bundle @@ -12,16 +14,7 @@ class GearmanBundle extends Bundle */ public function boot() { - $kernel = $this->container->get('kernel'); - - AnnotationRegistry::registerFile( - $kernel - ->locateResource("@GearmanBundle/Driver/Gearman/Work.php") - ); - - AnnotationRegistry::registerFile( - $kernel - ->locateResource("@GearmanBundle/Driver/Gearman/Job.php") - ); + AnnotationRegistry::loadAnnotationClass(Work::class); + AnnotationRegistry::loadAnnotationClass(Job::class); } } \ No newline at end of file diff --git a/composer.json b/composer.json index 1568ada..08cd167 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "require": { "php": "^7.4 || ^8.0", "ext-gearman": "*", - "doctrine/annotations": "^1.5", + "doctrine/annotations": "^2.0", "symfony/dependency-injection": "^4.0 || ^5.0 || ^6.0", "symfony/yaml": "^4.4 || ^5.0 || ^6.0", "symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0",