Passed
Branch master (9cba6d)
by Php Easy Api
07:03 queued 02:45
created
src/resta/Container/ContainerInstanceResolver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,20 +25,20 @@
 block discarded – undo
25 25
      * @param null|string $name
26 26
      * @return array
27 27
      */
28
-    public function container($name=null)
28
+    public function container($name = null)
29 29
     {
30 30
         //check container value for kernel
31
-        if(isset($this->instances['container'])){
31
+        if (isset($this->instances['container'])) {
32 32
 
33 33
             // if methoda is a null parameter,
34 34
             // then we send direct container values.
35
-            if(is_null($name)){
35
+            if (is_null($name)) {
36 36
                 return (array)$this->instances['container'];
37 37
             }
38 38
 
39 39
             // if there is an existing value in the container as the method parameter,
40 40
             // we send this value directly in the container.
41
-            if(isset($this->container()[$name])){
41
+            if (isset($this->container()[$name])) {
42 42
                 return $this->container()[$name];
43 43
             }
44 44
 
Please login to merge, or discard this patch.
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.
src/resta/Container/DIContainerManager.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,10 +22,10 @@  discard block
 block discarded – undo
22 22
      * @throws \DI\DependencyException
23 23
      * @throws \DI\NotFoundException
24 24
      */
25
-    public static function resolve($class=null)
25
+    public static function resolve($class = null)
26 26
     {
27 27
         //class resolve
28
-        if(!is_null($class)){
28
+        if (!is_null($class)) {
29 29
             $container = self::callBuild();
30 30
             return $container->get($class);
31 31
         }
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
      * @throws \DI\DependencyException
42 42
      * @throws \DI\NotFoundException
43 43
      */
44
-    public static function make($class=null, $param=array())
44
+    public static function make($class = null, $param = array())
45 45
     {
46
-        if($class!==null){
46
+        if ($class!==null) {
47 47
 
48 48
             $container = self::callBuild();
49
-            return $container->make($class,$param);
49
+            return $container->make($class, $param);
50 50
         }
51 51
 
52 52
         return null;
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
      *
59 59
      * @throws \DI\DependencyException
60 60
      */
61
-    public static function injectOnBind($class=null)
61
+    public static function injectOnBind($class = null)
62 62
     {
63
-        if($class!==null){
63
+        if ($class!==null) {
64 64
 
65 65
             $container = self::callBuild();
66 66
             return $container->injectOn($class);
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
      * @param array $param
75 75
      * @return mixed
76 76
      */
77
-    public static function callBind($class=null, $param=array())
77
+    public static function callBind($class = null, $param = array())
78 78
     {
79
-        return (app()->resolve(ContainerResolve::class))->call($class,$param,function($call){
80
-            return self::callBuild()->call($call->class,$call->param);
79
+        return (app()->resolve(ContainerResolve::class))->call($class, $param, function($call) {
80
+            return self::callBuild()->call($call->class, $call->param);
81 81
         });
82 82
     }
83 83
 }
84 84
\ No newline at end of file
Please login to merge, or discard this patch.