Passed
Push — master ( 24a0a3...f5f23d )
by Php Easy Api
02:49
created
src/resta/Console/Source/Test/Test.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     public function create()
36 36
     {
37 37
 
38
-        if(!file_exists(app()->path()->tests())){
38
+        if (!file_exists(app()->path()->tests())) {
39 39
             $this->directory['test'] = app()->path()->tests();
40 40
             $this->file->makeDirectory($this);
41 41
         }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         $this->argument['testNamespace'] = ucfirst($this->argument['test']).'Test';
45 45
         $this->argument['projectName'] = strtolower($this->projectName());
46 46
 
47
-        $this->touch['test/test']= app()->path()->tests().'/'.$this->argument['testNamespace'].'.php';
47
+        $this->touch['test/test'] = app()->path()->tests().'/'.$this->argument['testNamespace'].'.php';
48 48
 
49 49
 
50 50
         $this->file->touch($this);
@@ -63,12 +63,12 @@  discard block
 block discarded – undo
63 63
 
64 64
         $array = $xml->toArray();
65 65
 
66
-        $new = (new PhpUnitManager($array))->add(strtolower($this->projectName()),'directory',
67
-            str_replace(root.''.DIRECTORY_SEPARATOR,"",app()->path()->tests()));
66
+        $new = (new PhpUnitManager($array))->add(strtolower($this->projectName()), 'directory',
67
+            str_replace(root.''.DIRECTORY_SEPARATOR, "", app()->path()->tests()));
68 68
 
69 69
         $newDataXml = $xml->toXml($new);
70 70
 
71
-        app()->get('fileSystem')->writeFile($phpunit,$newDataXml);
71
+        app()->get('fileSystem')->writeFile($phpunit, $newDataXml);
72 72
 
73 73
         echo $this->classical(' > phpunit.xml file has been updated');
74 74
     }
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     public function run()
80 80
     {
81
-        $process = new Process(['vendor'.DIRECTORY_SEPARATOR.'bin'.DIRECTORY_SEPARATOR.'phpunit','--group',strtolower($this->projectName())]);
81
+        $process = new Process(['vendor'.DIRECTORY_SEPARATOR.'bin'.DIRECTORY_SEPARATOR.'phpunit', '--group', strtolower($this->projectName())]);
82 82
         $process->setTty(true);
83 83
 
84 84
         try {
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.
src/resta/Container/ContainerInstanceResolver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,20 +30,20 @@
 block discarded – undo
30 30
      * @param null|string $name
31 31
      * @return array
32 32
      */
33
-    public function container($name=null)
33
+    public function container($name = null)
34 34
     {
35 35
         //check container value for kernel
36
-        if(isset($this->kernel->kernel)){
36
+        if (isset($this->kernel->kernel)) {
37 37
 
38 38
             // if methoda is a null parameter,
39 39
             // then we send direct container values.
40
-            if(is_null($name)){
40
+            if (is_null($name)) {
41 41
                 return (array)$this->kernel->kernel;
42 42
             }
43 43
 
44 44
             // if there is an existing value in the container as the method parameter,
45 45
             // we send this value directly in the container.
46
-            if(isset($this->container()[$name])){
46
+            if (isset($this->container()[$name])) {
47 47
                 return $this->container()[$name];
48 48
             }
49 49
         }
Please login to merge, or discard this patch.
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,callable $callback)
64
+    public function get($method, 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|string $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/Support/BootStaticManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@
 block discarded – undo
14 14
      *
15 15
      * @param null|string $path
16 16
      */
17
-    public static function setPath($path=null)
17
+    public static function setPath($path = null)
18 18
     {
19
-        if(!is_null($path)){
19
+        if (!is_null($path)) {
20 20
             self::$requestPath = $path;
21 21
         }
22 22
     }
Please login to merge, or discard this patch.