Passed
Branch master (bf6495)
by Php Easy Api
05:10 queued 02:21
created
src/resta/Container/ContainerKernelAssigner.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -12,12 +12,12 @@  discard block
 block discarded – undo
12 12
      * @param $callback
13 13
      * @return void
14 14
      */
15
-    public function consoleShared($object,$callback)
15
+    public function consoleShared($object, $callback)
16 16
     {
17 17
         //The console share is evaluated as a true variable to be assigned as the 3rd parameter in the classes to be bound.
18 18
         //The work to be done here is to bind the classes to be included in the console share privately.
19
-        if($this->app->console()){
20
-            $this->app->register('consoleShared',$object,$this->getConcrete($callback));
19
+        if ($this->app->console()) {
20
+            $this->app->register('consoleShared', $object, $this->getConcrete($callback));
21 21
         }
22 22
     }
23 23
 
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
     public function container()
28 28
     {
29 29
         //We are initializing the array property for the service container object.
30
-        if(!isset($this->app['serviceContainer'])){
31
-            $this->app->register('serviceContainer',[]);
30
+        if (!isset($this->app['serviceContainer'])) {
31
+            $this->app->register('serviceContainer', []);
32 32
         }
33 33
     }
34 34
 
@@ -48,22 +48,22 @@  discard block
 block discarded – undo
48 48
      * @param $concrete
49 49
      * @return void
50 50
      */
51
-    private function setKernel($object,$concrete)
51
+    private function setKernel($object, $concrete)
52 52
     {
53 53
         //We check that the concrete object
54 54
         //is an object that can be retrieved.
55
-        if(!isset($this->app[$object]) && class_exists($concrete)){
55
+        if (!isset($this->app[$object]) && class_exists($concrete)) {
56 56
 
57 57
             //get concrete instance
58 58
             $concreteInstance = $this->app->resolve($concrete);
59 59
 
60 60
             //the value corresponding to the bind value for the global object is assigned and
61 61
             //the resolve method is called for the dependency injection.
62
-            $this->app->register($object,$concreteInstance);
62
+            $this->app->register($object, $concreteInstance);
63 63
 
64 64
             // this method is executed if the concrete instance contains the handle method.
65 65
             // if no handle method is included, the concrete instance is returned directly.
66
-            (method_exists($concreteInstance,'handle'))
66
+            (method_exists($concreteInstance, 'handle'))
67 67
                 ? $concreteInstance->handle()
68 68
                 : $concreteInstance;
69 69
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      * @param null $value
77 77
      * @return void
78 78
      */
79
-    public function setKernelObject($object,$concrete,$value=null)
79
+    public function setKernelObject($object, $concrete, $value = null)
80 80
     {
81 81
         //if a pre loader class wants to have before kernel values,
82 82
         //it must return a callback to the bind method
@@ -84,22 +84,22 @@  discard block
 block discarded – undo
84 84
 
85 85
         //the value is directly assigned to the kernel object.
86 86
         //The value is moved throughout the application in the kernel of the application object.
87
-        if($value===null){
88
-            $this->setKernel($object,$concrete);
87
+        if ($value===null) {
88
+            $this->setKernel($object, $concrete);
89 89
         }
90 90
 
91 91
         //The service container value is moved differently from the value directly assigned to the kernel object.
92 92
         //The application container is booted directly with the service container custom class
93 93
         //in the version section of the your application.
94
-        if($value==="serviceContainer"){
95
-            $this->setServiceContainer($object,$concrete);
94
+        if ($value==="serviceContainer") {
95
+            $this->setServiceContainer($object, $concrete);
96 96
         }
97 97
 
98 98
         // we will resolve the value of concrete according to whether it is an object.
99 99
         $detectorBindings = (is_object($concrete)) ? $concrete : Utils::resolverClass($concrete);
100 100
 
101 101
         //we register the bound object to the kernel bindings property.
102
-        $this->app->register('bindings',$object,$detectorBindings);
102
+        $this->app->register('bindings', $object, $detectorBindings);
103 103
 
104 104
     }
105 105
 
@@ -108,17 +108,17 @@  discard block
 block discarded – undo
108 108
      * @param $concrete
109 109
      * @return void
110 110
      */
111
-    private function setServiceContainer($object,$concrete)
111
+    private function setServiceContainer($object, $concrete)
112 112
     {
113 113
         //We check that the concrete object
114 114
         //is an object that can be retrieved.
115
-        if(isset($this->app['serviceContainer']) && !isset($this->app['serviceContainer'][$object])){
115
+        if (isset($this->app['serviceContainer']) && !isset($this->app['serviceContainer'][$object])) {
116 116
 
117 117
             //the value corresponding to the bind value for the global object is assigned and
118 118
             //the resolve method is called for the dependency method.
119
-            $this->app->register('serviceContainer',$object,$concrete);
119
+            $this->app->register('serviceContainer', $object, $concrete);
120 120
         }
121
-        else{
121
+        else {
122 122
 
123 123
             // the service container objects are saved only once.
124 124
             // Overflow exception is thrown on multiple records.
Please login to merge, or discard this patch.