Passed
Push — master ( a07f95...136500 )
by Php Easy Api
02:52
created
src/resta/Support/Macro.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      * @param bool $static
34 34
      * @return bool
35 35
      */
36
-    protected function checkMacroConditions($static=false)
36
+    protected function checkMacroConditions($static = false)
37 37
     {
38 38
         return is_string($this->macro) &&
39 39
             Utils::isNamespaceExists($this->macro) &&
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
      * @param bool $static
47 47
      * @return bool
48 48
      */
49
-    protected function checkMacroInstanceOf($static=false)
49
+    protected function checkMacroInstanceOf($static = false)
50 50
     {
51
-        if($static){
51
+        if ($static) {
52 52
             return true;
53 53
         }
54 54
         return $this->app->resolve($this->macro) instanceof MacroAbleContracts;
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
      * @param callable $callback
62 62
      * @return mixed
63 63
      */
64
-    public function get($method,callable $callback)
64
+    public function get($method, callable $callback)
65 65
     {
66
-        if($this->isMacro){
66
+        if ($this->isMacro) {
67 67
 
68
-            if(method_exists($resolve = $this->app->resolve($this->macro),$method)){
68
+            if (method_exists($resolve = $this->app->resolve($this->macro), $method)) {
69 69
                 return $resolve->macro($this->class);
70 70
             }
71 71
         }
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
      * @param $class
90 90
      * @return $this
91 91
      */
92
-    public function isMacro($class,$static=false)
92
+    public function isMacro($class, $static = false)
93 93
     {
94 94
         // if the macro class is a valid object,
95 95
         // then this macro will return a boolean value if it has the specified methode.
96
-        if($this->checkMacroConditions($static)){
96
+        if ($this->checkMacroConditions($static)) {
97 97
 
98 98
             $this->isMacro  = true;
99 99
             $this->class    = $class;
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
      * @param $method
122 122
      * @return mixed
123 123
      */
124
-    public function with($macro,$concrete,$method=null)
124
+    public function with($macro, $concrete, $method = null)
125 125
     {
126
-        if($this->macro === null){
127
-            return $this($macro)->isMacro($concrete)->get($method,function() use($concrete){
126
+        if ($this->macro===null) {
127
+            return $this($macro)->isMacro($concrete)->get($method, function() use($concrete){
128 128
                 return $concrete;
129 129
             });
130 130
         }
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
      * @param $method
139 139
      * @return mixed
140 140
      */
141
-    public function withStatic($macro,$concrete)
141
+    public function withStatic($macro, $concrete)
142 142
     {
143
-        return $this($macro)->isMacro($concrete,true)->get(null,is_callable($concrete) ?
143
+        return $this($macro)->isMacro($concrete, true)->get(null, is_callable($concrete) ?
144 144
             $concrete : function() use($concrete){
145 145
                 return $concrete;
146 146
             });
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
      * @param null|string $macro
153 153
      * @return $this
154 154
      */
155
-    public function __invoke($macro=null)
155
+    public function __invoke($macro = null)
156 156
     {
157
-        if($macro!==null){
157
+        if ($macro!==null) {
158 158
             $this->macro = $macro;
159 159
         }
160 160
         return $this;
Please login to merge, or discard this patch.