Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions GearmanBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace Mmoreram\GearmanBundle;

use Doctrine\Common\Annotations\AnnotationRegistry;
use Mmoreram\GearmanBundle\Driver\Gearman\Work;
use Mmoreram\GearmanBundle\Driver\Gearman\Job;
use Symfony\Component\HttpKernel\Bundle\Bundle;

class GearmanBundle extends Bundle
Expand All @@ -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);
}
}
6 changes: 3 additions & 3 deletions Tests/Module/WorkerClassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Mmoreram\GearmanBundle\Tests\Module;

use Doctrine\Common\Annotations\SimpleAnnotationReader;
use Doctrine\Common\Annotations\AnnotationReader;

use Mmoreram\GearmanBundle\Driver\Gearman\Work as WorkAnnotation;
use Mmoreram\GearmanBundle\Module\WorkerClass;
Expand All @@ -38,7 +38,7 @@ class WorkerClassTest extends \PHPUnit\Framework\TestCase
private $reflectionClass;

/**
* @var SimpleAnnotationReader
* @var AnnotationReader
*
* Reader
*/
Expand Down Expand Up @@ -115,7 +115,7 @@ public function setUp(): void
->getMock();

$this->reader = $this
->getMockBuilder('Doctrine\Common\Annotations\SimpleAnnotationReader')
->getMockBuilder('Doctrine\Common\Annotations\AnnotationReader')
->disableOriginalConstructor()
->setMethods([
'getMethodAnnotations',
Expand Down
2 changes: 1 addition & 1 deletion Tests/Service/GearmanParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function testParseNamespaceMapSomePaths()
$excludedPaths = [];

$reader = $this
->getMockBuilder('\Doctrine\Common\Annotations\SimpleAnnotationReader')
->getMockBuilder('\Doctrine\Common\Annotations\AnnotationReader')
->setMethods(null)
->getMock();

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"require": {
"php": "^7.4 || ^8.0",
"ext-gearman": "*",
"doctrine/annotations": "^1.5",
"doctrine/annotations": "^1.5 || ^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",
Expand Down
Loading