Passed
Push — master ( 1db8b5...5d2efa )
by Php Easy Api
02:51
created
src/resta/Support/Macro.php 1 patch
Spacing   +16 added lines, -16 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,15 +61,15 @@  discard block
 block discarded – undo
61 61
      * @param callable $callback
62 62
      * @return mixed
63 63
      */
64
-    public function get($method=null,callable $callback)
64
+    public function get($method = null, callable $callback)
65 65
     {
66
-        if($this->isMacro){
66
+        if ($this->isMacro) {
67 67
 
68
-            if(is_null($method) && Utils::isNamespaceExists($this->macro)){
68
+            if (is_null($method) && Utils::isNamespaceExists($this->macro)) {
69 69
                 return $this->app->resolve($this->macro)($this->getValues());
70 70
             }
71 71
 
72
-            if(method_exists($resolve = $this->app->resolve($this->macro),$method)){
72
+            if (method_exists($resolve = $this->app->resolve($this->macro), $method)) {
73 73
                 return $resolve->macro($this->class);
74 74
             }
75 75
         }
@@ -93,11 +93,11 @@  discard block
 block discarded – undo
93 93
      * @param $class
94 94
      * @return $this
95 95
      */
96
-    public function isMacro($class,$static=false)
96
+    public function isMacro($class, $static = false)
97 97
     {
98 98
         // if the macro class is a valid object,
99 99
         // then this macro will return a boolean value if it has the specified methode.
100
-        if($this->checkMacroConditions($static)){
100
+        if ($this->checkMacroConditions($static)) {
101 101
 
102 102
             $this->isMacro  = true;
103 103
             $this->class    = $class;
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
      * @param $method
126 126
      * @return mixed
127 127
      */
128
-    public function with($macro,$concrete,$method=null)
128
+    public function with($macro, $concrete, $method = null)
129 129
     {
130
-        if($this->macro === null){
131
-            return $this($macro)->isMacro($concrete)->get($method,function() use($concrete){
130
+        if ($this->macro===null) {
131
+            return $this($macro)->isMacro($concrete)->get($method, function() use($concrete){
132 132
                 return $concrete;
133 133
             });
134 134
         }
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
      * @param $method
143 143
      * @return mixed
144 144
      */
145
-    public function withStatic($macro,$concrete)
145
+    public function withStatic($macro, $concrete)
146 146
     {
147
-        return $this($macro)->isMacro($concrete,true)->get(null,is_callable($concrete) ?
147
+        return $this($macro)->isMacro($concrete, true)->get(null, is_callable($concrete) ?
148 148
             $concrete : function() use($concrete){
149 149
                 return $concrete;
150 150
             });
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
      * @param null $macro
157 157
      * @return $this
158 158
      */
159
-    public function __invoke($macro=null)
159
+    public function __invoke($macro = null)
160 160
     {
161
-        if($macro!==null){
161
+        if ($macro!==null) {
162 162
             $this->macro = $macro;
163 163
         }
164 164
         return $this;
Please login to merge, or discard this patch.
src/resta/Config/Config.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
     public function get()
35 35
     {
36 36
         // The config process class should not be null.
37
-        if(self::$configProcessInstance!==null){
37
+        if (self::$configProcessInstance!==null) {
38 38
 
39 39
             //get config variables
40 40
             $config = self::$config;
41 41
 
42 42
             // offset config variables to config process class
43
-            self::$configProcessInstance->offsetSet('config',$config);
43
+            self::$configProcessInstance->offsetSet('config', $config);
44 44
 
45 45
             //get config variable from config process class
46 46
             return self::$configProcessInstance->get();
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * @param null|string $config
76 76
      * @return Config
77 77
      */
78
-    public static function macro($config=null)
78
+    public static function macro($config = null)
79 79
     {
80 80
         /** @var Macro $macro */
81 81
         $macro = app()->get('macro');
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      * @param null $config
89 89
      * @return Config
90 90
      */
91
-    public static function make($config=null)
91
+    public static function make($config = null)
92 92
     {
93 93
         self::$config = $config;
94 94
         self::$configProcessInstance = app()->resolve(ConfigProcess::class);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      * @param array $data
102 102
      * @return bool|mixed
103 103
      */
104
-    public function set($data=array())
104
+    public function set($data = array())
105 105
     {
106 106
         // receive the necessary config settings.
107 107
         $configPath     = path()->config();
@@ -109,12 +109,12 @@  discard block
 block discarded – undo
109 109
         $setConfigPath  = $configPath.''.DIRECTORY_SEPARATOR.''.ucfirst($configArray).'.php';
110 110
         $getConfigWrap  = Arr::wrap(config($configArray));
111 111
 
112
-        foreach ($data as $value){
112
+        foreach ($data as $value) {
113 113
 
114 114
             // we check the config value not to be rewritten.
115
-            if(!in_array($value,$getConfigWrap)){
116
-                $setData = '<?php return '.var_export(array_merge($getConfigWrap,$data), true).';';
117
-                return app()->resolve(FileProcess::class)->dumpFile($setConfigPath,$setData);
115
+            if (!in_array($value, $getConfigWrap)) {
116
+                $setData = '<?php return '.var_export(array_merge($getConfigWrap, $data), true).';';
117
+                return app()->resolve(FileProcess::class)->dumpFile($setConfigPath, $setData);
118 118
             }
119 119
         }
120 120
     }
Please login to merge, or discard this patch.