Passed
Push — master ( 332b04...c8fbce )
by Php Easy Api
02:57
created
src/resta/Container/ContainerMethodDocumentResolver.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      * @param $document
24 24
      * @param array $class
25 25
      */
26
-    public function __construct($app,$document,$class=array())
26
+    public function __construct($app, $document, $class = array())
27 27
     {
28 28
         parent::__construct($app);
29 29
 
@@ -46,25 +46,25 @@  discard block
 block discarded – undo
46 46
 
47 47
         // if you have information about cache in
48 48
         // the document section of the method, the cache process is executed.
49
-        if(is_string($this->document) && preg_match('#@cache\((.*?)\)\r\n#is',$this->document,$cache)){
49
+        if (is_string($this->document) && preg_match('#@cache\((.*?)\)\r\n#is', $this->document, $cache)) {
50 50
 
51 51
             // if the cache information
52 52
             // with regular expression does not contain null data.
53
-            if($cache!==null && isset($cache[1])){
53
+            if ($cache!==null && isset($cache[1])) {
54 54
 
55 55
                 //as static we inject the name value into the cache data.
56 56
                 $cacheData = ['cache'=>['name'=>Utils::encryptArrayData($this->class)]];
57 57
 
58 58
                 //cache data with the help of foreach data are transferred into the cache.
59
-                foreach(array_filter(explode(" ",$cache[1]),'strlen') as $item){
59
+                foreach (array_filter(explode(" ", $cache[1]), 'strlen') as $item) {
60 60
 
61
-                    $items = explode("=",$item);
61
+                    $items = explode("=", $item);
62 62
                     $cacheData['cache'][$items[0]] = $items[1];
63 63
                 }
64 64
             }
65 65
         }
66 66
 
67 67
         //we save the data stored in the cacheData variable as methodCache.
68
-        $this->app->register('containerReflection','methodCache',$cacheData);
68
+        $this->app->register('containerReflection', 'methodCache', $cacheData);
69 69
     }
70 70
 }
71 71
\ No newline at end of file
Please login to merge, or discard this patch.