Quellcode durchsuchen

Fixed minimum doctrine common version to 2.2.0-dev

Removed some unused uses
Marc vor 11 Jahren
Ursprung
Commit
e703d2da63
2 geänderte Dateien mit 3 neuen und 17 gelöschten Zeilen
  1. 2 16
      Service/GearmanCacheWrapper.php
  2. 1 1
      composer.json

+ 2 - 16
Service/GearmanCacheWrapper.php

@@ -11,17 +11,13 @@ namespace Mmoreram\GearmanBundle\Service;
 
 use Symfony\Component\Config\FileLocator;
 use Doctrine\Common\Annotations\Reader;
-use Doctrine\Common\Annotations\AnnotationReader;
 use Doctrine\Common\Annotations\AnnotationRegistry;
 use Symfony\Component\HttpKernel\Kernel;
-use Symfony\Component\Routing\Loader\AnnotationDirectoryLoader;
 use Doctrine\Common\Cache\Cache;
 use Symfony\Component\Finder\Finder;
 use Doctrine\Common\Annotations\SimpleAnnotationReader;
-use \Doctrine\Common\Version as DoctrineVersion;
 
 use Mmoreram\GearmanBundle\Module\WorkerCollection;
-use Mmoreram\GearmanBundle\Module\WorkerDirectoryLoader;
 use Mmoreram\GearmanBundle\Module\WorkerClass as Worker;
 use Mmoreram\GearmanBundle\Driver\Gearman\Work as WorkAnnotation;
 use ReflectionClass;
@@ -226,18 +222,8 @@ class GearmanCacheWrapper
         AnnotationRegistry::registerFile(__DIR__ . "/../Driver/Gearman/Work.php");
         AnnotationRegistry::registerFile(__DIR__ . "/../Driver/Gearman/Job.php");
 
-        /**
-         * Depending on Symfony2 version
-         */
-        if (version_compare(DoctrineVersion::VERSION, '2.2.0-DEV', '>=')) {
-
-            $reader = new SimpleAnnotationReader();
-            $reader->addNamespace('Mmoreram\GearmanBundle\Driver');
-        } else {
-
-            $reader = new AnnotationReader();
-            $reader->setDefaultAnnotationNamespace('Mmoreram\GearmanBundle\Driver\\');
-        }
+        $reader = new SimpleAnnotationReader();
+        $reader->addNamespace('Mmoreram\GearmanBundle\Driver');
 
         $finder = new Finder();
         $finder

+ 1 - 1
composer.json

@@ -22,7 +22,7 @@
         "php": ">=5.3.3",
         "ext-gearman": "*",
         "symfony/framework-bundle": ">=2.1",
-        "doctrine/common": ">=2.1",
+        "doctrine/common": ">=2.2.0-dev",
         "symfony/console": ">=2.1",
         "symfony/config": ">=2.1",
         "symfony/http-kernel": ">=2.1",