Test Setup Failed
Push — master ( 4913ba...eddc54 )
by Php Easy Api
03:29
created
src/resta/Role/RoleManager.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
         $permission = $this->getPermission();
65 65
         $role = $this->getRole();
66 66
         
67
-        if(is_null($this->role)){
67
+        if (is_null($this->role)) {
68 68
             return $permission::permissionMake($this->routeName);
69 69
         }
70
-        else{
70
+        else {
71 71
             return $role::roleMake($this->role);
72 72
         }
73 73
     }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      * @param string $adapter
105 105
      * @return RoleManager
106 106
      */
107
-    public function setAdapter($adapter='Database')
107
+    public function setAdapter($adapter = 'Database')
108 108
     {
109 109
         $this->adapter = $adapter;
110 110
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,8 +66,7 @@
 block discarded – undo
66 66
         
67 67
         if(is_null($this->role)){
68 68
             return $permission::permissionMake($this->routeName);
69
-        }
70
-        else{
69
+        } else{
71 70
             return $role::roleMake($this->role);
72 71
         }
73 72
     }
Please login to merge, or discard this patch.
src/resta/Console/Source/Token/Token.php 1 patch
Spacing   +3 added lines, -3 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,7 +30,7 @@  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
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         $resolveClientApiToken = app()->resolve($clientApiToken);
42 42
 
43 43
         //
44
-        $key= lcfirst($this->argument['key']);
44
+        $key = lcfirst($this->argument['key']);
45 45
 
46 46
         echo $this->info($resolveClientApiToken->createToken($key));
47 47
     }
Please login to merge, or discard this patch.
src/resta/Console/Source/Project/Project.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     /**
15 15
      * @var $type
16 16
      */
17
-    public $type='project';
17
+    public $type = 'project';
18 18
 
19 19
     /**
20 20
      * @var array
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     /**
32 32
      * @var $commandRule
33 33
      */
34
-    public $commandRule=[];
34
+    public $commandRule = [];
35 35
 
36 36
     /**
37 37
      * @method create
@@ -46,17 +46,17 @@  discard block
 block discarded – undo
46 46
         $this->directory['projectDir']          = $this->projectPath();
47 47
         $this->argument['exceptionNamespace']   = app()->namespace()->exception();
48 48
         $this->argument['resourcePath']         = app()->path()->appResourche();
49
-        $this->argument['testNamespace']             = app()->namespace()->tests();
49
+        $this->argument['testNamespace'] = app()->namespace()->tests();
50 50
 
51
-        $recursiveDefaultDirectory = explode("\\",$this->argument['project']);
51
+        $recursiveDefaultDirectory = explode("\\", $this->argument['project']);
52 52
         $this->argument['applicationName'] = pos($recursiveDefaultDirectory);
53 53
         $recursiveDefaultDirectory[] = 'V1';
54 54
         $recursiveDefaultDirectoryList = [];
55 55
 
56
-        foreach (array_slice($recursiveDefaultDirectory,1) as $defaultDirectory){
56
+        foreach (array_slice($recursiveDefaultDirectory, 1) as $defaultDirectory) {
57 57
 
58
-            $recursiveDefaultDirectoryList[]=$defaultDirectory;
59
-            $this->directory[$defaultDirectory.'Path'] = $this->projectPath().''.implode("/",$recursiveDefaultDirectoryList);
58
+            $recursiveDefaultDirectoryList[] = $defaultDirectory;
59
+            $this->directory[$defaultDirectory.'Path'] = $this->projectPath().''.implode("/", $recursiveDefaultDirectoryList);
60 60
         }
61 61
 
62 62
         //$this->directory['optionalDir'] = $this->optional();
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         //$this->directory['sourceDir']               = $this->sourceDir();
83 83
         //$this->directory['sourceSupportDir']        = $this->sourceSupportDir();
84 84
         //$this->directory['sourceSupportTraitDir']   = $this->sourceSupportDir().'/Traits';
85
-        $this->directory['exceptionDir']            = app()->path()->exception();
85
+        $this->directory['exceptionDir'] = app()->path()->exception();
86 86
 
87 87
         //set project directory
88 88
         $this->file->makeDirectory($this);
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
         $this->touch['kernel/version']              = $this->kernel().'/Version.php';
96 96
         $this->touch['kernel/app']                  = $this->provider().'/AppServiceProvider.php';
97 97
         $this->touch['kernel/worker']               = $this->provider().'/WorkerServiceProvider.php';
98
-        $this->touch['kernel/cache']               = $this->provider().'/CacheServiceProvider.php';
98
+        $this->touch['kernel/cache'] = $this->provider().'/CacheServiceProvider.php';
99 99
         $this->touch['kernel/authenticate']         = $this->provider().'/AuthenticateServiceProvider.php';
100 100
         $this->touch['kernel/role']                 = $this->provider().'/RoleServiceProvider.php';
101 101
         $this->touch['kernel/track']                = $this->provider().'/TrackServiceProvider.php';
102
-        $this->touch['test/testcase']              = $this->test().'/TestCase.php';
102
+        $this->touch['test/testcase'] = $this->test().'/TestCase.php';
103 103
         $this->touch['kernel/consoleevent']         = $this->provider().'/ConsoleEventServiceProvider.php';
104 104
         $this->touch['middleware/authenticate']     = $this->middleware().'/Authenticate.php';
105 105
         $this->touch['middleware/ratelimit']        = $this->middleware().'/RateLimit.php';
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
         $this->touch['app/gitignore']               = $this->projectPath().'/.gitignore';
141 141
         $this->touch['app/composer']                = $this->projectPath().'/composer.json';
142 142
         $this->touch['test/index']                  = $this->storage().'/index.html';
143
-        $this->touch['exception/authenticate']      = $this->directory['exceptionDir'] .'/AuthenticateException.php';
143
+        $this->touch['exception/authenticate']      = $this->directory['exceptionDir'].'/AuthenticateException.php';
144 144
 
145 145
         //set project touch
146 146
         $this->file->touch($this);
Please login to merge, or discard this patch.
src/resta/Console/Source/Track/Track.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@
 block discarded – undo
32 32
         if(app()->has('track.path')){
33 33
             $trackPath = app()->get('track.path');
34 34
             $logger = $trackPath($this->argument);
35
-        }
36
-        else{
35
+        } else{
37 36
             $logger = app()->path()->appLog().''.DIRECTORY_SEPARATOR.''.date('Y').''.DIRECTORY_SEPARATOR.''.date('m').''.DIRECTORY_SEPARATOR.''.date('d').'-access.log';
38 37
         }
39 38
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,15 +29,15 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public function log()
31 31
     {
32
-        if(app()->has('track.path')){
32
+        if (app()->has('track.path')) {
33 33
             $trackPath = app()->get('track.path');
34 34
             $logger = $trackPath($this->argument);
35 35
         }
36
-        else{
36
+        else {
37 37
             $logger = app()->path()->appLog().''.DIRECTORY_SEPARATOR.''.date('Y').''.DIRECTORY_SEPARATOR.''.date('m').''.DIRECTORY_SEPARATOR.''.date('d').'-access.log';
38 38
         }
39 39
 
40
-        if(!file_exists($logger)){
40
+        if (!file_exists($logger)) {
41 41
             echo 'No requests for a log tracker have been detected yet.';
42 42
             echo PHP_EOL;
43 43
             exit();
@@ -53,15 +53,15 @@  discard block
 block discarded – undo
53 53
         while (!feof($proc))
54 54
         {
55 55
             $result = fread($proc, 4096);
56
-            if(preg_match('@\{(.*)\}@',$result,$output)){
57
-                $outputArray = json_decode($output[0],1);
56
+            if (preg_match('@\{(.*)\}@', $result, $output)) {
57
+                $outputArray = json_decode($output[0], 1);
58 58
 
59 59
                 $outputArray['trackNumber'] = ++$number;
60 60
 
61
-                if(app()->has('track.log')){
61
+                if (app()->has('track.log')) {
62 62
 
63 63
                     $track = app()->get('track.log');
64
-                    echo $track($outputArray,$this->argument);
64
+                    echo $track($outputArray, $this->argument);
65 65
                 }
66 66
             }
67 67
             @ flush();
Please login to merge, or discard this patch.
src/resta/Support/TrackLogger.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
      * @param $output
24 24
      * @param $arguments
25 25
      */
26
-    public function __construct(ApplicationContracts $app,$output,$arguments)
26
+    public function __construct(ApplicationContracts $app, $output, $arguments)
27 27
     {
28 28
         parent::__construct($app);
29 29
 
30
-        if(!$this->app->runningInConsole()){
30
+        if (!$this->app->runningInConsole()) {
31 31
             exception()->runtime('Console application is missing');
32 32
         }
33 33
 
@@ -42,31 +42,31 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function handle()
44 44
     {
45
-        if(isset($this->arguments['filter'])){
45
+        if (isset($this->arguments['filter'])) {
46 46
 
47 47
             $filterResult = [];
48 48
             $filter = lcfirst($this->arguments['filter']);
49 49
 
50
-            foreach (explode('+',$filter) as $item){
51
-                $itemList = explode('=',$item);
52
-                if(isset($this->output[$itemList[0]]) && $this->output[$itemList[0]]==$itemList[1]){
50
+            foreach (explode('+', $filter) as $item) {
51
+                $itemList = explode('=', $item);
52
+                if (isset($this->output[$itemList[0]]) && $this->output[$itemList[0]]==$itemList[1]) {
53 53
                     $filterResult[] = true;
54 54
                 }
55
-                else{
55
+                else {
56 56
                     $filterResult[] = false;
57 57
                 }
58 58
             }
59 59
         }
60 60
 
61
-        if(!isset($filterResult) || (isset($filterResult) && is_array($filterResult) && !in_array(false,$filterResult))){
61
+        if (!isset($filterResult) || (isset($filterResult) && is_array($filterResult) && !in_array(false, $filterResult))) {
62 62
 
63
-            if($this->output['meta']['success'])
63
+            if ($this->output['meta']['success'])
64 64
             {
65 65
                 echo ''.$this->output['trackNumber'].' - SUCCESS:';
66 66
                 echo PHP_EOL;
67 67
                 echo 'Request Success : true';
68 68
             }
69
-            else{
69
+            else {
70 70
 
71 71
                 echo ''.$this->output['trackNumber'].' - ERROR:';
72 72
                 echo PHP_EOL;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
             echo PHP_EOL;
86 86
             $requestClientIp = (isset($this->output['clientIp'])) ? $this->output['clientIp'] : null;
87
-            echo 'Client Ip: '.$requestClientIp ;
87
+            echo 'Client Ip: '.$requestClientIp;
88 88
 
89 89
             echo PHP_EOL;
90 90
             $requestEndpoint = (isset($this->output['requestUrl'])) ? $this->output['requestUrl'] : null;
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@  discard block
 block discarded – undo
51 51
                 $itemList = explode('=',$item);
52 52
                 if(isset($this->output[$itemList[0]]) && $this->output[$itemList[0]]==$itemList[1]){
53 53
                     $filterResult[] = true;
54
-                }
55
-                else{
54
+                } else{
56 55
                     $filterResult[] = false;
57 56
                 }
58 57
             }
@@ -65,8 +64,7 @@  discard block
 block discarded – undo
65 64
                 echo ''.$this->output['trackNumber'].' - SUCCESS:';
66 65
                 echo PHP_EOL;
67 66
                 echo 'Request Success : true';
68
-            }
69
-            else{
67
+            } else{
70 68
 
71 69
                 echo ''.$this->output['trackNumber'].' - ERROR:';
72 70
                 echo PHP_EOL;
Please login to merge, or discard this patch.
src/resta/Container/ContainerResolve.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -23,21 +23,21 @@  discard block
 block discarded – undo
23 23
      *
24 24
      * @throws \ReflectionException
25 25
      */
26
-    public function call($class,$param,callable $callback)
26
+    public function call($class, $param, callable $callback)
27 27
     {
28 28
         // We use the reflection class to solve
29 29
         // the parameters of the class's methods.
30
-        $param = $this->reflectionMethodParameters($class,$param);
30
+        $param = $this->reflectionMethodParameters($class, $param);
31 31
 
32 32
         // the results of a number of processes will be given
33 33
         // before the container pipeline method is given.
34 34
         return $this->app->resolve(ContainerPipelineResolve::class)->handle(
35
-            function() use($class,$param,$callback)
35
+            function() use($class, $param, $callback)
36 36
             {
37 37
                 // as a result
38 38
                 // we return the resolved class to the callback class
39
-                $params = (object)['class'=>$class,'param'=>$param];
40
-                return call_user_func_array($callback,[$params]);
39
+                $params = (object)['class'=>$class, 'param'=>$param];
40
+                return call_user_func_array($callback, [$params]);
41 41
             });
42 42
 
43 43
     }
@@ -49,16 +49,16 @@  discard block
 block discarded – undo
49 49
      * @param $parameter
50 50
      * @return array
51 51
      */
52
-    private function checkParameterForContainer($containers,$parameter)
52
+    private function checkParameterForContainer($containers, $parameter)
53 53
     {
54 54
         $containerParameterNameValue = false;
55 55
 
56
-        if(isset($containers[$parameter->getType()->getName()])){
56
+        if (isset($containers[$parameter->getType()->getName()])) {
57 57
             $parameterNameResolve = $parameter->getType()->getName();
58 58
             $containerParameterNameValue = true;
59 59
         }
60 60
 
61
-        if(!$containerParameterNameValue && isset($containers[$parameter->getName()])){
61
+        if (!$containerParameterNameValue && isset($containers[$parameter->getName()])) {
62 62
             $parameterNameResolve = $parameter->getName();
63 63
             $containerParameterNameValue = true;
64 64
         }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         // if the parameter is an object and
67 67
         // this object is a service container object
68 68
         // then the parameter will bind.
69
-        if($parameter->getType()!==null && $containerParameterNameValue){
69
+        if ($parameter->getType()!==null && $containerParameterNameValue) {
70 70
 
71 71
             // Unpack the container object and
72 72
             // bind it to the param variable.
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             return [$parameterName=>$parameterResolve];
86 86
         }
87 87
 
88
-        if($parameter->getType()!== NULL && Utils::isNamespaceExists($parameterNameResolve)){
88
+        if ($parameter->getType()!==NULL && Utils::isNamespaceExists($parameterNameResolve)) {
89 89
 
90 90
             // Unpack the container object and
91 91
             // bind it to the param variable.
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
      */
109 109
     private function getReflectionMethod($class)
110 110
     {
111
-        if(!isset($class[0],$class[1])){
111
+        if (!isset($class[0], $class[1])) {
112 112
             exception('containerResolvingMissing')
113 113
                 ->runtime('Container class resolving is missing');
114 114
         }
115 115
 
116
-        [$class,$method] = [$class[0],$class[1]];
116
+        [$class, $method] = [$class[0], $class[1]];
117 117
 
118 118
         return $this->instanceReflection($this->app['reflection']($class))
119 119
             ->reflectionMethodParams($method);
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
      * @param $instance
126 126
      * @return object|null
127 127
      */
128
-    public function instanceReflection($instance=null)
128
+    public function instanceReflection($instance = null)
129 129
     {
130
-        if(is_object($instance) && is_null(static::$reflectionInstance)){
130
+        if (is_object($instance) && is_null(static::$reflectionInstance)) {
131 131
             static::$reflectionInstance = $instance;
132 132
         }
133 133
 
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
      *
144 144
      * @throws \ReflectionException
145 145
      */
146
-    private function reflectionMethodParameters($class,$param)
146
+    private function reflectionMethodParameters($class, $param)
147 147
     {
148 148
         $containers = [];
149 149
 
150 150
         //get service container objects.
151
-        if(isset($this->app['serviceContainer'])){
151
+        if (isset($this->app['serviceContainer'])) {
152 152
             $containers = $this->app['serviceContainer'];
153 153
         }
154 154
 
@@ -161,23 +161,23 @@  discard block
 block discarded – undo
161 161
         // we provide the user with the container method document and take action.
162 162
         // thus, we help the methods to have a cleaner code structure.
163 163
         $this->app->resolve(ContainerMethodDocumentResolver::class,
164
-            ['reflection'=>$this->instanceReflection(),'class'=>$class]);
164
+            ['reflection'=>$this->instanceReflection(), 'class'=>$class]);
165 165
 
166 166
         // we group the parameters into type and
167 167
         // name and bind them with the necessary logic.
168
-        foreach ($parameters as $parameter){
168
+        foreach ($parameters as $parameter) {
169 169
 
170 170
             // if the parameter is an object and
171 171
             // this object is a service container object
172 172
             // then the parameter will bind.
173
-            $checkParameterForContainer = $this->checkParameterForContainer($containers,$parameter);
173
+            $checkParameterForContainer = $this->checkParameterForContainer($containers, $parameter);
174 174
 
175
-            $paramMerge = array_merge($param,$checkParameterForContainer);
175
+            $paramMerge = array_merge($param, $checkParameterForContainer);
176 176
 
177 177
             // we do some useful logic bind for user benefit.
178
-            $param = app()->resolve(GraceContainer::class,[
178
+            $param = app()->resolve(GraceContainer::class, [
179 179
                 'reflection' => $reflection->reflection
180
-            ])->graceContainerBuilder($parameter,$paramMerge);
180
+            ])->graceContainerBuilder($parameter, $paramMerge);
181 181
 
182 182
         }
183 183
 
Please login to merge, or discard this patch.
src/resta/Client/Client.php 2 patches
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      *
52 52
      * @throws ReflectionExceptionAlias
53 53
      */
54
-    public function __construct($clientData=null)
54
+    public function __construct($clientData = null)
55 55
     {
56 56
         //reflection process
57 57
         $this->reflection = app()['reflection']($this);
@@ -74,25 +74,25 @@  discard block
 block discarded – undo
74 74
     private function autoValidate($validate)
75 75
     {
76 76
         //we get the values ​​to auto-validate.
77
-        foreach ($this->{$validate} as $object=>$datas){
77
+        foreach ($this->{$validate} as $object=>$datas) {
78 78
 
79 79
             // the auto-validate value must necessarily represent a class.
80 80
             // otherwise auto-validate is not used.
81
-            if(Utils::isNamespaceExists($object)){
81
+            if (Utils::isNamespaceExists($object)) {
82 82
                 $getObjectInstance = app()->resolve($object);
83 83
 
84 84
                 // we get the index values,
85 85
                 // which are called methods of the auto-validate value that represents the class.
86
-                foreach ($datas as $dataKey=>$data){
86
+                foreach ($datas as $dataKey=>$data) {
87 87
 
88 88
                     // if the methods of the auto-validate class resolved by the container resolve method apply,
89 89
                     // the process of auto-validate automatic implementation will be completed.
90
-                    if(is_numeric($dataKey) && method_exists($getObjectInstance,$data)){
91
-                        if(isset($this->origin[$data])){
92
-                            if(!is_array($this->origin[$data])){
90
+                    if (is_numeric($dataKey) && method_exists($getObjectInstance, $data)) {
91
+                        if (isset($this->origin[$data])) {
92
+                            if (!is_array($this->origin[$data])) {
93 93
                                 $this->origin[$data] = array($this->origin[$data]);
94 94
                             }
95
-                            foreach ($this->origin[$data] as $originData){
95
+                            foreach ($this->origin[$data] as $originData) {
96 96
                                 $getObjectInstance->{$data}($originData);
97 97
                             }
98 98
                         }
@@ -111,15 +111,15 @@  discard block
 block discarded – undo
111 111
     {
112 112
         // expected method is executed.
113 113
         // this method is a must for http method values to be found in this property.
114
-        if($this->checkProperties('capsule')){
114
+        if ($this->checkProperties('capsule')) {
115 115
 
116 116
             $caret = $this->capsuleCaret();
117 117
 
118
-            foreach($this->inputs as $input=>$value){
118
+            foreach ($this->inputs as $input=>$value) {
119 119
 
120
-                if(isset($caret[$input]) || (
121
-                        $this->checkProperties('capsule') && !in_array($input,$this->capsule)
122
-                    )){
120
+                if (isset($caret[$input]) || (
121
+                        $this->checkProperties('capsule') && !in_array($input, $this->capsule)
122
+                    )) {
123 123
                     exception('capsuleRequestException')
124 124
                         ->overflow('The '.$input.' value cannot be sent.');
125 125
                 }
@@ -136,15 +136,15 @@  discard block
 block discarded – undo
136 136
     {
137 137
         $caret = [];
138 138
 
139
-        foreach($this->inputs as $input=>$item){
140
-            if(in_array('@'.$input,$this->capsule)){
139
+        foreach ($this->inputs as $input=>$item) {
140
+            if (in_array('@'.$input, $this->capsule)) {
141 141
                 $caret[$input] = $item;
142 142
             }
143 143
         }
144 144
 
145 145
         foreach ($this->capsule as $item) {
146
-            if(preg_match('#@.*#is',$item)){
147
-                $this->capsule = array_diff($this->capsule,[$item]);
146
+            if (preg_match('#@.*#is', $item)) {
147
+                $this->capsule = array_diff($this->capsule, [$item]);
148 148
             }
149 149
         }
150 150
 
@@ -163,15 +163,15 @@  discard block
 block discarded – undo
163 163
 
164 164
         // Determines which HTTP method
165 165
         // the request object will be exposed to.
166
-        if($this->checkProperties('http')){
166
+        if ($this->checkProperties('http')) {
167 167
 
168 168
             // if the current http method does not exist
169 169
             // in the http object, the exception will be thrown.
170
-            if(!in_array($method,$this->http)){
170
+            if (!in_array($method, $this->http)) {
171 171
 
172 172
                 //exception batMethodCall
173 173
                 exception()->badMethodCall(
174
-                    'Invalid http method process for '.class_basename($this).'.That is accepted http methods ['.implode(",",$this->http).'] ');
174
+                    'Invalid http method process for '.class_basename($this).'.That is accepted http methods ['.implode(",", $this->http).'] ');
175 175
             }
176 176
         }
177 177
     }
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     {
187 187
         // from the properties of the object properties to
188 188
         // the existing variables, control the array and at least one element.
189
-        return (property_exists($this,$properties)
189
+        return (property_exists($this, $properties)
190 190
             && is_array($this->{$properties}) && count($this->{$properties})) ? true : false;
191 191
     }
192 192
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
     {
200 200
         // we are saving the expected values ​​for the request in container.
201 201
         // this record can be returned in exception information.
202
-        app()->register('requestExpected',$this->expected);
202
+        app()->register('requestExpected', $this->expected);
203 203
     }
204 204
 
205 205
     /**
@@ -211,15 +211,15 @@  discard block
 block discarded – undo
211 211
     public function except($except)
212 212
     {
213 213
         // the except parameter is a callable value.
214
-        if(is_callable($except)){
215
-            $call = call_user_func_array($except,[$this]);
214
+        if (is_callable($except)) {
215
+            $call = call_user_func_array($except, [$this]);
216 216
             $except = $call;
217 217
         }
218 218
 
219 219
         // except with the except exceptions property
220 220
         // and then assigning them to the inputs property.
221
-        $this->except = array_merge($this->except,$except);
222
-        $this->inputs = array_diff_key($this->inputs,array_flip($this->except));
221
+        $this->except = array_merge($this->except, $except);
222
+        $this->inputs = array_diff_key($this->inputs, array_flip($this->except));
223 223
 
224 224
         return $this;
225 225
     }
@@ -233,27 +233,27 @@  discard block
 block discarded – undo
233 233
     {
234 234
         // expected method is executed.
235 235
         // this method is a must for http method values to be found in this property.
236
-        if($this->checkProperties('expected')){
236
+        if ($this->checkProperties('expected')) {
237 237
 
238 238
             // if the expected values are not found in the inputs array,
239 239
             // the exception will be thrown.
240
-            foreach ($this->expected as $expected){
240
+            foreach ($this->expected as $expected) {
241 241
 
242 242
                 $expectedValues = [];
243 243
 
244 244
                 // mandatory expected data for each key can be separated by | operator.
245 245
                 // this is evaluated as "or".
246
-                foreach($expectedData = explode("|",$expected) as $inputs){
247
-                    if(!isset($this->inputs[$inputs])){
246
+                foreach ($expectedData = explode("|", $expected) as $inputs) {
247
+                    if (!isset($this->inputs[$inputs])) {
248 248
                         $expectedValues[] = $inputs;
249 249
                     }
250 250
                 }
251 251
 
252 252
                 // if the expectedData and expectedValues ​​
253 253
                 // array are numerically equal to the expected key, the exception is thrown.
254
-                if(count($expectedData)===count($expectedValues)){
254
+                if (count($expectedData)===count($expectedValues)) {
255 255
                     exception($expected)
256
-                        ->unexpectedValue('You absolutely have to send the value '.implode(" or ",$expectedValues).' for request object');
256
+                        ->unexpectedValue('You absolutely have to send the value '.implode(" or ", $expectedValues).' for request object');
257 257
                 }
258 258
             }
259 259
         }
@@ -268,17 +268,17 @@  discard block
 block discarded – undo
268 268
     {
269 269
         // check the presence of the generator object
270 270
         // and operate the generator over this object.
271
-        if($this->checkProperties('auto_generators')){
271
+        if ($this->checkProperties('auto_generators')) {
272 272
             $generators = $this->getAutoGenerators();
273 273
         }
274 274
 
275 275
         // check the presence of the generator object
276 276
         // and operate the generator over this object.
277
-        if($this->checkProperties('generators')){
278
-            $generators = array_merge(isset($generators) ? $generators: [],$this->getGenerators());
277
+        if ($this->checkProperties('generators')) {
278
+            $generators = array_merge(isset($generators) ? $generators : [], $this->getGenerators());
279 279
         }
280 280
 
281
-        if(isset($generators)){
281
+        if (isset($generators)) {
282 282
             $this->generatorMethod($generators);
283 283
         }
284 284
     }
@@ -293,21 +293,21 @@  discard block
 block discarded – undo
293 293
     private function generatorMethod($generators)
294 294
     {
295 295
         //generator array object
296
-        foreach ($generators as $generator){
296
+        foreach ($generators as $generator) {
297 297
 
298 298
             //generator method name
299 299
             $generatorMethodName = $generator.'Generator';
300 300
 
301 301
             // if the generator method is present,
302 302
             // the fake value is assigned.
303
-            if(method_exists($this,$generatorMethodName)){
303
+            if (method_exists($this, $generatorMethodName)) {
304 304
 
305 305
                 //fake registration
306
-                if(!isset($this->inputs[$generator])){
306
+                if (!isset($this->inputs[$generator])) {
307 307
 
308 308
                     $generatorMethodNameResult = $this->{$generatorMethodName}();
309 309
 
310
-                    if(!is_null($generatorMethodNameResult)){
310
+                    if (!is_null($generatorMethodNameResult)) {
311 311
                         $this->{$generator} = $this->{$generatorMethodName}();
312 312
                         $this->inputs[$generator] = $this->{$generatorMethodName}();
313 313
                         $this->requestData[$generator] = $this->inputs[$generator];
@@ -315,14 +315,14 @@  discard block
 block discarded – undo
315 315
                 }
316 316
                 else {
317 317
 
318
-                    if($this->checkProperties('auto_generators_dont_overwrite')
319
-                        && in_array($generator,$this->getAutoGeneratorsDontOverwrite())){
318
+                    if ($this->checkProperties('auto_generators_dont_overwrite')
319
+                        && in_array($generator, $this->getAutoGeneratorsDontOverwrite())) {
320 320
                         $this->{$generator} = $this->{$generatorMethodName}();
321 321
                         $this->inputs[$generator] = $this->{$generatorMethodName}();
322 322
                     }
323 323
 
324
-                    if($this->checkProperties('generators_dont_overwrite')
325
-                        && in_array($generator,$this->getGeneratorsDontOverwrite())){
324
+                    if ($this->checkProperties('generators_dont_overwrite')
325
+                        && in_array($generator, $this->getGeneratorsDontOverwrite())) {
326 326
                         $this->{$generator} = $this->{$generatorMethodName}();
327 327
                         $this->inputs[$generator] = $this->{$generatorMethodName}();
328 328
                     }
@@ -344,11 +344,11 @@  discard block
 block discarded – undo
344 344
         $list = [];
345 345
 
346 346
         foreach ($this->requestData as $key=>$item) {
347
-            if(property_exists($this,'requestExcept') && !in_array($key,$this->requestExcept)){
347
+            if (property_exists($this, 'requestExcept') && !in_array($key, $this->requestExcept)) {
348 348
                 $list[$key] = $item;
349 349
             }
350 350
 
351
-            if(!property_exists($this,'requestExcept')){
351
+            if (!property_exists($this, 'requestExcept')) {
352 352
                 $list[$key] = $item;
353 353
             }
354 354
         }
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
     {
392 392
         // we use the http method to write
393 393
         // the values to the inputs and origin properties.
394
-        foreach($this->clientData as $key=>$value){
394
+        foreach ($this->clientData as $key=>$value) {
395 395
 
396 396
             //inputs and origin properties
397 397
             $this->inputs[$key] = $value;
@@ -438,9 +438,9 @@  discard block
 block discarded – undo
438 438
 
439 439
         // we update the input values ​​after
440 440
         // we receive and check the saved objects.
441
-        foreach ($clientObjects as $key=>$value){
441
+        foreach ($clientObjects as $key=>$value) {
442 442
 
443
-            if(isset($clientObjects['origin'][$key])){
443
+            if (isset($clientObjects['origin'][$key])) {
444 444
 
445 445
                 $this->{$key} = $clientObjects['origin'][$key];
446 446
                 $this->inputs[$key] = $this->{$key};
@@ -467,11 +467,11 @@  discard block
 block discarded – undo
467 467
 
468 468
         // the request update to be performed using
469 469
         // the method name to be used with the http method.
470
-        $this->setRequestInputs($requestMethod,$key);
470
+        $this->setRequestInputs($requestMethod, $key);
471 471
 
472 472
         // the request update to be performed using
473 473
         // the method name to be used without the http method.
474
-        $this->setRequestInputs($key,$key);
474
+        $this->setRequestInputs($key, $key);
475 475
     }
476 476
 
477 477
     /**
@@ -482,20 +482,20 @@  discard block
 block discarded – undo
482 482
      *
483 483
      * @throws ReflectionExceptionAlias
484 484
      */
485
-    private function setRequestInputs($method,$key)
485
+    private function setRequestInputs($method, $key)
486 486
     {
487
-        if(method_exists($this,$method) && $this->reflection->reflectionMethodParams($method)->isProtected){
487
+        if (method_exists($this, $method) && $this->reflection->reflectionMethodParams($method)->isProtected) {
488 488
 
489 489
             //check annotations for method
490
-            $annotation = app()->resolve(ClientAnnotationManager::class,['request'=>$this]);
491
-            $annotation->annotation($method,$key);
490
+            $annotation = app()->resolve(ClientAnnotationManager::class, ['request'=>$this]);
491
+            $annotation->annotation($method, $key);
492 492
 
493
-            if(isset($this->inputs[$key]) && is_array($this->inputs[$key])){
493
+            if (isset($this->inputs[$key]) && is_array($this->inputs[$key])) {
494 494
 
495 495
                 $inputKeys = $this->inputs[$key];
496 496
 
497 497
                 $this->inputs[$key] = [];
498
-                foreach ($inputKeys as $input){
498
+                foreach ($inputKeys as $input) {
499 499
 
500 500
                     $this->{$key}               = $input;
501 501
                     $keyMethod                  = $this->{$method}();
@@ -503,8 +503,8 @@  discard block
 block discarded – undo
503 503
                     $this->requestData[$key][]  = $keyMethod;
504 504
                 }
505 505
             }
506
-            else{
507
-                if(isset($this->inputs[$key])){
506
+            else {
507
+                if (isset($this->inputs[$key])) {
508 508
                     $keyMethod = $this->{$method}();
509 509
                     $this->inputs[$key] = $keyMethod;
510 510
                     $this->requestData[$key] = $keyMethod;
@@ -523,8 +523,8 @@  discard block
 block discarded – undo
523 523
     {
524 524
         // the auto object validate property is the property
525 525
         // where all of your request values ​​are automatically validated.
526
-        if(property_exists($this,'autoObjectValidate')
527
-            && is_array($this->autoObjectValidate) && count($this->autoObjectValidate)){
526
+        if (property_exists($this, 'autoObjectValidate')
527
+            && is_array($this->autoObjectValidate) && count($this->autoObjectValidate)) {
528 528
             $this->autoValidate('autoObjectValidate');
529 529
         }
530 530
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -312,8 +312,7 @@  discard block
 block discarded – undo
312 312
                         $this->inputs[$generator] = $this->{$generatorMethodName}();
313 313
                         $this->requestData[$generator] = $this->inputs[$generator];
314 314
                     }
315
-                }
316
-                else {
315
+                } else {
317 316
 
318 317
                     if($this->checkProperties('auto_generators_dont_overwrite')
319 318
                         && in_array($generator,$this->getAutoGeneratorsDontOverwrite())){
@@ -502,8 +501,7 @@  discard block
 block discarded – undo
502 501
                     $this->inputs[$key][]       = $keyMethod;
503 502
                     $this->requestData[$key][]  = $keyMethod;
504 503
                 }
505
-            }
506
-            else{
504
+            } else{
507 505
                 if(isset($this->inputs[$key])){
508 506
                     $keyMethod = $this->{$method}();
509 507
                     $this->inputs[$key] = $keyMethod;
Please login to merge, or discard this patch.
src/resta/Console/Source/Schedule/Schedule.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
     /**
28 28
      * @return void
29 29
      */
30
-    public function create(){
30
+    public function create() {
31 31
 
32 32
         $schedulePath = app()->path()->schedule();
33 33
         
34
-        if(!file_exists($schedulePath)){
34
+        if (!file_exists($schedulePath)) {
35 35
             $this->directory['schedule'] = $schedulePath;
36 36
             $this->file->makeDirectory($this);
37 37
         }
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         $this->argument['scheduleClass'] = ucfirst($this->argument['schedule']).'';
41 41
         $this->argument['projectName'] = strtolower($this->projectName());
42 42
 
43
-        $this->touch['schedule/schedule']= $schedulePath.'/'.$this->argument['schedule'].'.php';
43
+        $this->touch['schedule/schedule'] = $schedulePath.'/'.$this->argument['schedule'].'.php';
44 44
 
45 45
 
46 46
         $this->file->touch($this);
Please login to merge, or discard this patch.
src/resta/Schedule/ScheduleInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,5 +8,5 @@
 block discarded – undo
8 8
      * @param callable $callback
9 9
      * @return mixed
10 10
      */
11
-    public function everyMinute($minute=1) : int ;
11
+    public function everyMinute($minute = 1) : int;
12 12
 }
13 13
\ No newline at end of file
Please login to merge, or discard this patch.