Test Setup Failed
Push — master ( ba2f64...373408 )
by Php Easy Api
04:25
created
src/resta/Request/RequestAbstract.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     protected function getAutoGenerators()
33 33
     {
34
-        if(property_exists($this,'auto_generators')){
34
+        if (property_exists($this, 'auto_generators')) {
35 35
             return $this->auto_generators;
36 36
         }
37 37
         return [];
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     protected function getAutoGeneratorsDontOverwrite()
47 47
     {
48
-        if(property_exists($this,'auto_generators_dont_overwrite')){
48
+        if (property_exists($this, 'auto_generators_dont_overwrite')) {
49 49
             return $this->auto_generators_dont_overwrite;
50 50
         }
51 51
         return [];
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      */
60 60
     protected function getClientObjects()
61 61
     {
62
-        return array_diff_key($this->getObjects(),['inputs'=>[]]);
62
+        return array_diff_key($this->getObjects(), ['inputs'=>[]]);
63 63
     }
64 64
 
65 65
     /**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     protected function getGenerators()
71 71
     {
72
-        if(property_exists($this,'generators')){
72
+        if (property_exists($this, 'generators')) {
73 73
             return $this->generators;
74 74
         }
75 75
         return [];
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     protected function getGeneratorsDontOverwrite()
85 85
     {
86
-        if(property_exists($this,'generators_dont_overwrite')){
86
+        if (property_exists($this, 'generators_dont_overwrite')) {
87 87
             return $this->generators_dont_overwrite;
88 88
         }
89 89
         return [];
Please login to merge, or discard this patch.
src/resta/Console/Source/Helper/Helper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     /**
33 33
      * @var array
34 34
      */
35
-    public $commandRule=['helper'];
35
+    public $commandRule = ['helper'];
36 36
 
37 37
     /**
38 38
      * @return mixed
@@ -40,12 +40,12 @@  discard block
 block discarded – undo
40 40
     public function create()
41 41
     {
42 42
 
43
-        if(!file_exists(app()->path()->helpers())){
44
-            $this->directory['helper']          = app()->path()->helpers();
43
+        if (!file_exists(app()->path()->helpers())) {
44
+            $this->directory['helper'] = app()->path()->helpers();
45 45
             $this->file->makeDirectory($this);
46 46
         }
47 47
 
48
-        $this->touch['helpers/general']= app()->path()->helpers().'/'.ucfirst($this->argument['helper']).'.php';
48
+        $this->touch['helpers/general'] = app()->path()->helpers().'/'.ucfirst($this->argument['helper']).'.php';
49 49
 
50 50
 
51 51
         $this->file->touch($this);
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.
src/resta/Container/RepositoryContainer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,23 +9,23 @@
 block discarded – undo
9 9
      * @param $param
10 10
      * @return mixed
11 11
      */
12
-    public function handle($parameter,$param)
12
+    public function handle($parameter, $param)
13 13
     {
14 14
         // We will use a custom bind for the repository classes
15 15
         // and bind the repository contract with the repository adapter class.
16 16
         $parameterName = $parameter->getType()->getName();
17 17
         $repository = app()->namespace()->repository();
18 18
 
19
-        $parameterNameWord  = str_replace('\\','',$parameterName);
20
-        $repositoryWord     = str_replace('\\','',$repository);
19
+        $parameterNameWord  = str_replace('\\', '', $parameterName);
20
+        $repositoryWord     = str_replace('\\', '', $repository);
21 21
 
22 22
 
23 23
         // if the submitted contract matches the repository class.
24
-        if(preg_match('@'.$repositoryWord.'@is',$parameterNameWord)){
24
+        if (preg_match('@'.$repositoryWord.'@is', $parameterNameWord)) {
25 25
 
26 26
             //we bind the contract as an adapter
27
-            $repositoryName = str_replace('Contract','',$parameter->getName());
28
-            $getRepositoryAdapter = app()->get('appClass')::repository($repositoryName,true);
27
+            $repositoryName = str_replace('Contract', '', $parameter->getName());
28
+            $getRepositoryAdapter = app()->get('appClass')::repository($repositoryName, true);
29 29
 
30 30
             $param[$parameter->getName()] = app()->resolve($getRepositoryAdapter)->adapter();
31 31
         }
Please login to merge, or discard this patch.
src/resta/Console/Source/Token/Token.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     /**
14 14
      * @var $type
15 15
      */
16
-    public $type='token';
16
+    public $type = 'token';
17 17
 
18 18
     /**
19 19
      * @var array
@@ -30,19 +30,19 @@  discard block
 block discarded – undo
30 30
     /**
31 31
      * @var $commandRule
32 32
      */
33
-    public $commandRule=['key'];
33
+    public $commandRule = ['key'];
34 34
 
35 35
     /**
36 36
      * @return void
37 37
      */
38
-    public function create(){
38
+    public function create() {
39 39
 
40 40
         //
41 41
         $clientApiToken = StaticPathModel::appMiddlewarePath($this->projectName()).'\\ClientApiToken';
42 42
         $resolveClientApiToken = app()->resolve($clientApiToken);
43 43
 
44 44
         //
45
-        $key=lcfirst($this->argument['key']);
45
+        $key = lcfirst($this->argument['key']);
46 46
 
47 47
         echo $this->info($resolveClientApiToken->createToken($key));
48 48
     }
Please login to merge, or discard this patch.
src/resta/Support/SimpleXmlManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     {
40 40
         $xml = $this->getXml();
41 41
 
42
-        return json_decode(json_encode((array) $xml), true);
42
+        return json_decode(json_encode((array)$xml), true);
43 43
     }
44 44
 
45 45
     /**
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      * @param array $data
49 49
      * @return string
50 50
      */
51
-    public function toXml($data=array())
51
+    public function toXml($data = array())
52 52
     {
53 53
         return ArrayToXml::convert($data);
54 54
     }
Please login to merge, or discard this patch.
src/resta/Support/PhpUnitManager.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      * PhpUnitManager constructor.
14 14
      * @param array $data
15 15
      */
16
-    public function __construct($data=array())
16
+    public function __construct($data = array())
17 17
     {
18 18
         $this->data = $data;
19 19
     }
@@ -26,21 +26,21 @@  discard block
 block discarded – undo
26 26
      * @param null|string $value
27 27
      * @return mixed
28 28
      */
29
-    public function add($attribute=null,$key=null,$value=null)
29
+    public function add($attribute = null, $key = null, $value = null)
30 30
     {
31 31
         $list = [];
32 32
 
33 33
         //all add method parameters must come full.
34
-        if(!is_null($attribute) && !is_null($key) && !is_null($value)){
34
+        if (!is_null($attribute) && !is_null($key) && !is_null($value)) {
35 35
 
36 36
             // we do 0 key control for the testsuite data.
37 37
             // this phpunit has a multiple test suite data if 0 key is present.
38
-            if(isset($this->data['testsuites']['testsuite'][0])){
39
-                foreach ($this->data['testsuites']['testsuite'] as $key=>$item){
38
+            if (isset($this->data['testsuites']['testsuite'][0])) {
39
+                foreach ($this->data['testsuites']['testsuite'] as $key=>$item) {
40 40
                     $list[$key] = $item;
41 41
                 }
42 42
             }
43
-            else{
43
+            else {
44 44
                 //only for a single test suite data
45 45
                 $list[] = $this->data['testsuites']['testsuite'];
46 46
             }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,8 +39,7 @@
 block discarded – undo
39 39
                 foreach ($this->data['testsuites']['testsuite'] as $key=>$item){
40 40
                     $list[$key] = $item;
41 41
                 }
42
-            }
43
-            else{
42
+            } else{
44 43
                 //only for a single test suite data
45 44
                 $list[] = $this->data['testsuites']['testsuite'];
46 45
             }
Please login to merge, or discard this patch.
src/resta/Support/FileProcess.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     /**
26 26
      * @var array
27 27
      */
28
-    protected $stubList=array();
28
+    protected $stubList = array();
29 29
 
30 30
     /**
31 31
      * FileProcess constructor.
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
      * @param $data
42 42
      * @return bool
43 43
      */
44
-    public function dumpFile($file,$data)
44
+    public function dumpFile($file, $data)
45 45
     {
46 46
         try {
47
-            $this->fs->dumpFile($file,$data);
47
+            $this->fs->dumpFile($file, $data);
48 48
             return true;
49 49
         } catch (IOExceptionInterface $exception) {
50 50
             return false;
@@ -56,21 +56,21 @@  discard block
 block discarded – undo
56 56
      * @param bool $status
57 57
      * @return mixed
58 58
      */
59
-    public function makeDirectory($data,$status=false)
59
+    public function makeDirectory($data, $status = false)
60 60
     {
61
-        if($data->type=="project" && file_exists($data->project)){
61
+        if ($data->type=="project" && file_exists($data->project)) {
62 62
             throw new \LogicException('This Project Is Already Available');
63 63
         }
64
-        if(false===$status){
64
+        if (false===$status) {
65 65
 
66
-            if($data->type!=="project" && !file_exists($data->project)){
66
+            if ($data->type!=="project" && !file_exists($data->project)) {
67 67
                 throw new \LogicException('Project No');
68 68
             }
69 69
         }
70
-        foreach ($data->directory as $directory){
70
+        foreach ($data->directory as $directory) {
71 71
             try {
72
-                $this->fs->mkdir($directory,'0777');
73
-                chmod($directory,0777);
72
+                $this->fs->mkdir($directory, '0777');
73
+                chmod($directory, 0777);
74 74
             } catch (IOExceptionInterface $e) {
75 75
                 return "An error occurred while creating your directory at ".$e->getPath();
76 76
             }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     public function setDirectory($directory)
85 85
     {
86 86
         try {
87
-            $this->fs->mkdir($directory,'07777');
87
+            $this->fs->mkdir($directory, '07777');
88 88
         } catch (IOExceptionInterface $e) {
89 89
             return "An error occurred while creating your directory at ".$e->getPath();
90 90
         }
@@ -102,25 +102,25 @@  discard block
 block discarded – undo
102 102
      * @param $data
103 103
      * @param array $complex
104 104
      */
105
-    public function touch($data,$complex=array())
105
+    public function touch($data, $complex = array())
106 106
     {
107
-        $this->data=$data;
107
+        $this->data = $data;
108 108
 
109
-        if(isset($complex['stub']) && isset($this->data->argument['stub'])){
109
+        if (isset($complex['stub']) && isset($this->data->argument['stub'])) {
110 110
 
111 111
             $this->stubManager($complex);
112 112
         }
113 113
 
114
-        $execArray=(count($this->stubList)) ? $this->stubList : $this->data->touch;
114
+        $execArray = (count($this->stubList)) ? $this->stubList : $this->data->touch;
115 115
 
116
-        foreach ($execArray as $execution=>$touch){
116
+        foreach ($execArray as $execution=>$touch) {
117 117
 
118
-            if(!file_exists($touch) && $touch!==null){
118
+            if (!file_exists($touch) && $touch!==null) {
119 119
                 touch($touch);
120 120
 
121
-                $executionPath=$this->stubPath.'/'.$execution.'.stub';
122
-                if(file_exists($executionPath)){
123
-                    $this->fopenprocess($executionPath,$touch,$data);
121
+                $executionPath = $this->stubPath.'/'.$execution.'.stub';
122
+                if (file_exists($executionPath)) {
123
+                    $this->fopenprocess($executionPath, $touch, $data);
124 124
                 }
125 125
             }
126 126
         }
@@ -129,37 +129,37 @@  discard block
 block discarded – undo
129 129
     /**
130 130
      * @param array $complex
131 131
      */
132
-    private function stubManager($complex=array())
132
+    private function stubManager($complex = array())
133 133
     {
134
-        $stubStructure      = explode("_",$complex['stub']);
134
+        $stubStructure      = explode("_", $complex['stub']);
135 135
         $stubStructure[]    = $this->data->argument['stub'];
136 136
 
137
-        $stubberDirectoryList=path()->stubs();
137
+        $stubberDirectoryList = path()->stubs();
138 138
 
139
-        foreach ($stubStructure as $stubberDirectory){
139
+        foreach ($stubStructure as $stubberDirectory) {
140 140
 
141
-            $stubberDirectoryList=$stubberDirectoryList.'/'.$stubberDirectory;
141
+            $stubberDirectoryList = $stubberDirectoryList.'/'.$stubberDirectory;
142 142
 
143 143
             $this->setDirectory($stubberDirectoryList);
144 144
         }
145 145
 
146
-        foreach ($this->data->touch as $execution=>$executionFile){
146
+        foreach ($this->data->touch as $execution=>$executionFile) {
147 147
 
148
-            $executionArray=explode("/",$execution);
148
+            $executionArray = explode("/", $execution);
149 149
 
150 150
             $executionStub                      = end($executionArray).'';
151 151
             $this->stubList[$executionStub]     = $executionFile;
152 152
             $stubberFile                        = $stubberDirectoryList.'/'.$executionStub.'.stub';
153 153
 
154
-            $originalPath=$this->stubPath.'/'.$execution.'.stub';
154
+            $originalPath = $this->stubPath.'/'.$execution.'.stub';
155 155
 
156
-            if(!file_exists($stubberFile)){
156
+            if (!file_exists($stubberFile)) {
157 157
 
158
-                $this->fs->copy($originalPath,$stubberFile);
158
+                $this->fs->copy($originalPath, $stubberFile);
159 159
             }
160 160
         }
161 161
 
162
-        $this->stubPath=$stubberDirectoryList;
162
+        $this->stubPath = $stubberDirectoryList;
163 163
     }
164 164
 
165 165
 
@@ -169,15 +169,15 @@  discard block
 block discarded – undo
169 169
      * @param $param
170 170
      * @return bool
171 171
      */
172
-    public function fopenprocess($executionPath,$path,$param)
172
+    public function fopenprocess($executionPath, $path, $param)
173 173
     {
174 174
         $dt = fopen($executionPath, "r");
175 175
         $content = fread($dt, filesize($executionPath));
176 176
         fclose($dt);
177 177
 
178
-        foreach ($param->argument as $key=>$value){
178
+        foreach ($param->argument as $key=>$value) {
179 179
 
180
-            $content=str_replace("__".$key."__",$value,$content);
180
+            $content = str_replace("__".$key."__", $value, $content);
181 181
         }
182 182
 
183 183
         $dt = fopen($path, "w");
@@ -193,14 +193,14 @@  discard block
 block discarded – undo
193 193
      * @param $param
194 194
      * @return bool
195 195
      */
196
-    public function stubCopy($executionPath,$path,$param)
196
+    public function stubCopy($executionPath, $path, $param)
197 197
     {
198 198
         $dt = fopen($executionPath, "r");
199 199
         $content = fread($dt, filesize($executionPath));
200 200
         fclose($dt);
201 201
 
202
-        foreach ($param->argument as $key=>$value){
203
-            $content=str_replace("__".$key."__",$value,$content);
202
+        foreach ($param->argument as $key=>$value) {
203
+            $content = str_replace("__".$key."__", $value, $content);
204 204
         }
205 205
 
206 206
         $dt = fopen($path, "w");
@@ -214,9 +214,9 @@  discard block
 block discarded – undo
214 214
      * @param null $file
215 215
      * @return mixed|null
216 216
      */
217
-    public function callFile($file=null)
217
+    public function callFile($file = null)
218 218
     {
219
-        if(file_exists($file)){
219
+        if (file_exists($file)) {
220 220
             return require_once($file);
221 221
         }
222 222
         return null;
@@ -228,9 +228,9 @@  discard block
 block discarded – undo
228 228
      * @param null|string $file
229 229
      * @param null|string $data
230 230
      */
231
-    public function writeFile($file=null,$data=null)
231
+    public function writeFile($file = null, $data = null)
232 232
     {
233
-        if(!is_null($file) && !is_null($data)){
233
+        if (!is_null($file) && !is_null($data)) {
234 234
 
235 235
             $dt = fopen($file, "r");
236 236
             $content = fread($dt, filesize($file));
Please login to merge, or discard this patch.