瀏覽代碼

Checked good working classes. Ready to be tested

Marc 13 年之前
父節點
當前提交
13ff85ff72
共有 3 個文件被更改,包括 13 次插入9 次删除
  1. 5 1
      MmoreramerinoGearmanBundle.php
  2. 2 2
      Module/JobClass.php
  3. 6 6
      codesniffer.log

+ 5 - 1
MmoreramerinoGearmanBundle.php

@@ -35,7 +35,11 @@ class MmoreramerinoGearmanBundle extends GearmanBaseBundle
         $gearmanCache = $this->container->get('gearman.cache');
         $existsCache = $gearmanCache->existsCacheFile();
 
-        if (in_array($this->container->get('kernel')->getEnvironment(), array('back_dev', 'back_test')) || !$existsCache) {
+        $environmentsCacheClear = array(
+            'back_dev', 'back_test', 'dev', 'test',
+        );
+
+        if (in_array($this->container->get('kernel')->getEnvironment(), $environmentsCacheClear) || !$existsCache) {
 
             if ($existsCache) {
                 $gearmanCache->emptyCache();

+ 2 - 2
Module/JobClass.php

@@ -49,7 +49,7 @@ class JobClass
         $this->methodName   =   $method->getName();
 
         $this->realCallableName = str_replace('\\', '', $callableNameClass.'~'.$this->callableName);
-        $this->description  =    (null !== $method->getDocComment()) ?
+        $this->description  =    (null !== $methodAnnotation->description) ?
                                     $methodAnnotation->description :
                                     'No description is defined';
 
@@ -64,7 +64,7 @@ class JobClass
                 $iter = (int) ($methodAnnotation->iterations);
             }
         } else {
-            throw new SettingValueMissingException('defaults/iter');
+            throw new SettingValueMissingException('defaults/iterations');
         }
         $this->iterations = $iter;
 

+ 6 - 6
codesniffer.log

@@ -2,11 +2,9 @@ Time: 0 seconds, Memory: 4.50Mb
 
 Time: 0 seconds, Memory: 4.00Mb
 
-Time: 0 seconds, Memory: 4.50Mb
-
-Time: 1 second, Memory: 5.25Mb
+Time: 1 second, Memory: 4.50Mb
 
-Time: 0 seconds, Memory: 6.00Mb
+Time: 0 seconds, Memory: 5.25Mb
 
 Time: 0 seconds, Memory: 4.75Mb
 
@@ -14,15 +12,17 @@ Time: 0 seconds, Memory: 5.00Mb
 
 Time: 0 seconds, Memory: 5.00Mb
 
+Time: 0 seconds, Memory: 6.00Mb
+
 Time: 0 seconds, Memory: 5.75Mb
 
 Time: 0 seconds, Memory: 5.75Mb
 
 Time: 0 seconds, Memory: 5.50Mb
 
-Time: 0 seconds, Memory: 4.75Mb
+Time: 1 second, Memory: 4.75Mb
 
-Time: 1 second, Memory: 4.50Mb
+Time: 0 seconds, Memory: 4.50Mb
 
 Time: 0 seconds, Memory: 5.25Mb