Test Setup Failed
Push — master ( 6e6ad2...31aacb )
by Php Easy Api
03:54
created
src/resta/Console/Source/Repository/Repository.php 2 patches
Spacing   +19 added lines, -19 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='repository';
17
+    public $type = 'repository';
18 18
 
19 19
     /**
20 20
      * @var array
@@ -31,39 +31,39 @@  discard block
 block discarded – undo
31 31
     /**
32 32
      * @var $commandRule
33 33
      */
34
-    public $commandRule=['repository','?source'];
34
+    public $commandRule = ['repository', '?source'];
35 35
 
36 36
     /**
37 37
      * @method create
38 38
      * @return mixed
39 39
      */
40
-    public function create(){
40
+    public function create() {
41 41
 
42
-        $repository=$this->argument['repository'];
42
+        $repository = $this->argument['repository'];
43 43
 
44
-        $repositoryPath=$this->repository().'/'.$repository;
44
+        $repositoryPath = $this->repository().'/'.$repository;
45 45
 
46
-        $this->argument['repositoryNamespace']=Utils::getNamespace($repositoryPath);
46
+        $this->argument['repositoryNamespace'] = Utils::getNamespace($repositoryPath);
47 47
 
48
-        if($this->sourceCreate()) return true;
48
+        if ($this->sourceCreate()) return true;
49 49
 
50 50
         $this->directory['repositoryPath'] = $this->repository();
51
-        $this->directory['repositoryDir']=$repositoryPath;
51
+        $this->directory['repositoryDir'] = $repositoryPath;
52 52
 
53
-        $this->directory['repositorySourceDir']=$this->repository().'/'.$repository.'/Source';
54
-        $this->directory['repositorySourceMainDir']=$this->directory['repositorySourceDir'].'/Main';
53
+        $this->directory['repositorySourceDir'] = $this->repository().'/'.$repository.'/Source';
54
+        $this->directory['repositorySourceMainDir'] = $this->directory['repositorySourceDir'].'/Main';
55 55
 
56 56
         //set project directory
57 57
         $this->file->makeDirectory($this);
58 58
 
59
-        $this->touch['repository/adapter']      =$this->directory['repositoryDir'].'/'.$repository.'Adapter.php';
60
-        $this->touch['repository/contract']     =$this->directory['repositoryDir'].'/'.$repository.'Contract.php';
59
+        $this->touch['repository/adapter']      = $this->directory['repositoryDir'].'/'.$repository.'Adapter.php';
60
+        $this->touch['repository/contract']     = $this->directory['repositoryDir'].'/'.$repository.'Contract.php';
61 61
         //$this->touch['repository/trait']        =$this->directory['repositoryDir'].'/'.$repository.'Trait.php';
62 62
 
63
-        $this->touch['repository/sourcemain']       =$this->directory['repositorySourceMainDir'].'/'.$repository.'Main.php';
63
+        $this->touch['repository/sourcemain'] = $this->directory['repositorySourceMainDir'].'/'.$repository.'Main.php';
64 64
 
65 65
         //set project touch
66
-        $this->file->touch($this,[
66
+        $this->file->touch($this, [
67 67
             'stub'=>'Repository_Create'
68 68
         ]);
69 69
         
@@ -77,16 +77,16 @@  discard block
 block discarded – undo
77 77
     /**
78 78
      * @return bool
79 79
      */
80
-    private function sourceCreate(){
80
+    private function sourceCreate() {
81 81
 
82
-        if(isset($this->argument['source'])){
82
+        if (isset($this->argument['source'])) {
83 83
 
84
-            $this->directory['repositorySourceCustomDir']=$this->repository().'/'.$this->argument['repository'].'/Source/'.$this->argument['source'];
84
+            $this->directory['repositorySourceCustomDir'] = $this->repository().'/'.$this->argument['repository'].'/Source/'.$this->argument['source'];
85 85
 
86 86
             //set project directory
87 87
             $this->file->makeDirectory($this);
88 88
 
89
-            $this->touch['repository/sourcecustommain']=$this->directory['repositorySourceCustomDir'].'/'.$this->argument['repository'].''.$this->argument['source'].'.php';
89
+            $this->touch['repository/sourcecustommain'] = $this->directory['repositorySourceCustomDir'].'/'.$this->argument['repository'].''.$this->argument['source'].'.php';
90 90
 
91 91
             //set project touch
92 92
             $this->file->touch($this);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     /**
103 103
      * @return bool
104 104
      */
105
-    private function setAnnotations(){
105
+    private function setAnnotations() {
106 106
 
107 107
         return Utils::changeClass(path()->version().'/ServiceAnnotationsManager.php',
108 108
             ['Trait ServiceAnnotationsManager'=>'Trait ServiceAnnotationsManager'.PHP_EOL.' * @method \\'.app()->namespace()->repository().'\\'.$this->argument['repository'].'\\'.$this->argument['repository'].'Contract '.lcfirst($this->argument['repository']).'Repository'
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,9 @@
 block discarded – undo
45 45
 
46 46
         $this->argument['repositoryNamespace']=Utils::getNamespace($repositoryPath);
47 47
 
48
-        if($this->sourceCreate()) return true;
48
+        if($this->sourceCreate()) {
49
+            return true;
50
+        }
49 51
 
50 52
         $this->directory['repositoryPath'] = $this->repository();
51 53
         $this->directory['repositoryDir']=$repositoryPath;
Please login to merge, or discard this patch.
src/resta/Console/Source/Factory/Factory.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     /**
16 16
      * @var $type
17 17
      */
18
-    public $type='factory';
18
+    public $type = 'factory';
19 19
 
20 20
     /**
21 21
      * @var array
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     /**
33 33
      * @var $commandRule
34 34
      */
35
-    protected $commandRule=[[
35
+    protected $commandRule = [[
36 36
         'create'=>[]
37 37
     ]];
38 38
 
@@ -54,21 +54,21 @@  discard block
 block discarded – undo
54 54
 
55 55
         $this->file->makeDirectory($this);
56 56
 
57
-        if(!file_exists($this->factory().'/Factory.php')){
57
+        if (!file_exists($this->factory().'/Factory.php')) {
58 58
 
59 59
             $this->touch['factory/factory']             = $this->factory().'/Factory.php';
60 60
             $this->touch['factory/factorymanager']      = $this->factory().'/FactoryManager.php';
61 61
         }
62 62
 
63
-        if(file_exists( $this->directory['factoryArgumentDir'])){
63
+        if (file_exists($this->directory['factoryArgumentDir'])) {
64 64
 
65 65
             $factoryargumentmanager = $this->directory['factoryArgumentDir'].'/'.$factoryArgument.'Manager.php';
66 66
             $factoryargumentmanagerInterface = $this->directory['factoryArgumentDirInterfaces'].'/'.$factoryArgument.'Interface.php';
67 67
 
68
-            if(!file_exists($this->directory['factoryArgumentDir'].'/'.$factoryArgument.'Manager.php')){
68
+            if (!file_exists($this->directory['factoryArgumentDir'].'/'.$factoryArgument.'Manager.php')) {
69 69
 
70
-                $this->touch['factory/factoryargumentmanager'] =   $factoryargumentmanager;
71
-                $this->touch['factory/factoryargumentmanagerinterface']     = $factoryargumentmanagerInterface;
70
+                $this->touch['factory/factoryargumentmanager'] = $factoryargumentmanager;
71
+                $this->touch['factory/factoryargumentmanagerinterface'] = $factoryargumentmanagerInterface;
72 72
                 $this->touch['factory/index'] = $this->directory['factoryArgumentDirResources'].'/index.html';
73 73
 
74 74
                 $this->file->touch($this);
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
 {'=>'class Factory extends FactoryManager
79 79
 {
80 80
     /**
81
-     * @return '.$factoryArgument .'Interface
81
+     * @return '.$factoryArgument.'Interface
82 82
      */
83
-    public static function '.strtolower($factoryArgument ).'() : '.$factoryArgument.'Interface
83
+    public static function '.strtolower($factoryArgument).'() : '.$factoryArgument.'Interface
84 84
     {
85 85
         return static::singleton('.$factoryArgument.'Manager::class);
86 86
     }
@@ -96,15 +96,15 @@  discard block
 block discarded – undo
96 96
                     ]);
97 97
             }
98 98
 
99
-            if(isset($this->argument['resource'])){
99
+            if (isset($this->argument['resource'])) {
100 100
                 $resourceArgument = $this->argument['resource'];
101 101
 
102
-                if($resourceArgument!==null){
102
+                if ($resourceArgument!==null) {
103 103
                     $factoryArgumentResourceDir = $this->directory['factoryArgumentDir'].''.DIRECTORY_SEPARATOR.'Resources';
104
-                    $this->directory['factoryArgumentResourceArgumentDir']  =$factoryArgumentResourceDir.''.DIRECTORY_SEPARATOR.''.$resourceArgument;
104
+                    $this->directory['factoryArgumentResourceArgumentDir'] = $factoryArgumentResourceDir.''.DIRECTORY_SEPARATOR.''.$resourceArgument;
105 105
                     $this->file->makeDirectory($this);
106 106
 
107
-                    if(!file_exists($this->directory['factoryArgumentResourceArgumentDir'].''.DIRECTORY_SEPARATOR.''.$resourceArgument.'.php')){
107
+                    if (!file_exists($this->directory['factoryArgumentResourceArgumentDir'].''.DIRECTORY_SEPARATOR.''.$resourceArgument.'.php')) {
108 108
 
109 109
                         $this->touch['factory/factoryargumentresource']             = $this->directory['factoryArgumentResourceArgumentDir'].''.DIRECTORY_SEPARATOR.''.$resourceArgument.'.php';
110 110
                         $this->touch['factory/factoryargumentresourceinterface']    = $this->directory['factoryArgumentDirInterfaces'].'/'.$resourceArgument.'Interface.php';
Please login to merge, or discard this patch.
src/resta/Console/Source/Autoservice/Autoservice.php 1 patch
Spacing   +8 added lines, -8 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='auto-service';
17
+    public $type = 'auto-service';
18 18
 
19 19
     /**
20 20
      * @var array
@@ -26,24 +26,24 @@  discard block
 block discarded – undo
26 26
     /**
27 27
      * @var $commandRule
28 28
      */
29
-    protected $commandRule=[];
29
+    protected $commandRule = [];
30 30
 
31 31
     /**
32 32
      * @method create
33 33
      * @return mixed
34 34
      */
35
-    public function create(){
35
+    public function create() {
36 36
 
37
-        $autoDirectory=explode("\\",$this->argument['project']);
37
+        $autoDirectory = explode("\\", $this->argument['project']);
38 38
 
39
-        $this->argument['autoservice']=$autoDirectory[0];
39
+        $this->argument['autoservice'] = $autoDirectory[0];
40 40
 
41 41
         $this->argument['methodPrefix'] = StaticPathModel::$methodPrefix;
42
-        $this->directory['path']    = $this->autoService().'/'.$autoDirectory[0];
42
+        $this->directory['path'] = $this->autoService().'/'.$autoDirectory[0];
43 43
 
44
-        $this->file->makeDirectory($this,true);
44
+        $this->file->makeDirectory($this, true);
45 45
 
46
-        $this->touch['service/autoendpoint']        = $this->directory['path'].'/'.$autoDirectory[0].'Service.php';
46
+        $this->touch['service/autoendpoint'] = $this->directory['path'].'/'.$autoDirectory[0].'Service.php';
47 47
 
48 48
         $this->file->touch($this);
49 49
 
Please login to merge, or discard this patch.
src/resta/Console/Source/Route/Route.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -100,8 +100,7 @@
 block discarded – undo
100 100
                         true
101 101
                     ]);
102 102
                 }
103
-            }
104
-            else{
103
+            } else{
105 104
 
106 105
                 $this->table->addRow([
107 106
                     ++$counter,
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     /**
17 17
      * @var $type
18 18
      */
19
-    public $type='route';
19
+    public $type = 'route';
20 20
 
21 21
     /**
22 22
      * @var array
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     /**
34 34
      * @var $commandRule
35 35
      */
36
-    public $commandRule=[];
36
+    public $commandRule = [];
37 37
 
38 38
     /**
39 39
      * @return bool
@@ -42,24 +42,24 @@  discard block
 block discarded – undo
42 42
 
43 43
         echo $this->info('All Route Controller Lists :');
44 44
 
45
-        $this->table->setHeaders(['no','endpoint','http','method','definition','beforeMiddleware','afterMiddleware','routeCache','doc','status']);
45
+        $this->table->setHeaders(['no', 'endpoint', 'http', 'method', 'definition', 'beforeMiddleware', 'afterMiddleware', 'routeCache', 'doc', 'status']);
46 46
 
47 47
         $routes = Router::getRoutes();
48 48
         $routeData = isset($routes['data']) ? $routes['data'] : [];
49 49
         $routePattern = isset($routes['pattern']) ? $routes['pattern'] : [];
50 50
 
51
-        $counter=0;
51
+        $counter = 0;
52 52
 
53 53
         $application = app();
54 54
 
55 55
         $application->loadIfNotExistBoot(['middleware']);
56 56
         $middlewareProvider = $application['middleware'];
57 57
 
58
-        foreach($routeData as $key=>$data){
58
+        foreach ($routeData as $key=>$data) {
59 59
 
60
-            $middlewareProvider->setKeyOdds('endpoint',$data['endpoint']);
61
-            $middlewareProvider->setKeyOdds('method',$data['method']);
62
-            $middlewareProvider->setKeyOdds('http',$data['http']);
60
+            $middlewareProvider->setKeyOdds('endpoint', $data['endpoint']);
61
+            $middlewareProvider->setKeyOdds('method', $data['method']);
62
+            $middlewareProvider->setKeyOdds('http', $data['http']);
63 63
 
64 64
             $middlewareProvider->handleMiddlewareProcess();
65 65
             $beforeMiddleware = $middlewareProvider->getShow();
@@ -76,22 +76,22 @@  discard block
 block discarded – undo
76 76
             $reflection = app()['reflection']($controllerNamespace);
77 77
             $methodDocument = $reflection->reflectionMethodParams($data['method'])->document;
78 78
 
79
-            $isRouteCache = ($reflection->isAvailableMethodDocument($data['method'],'cache')) ?
79
+            $isRouteCache = ($reflection->isAvailableMethodDocument($data['method'], 'cache')) ?
80 80
                 'available' : '';
81 81
 
82 82
             $methodDefinition = '';
83 83
 
84
-            if(preg_match('@#define:(.*?)\n@is',$methodDocument,$definition)){
85
-                if(isset($definition[1])){
84
+            if (preg_match('@#define:(.*?)\n@is', $methodDocument, $definition)) {
85
+                if (isset($definition[1])) {
86 86
                     $methodDefinition = rtrim($definition[1]);
87 87
                 }
88 88
             }
89 89
 
90
-            $endpointData = $endpoint.'/'.implode("/",$routePattern[$key]);
90
+            $endpointData = $endpoint.'/'.implode("/", $routePattern[$key]);
91 91
 
92
-            if(isset($this->argument['filter'])){
92
+            if (isset($this->argument['filter'])) {
93 93
 
94
-                if(preg_match('@'.$this->argument['filter'].'@is',$endpointData)){
94
+                if (preg_match('@'.$this->argument['filter'].'@is', $endpointData)) {
95 95
 
96 96
                     $this->table->addRow([
97 97
                         ++$counter,
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
                         //$controllerNamespace,
101 101
                         $data['method'],
102 102
                         $methodDefinition,
103
-                        implode(",",$beforeMiddleware),
104
-                        implode(",",$afterMiddleware),
103
+                        implode(",", $beforeMiddleware),
104
+                        implode(",", $afterMiddleware),
105 105
                         $isRouteCache,
106 106
                         '',
107 107
                         '',
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
                     ]);
110 110
                 }
111 111
             }
112
-            else{
112
+            else {
113 113
 
114 114
                 $this->table->addRow([
115 115
                     ++$counter,
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
                     //$controllerNamespace,
119 119
                     $data['method'],
120 120
                     $methodDefinition,
121
-                    implode(",",$beforeMiddleware),
122
-                    implode(",",$afterMiddleware),
121
+                    implode(",", $beforeMiddleware),
122
+                    implode(",", $afterMiddleware),
123 123
                     $isRouteCache,
124 124
                     '',
125 125
                     true
Please login to merge, or discard this patch.
src/resta/Console/Source/Request/Request.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     /**
16 16
      * @var $type
17 17
      */
18
-    public $type='request';
18
+    public $type = 'request';
19 19
 
20 20
     /**
21 21
      * @var array
@@ -32,15 +32,15 @@  discard block
 block discarded – undo
32 32
     /**
33 33
      * @var $commandRule
34 34
      */
35
-    public $commandRule=['request'];
35
+    public $commandRule = ['request'];
36 36
 
37 37
     /**
38 38
      * @method create
39 39
      * @return mixed
40 40
      */
41
-    public function create(){
41
+    public function create() {
42 42
 
43
-        $request=$this->argument['request'];
43
+        $request = $this->argument['request'];
44 44
 
45 45
 
46 46
         $this->directory['requestCreate']   = path()->request();
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
         //set project directory
51 51
         $this->file->makeDirectory($this);
52 52
 
53
-        if(!file_exists($this->directory['requestCreate'].'/Request.php')){
53
+        if (!file_exists($this->directory['requestCreate'].'/Request.php')) {
54 54
             $this->touch['source/request'] = $this->directory['requestCreate'].'/Request.php';
55 55
             $this->touch['source/requestGenerator'] = $this->directory['requestCreate'].'/RequestGenerator.php';
56 56
         }
57 57
 
58
-        if(!file_exists($this->directory['requestCreate'].'/RequestProvider.php')){
58
+        if (!file_exists($this->directory['requestCreate'].'/RequestProvider.php')) {
59 59
             $this->touch['source/requestProvider'] = $this->directory['requestCreate'].'/RequestProvider.php';
60 60
         }
61 61
 
Please login to merge, or discard this patch.
src/resta/Console/Source/Command/Command.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='command';
16
+    public $type = 'command';
17 17
 
18 18
     /**
19 19
      * @var array
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
     /**
26 26
      * @var $commandRule
27 27
      */
28
-    protected $commandRule=['command'];
28
+    protected $commandRule = ['command'];
29 29
 
30 30
     /**
31 31
      * @method create
32 32
      * @return mixed
33 33
      */
34
-    public function create(){
34
+    public function create() {
35 35
 
36 36
         $this->directory['commandDir'] = path()->command();
37 37
         $this->argument['commandNamespace'] = app()->namespace()->command();
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         //set project directory
41 41
         $this->file->makeDirectory($this);
42 42
 
43
-        $this->touch['command/file']        = $this->directory['commandDir'].'/'.$this->argument['command'].'.php';
43
+        $this->touch['command/file'] = $this->directory['commandDir'].'/'.$this->argument['command'].'.php';
44 44
 
45 45
         $this->file->touch($this);
46 46
 
Please login to merge, or discard this patch.
src/resta/Console/ConsoleOutputter.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -155,8 +155,7 @@
 block discarded – undo
155 155
 
156 156
         if(isset($this->argument['group'])){
157 157
             $argument=current($dataParse).''.$seperate.''.$this->argument['group'];
158
-        }
159
-        else{
158
+        } else{
160 159
             $argument=current($dataParse);
161 160
         }
162 161
 
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      * @param $argument
64 64
      * @param $app
65 65
      */
66
-    public function __construct($argument,$app) {
66
+    public function __construct($argument, $app) {
67 67
 
68 68
         // Set up shell colors
69 69
         $this->foreground_colors['black'] = '0;30';
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $this->table = new \console_table();
100 100
 
101 101
 
102
-        if(isset($this->argument['project'])){
102
+        if (isset($this->argument['project'])) {
103 103
 
104 104
             $this->argument['repositoryNamespace']  = app()->namespace()->repository();
105 105
             $this->argument['modelNamespace']       = app()->namespace()->model();
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             $this->argument['project'] = $this->argument['project'].'\\'.StaticPathList::$projectPrefixGroup;
111 111
 
112 112
 
113
-            $this->project = StaticPathModel::appPath().'/'.str_replace('\\','/',$this->argument['project']);
113
+            $this->project = StaticPathModel::appPath().'/'.str_replace('\\', '/', $this->argument['project']);
114 114
 
115 115
 
116 116
         }
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
         return array_keys($this->background_colors);
128 128
     }
129 129
 
130
-    public function ReadStdin($prompt=null, $valid_inputs=null, $default = '') {
131
-        while(!isset($input) || (is_array($valid_inputs) && !in_array($input, $valid_inputs)) || ($valid_inputs == 'is_file' && !is_file($input))) {
130
+    public function ReadStdin($prompt = null, $valid_inputs = null, $default = '') {
131
+        while (!isset($input) || (is_array($valid_inputs) && !in_array($input, $valid_inputs)) || ($valid_inputs=='is_file' && !is_file($input))) {
132 132
             echo $this->input($prompt);
133 133
             $input = strtolower(trim(fgets(STDIN)));
134
-            if(empty($input) && !empty($default)) {
134
+            if (empty($input) && !empty($default)) {
135 135
                 $input = $default;
136 136
             }
137 137
         }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      * @param array $commander
143 143
      * @return mixed|string
144 144
      */
145
-    public function exception($commander=array()){
145
+    public function exception($commander = array()) {
146 146
         return $this->error('[['.$commander['argument'].']] parameter is missing for commander');
147 147
     }
148 148
 
@@ -151,15 +151,15 @@  discard block
 block discarded – undo
151 151
      * @param string $seperate
152 152
      * @return mixed|string
153 153
      */
154
-    public function checkGroupArgument($data,$seperate="\\"){
154
+    public function checkGroupArgument($data, $seperate = "\\") {
155 155
 
156
-        $dataParse=explode("\\",$data);
156
+        $dataParse = explode("\\", $data);
157 157
 
158
-        if(isset($this->argument['group'])){
159
-            $argument=current($dataParse).''.$seperate.''.$this->argument['group'];
158
+        if (isset($this->argument['group'])) {
159
+            $argument = current($dataParse).''.$seperate.''.$this->argument['group'];
160 160
         }
161
-        else{
162
-            $argument=current($dataParse);
161
+        else {
162
+            $argument = current($dataParse);
163 163
         }
164 164
 
165 165
         return $argument;
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
     /**
169 169
      * @param $string
170 170
      */
171
-    public function consoleLogger($string,$level)
171
+    public function consoleLogger($string, $level)
172 172
     {
173
-        if(config('app')!==null && config('app.consoleLogger')){
173
+        if (config('app')!==null && config('app.consoleLogger')) {
174 174
 
175 175
             logger('console')->{$level}([
176
-                'argument'  => implode(" ",core()->consoleArguments),
176
+                'argument'  => implode(" ", core()->consoleArguments),
177 177
                 'result'    => $string,
178 178
             ]);
179 179
         }
Please login to merge, or discard this patch.
src/resta/Console/ConsoleBindings.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@  discard block
 block discarded – undo
20 20
      * @method bindConsoleShared
21 21
      * @return array
22 22
      */
23
-    private function bindConsoleShared(){
23
+    private function bindConsoleShared() {
24 24
 
25 25
         //We assign the values assigned to the console object to the bindings array.
26 26
         //The console object represents the classes to be bound for the kernel object console.
27 27
         //if the array returns false on an if condition, the array will be automatically detected as empty.
28
-        if(isset($this->app['consoleShared']) and is_array($this->app['consoleShared'])){
28
+        if (isset($this->app['consoleShared']) and is_array($this->app['consoleShared'])) {
29 29
             return $this->app['consoleShared'];
30 30
         }
31 31
         return [];
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      * @param $container
37 37
      * @return void
38 38
      */
39
-    public function bindForAppCommand($object,$container){
39
+    public function bindForAppCommand($object, $container) {
40 40
 
41 41
         //We need a definition of the application name from the data supplied with the console variables.
42 42
         //The specified app variable is important to us in the command that is run in the application.
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
         //we send the value to the bind method without callback after checking the bind object to be loaded for the console.
55 55
         //This is the value found in the bindings variable.
56 56
         //Thus, we get the binding objects required for the console independently of the http method installation.
57
-        if(isset($this->bindings[$object])){
58
-            $this->app->{$appresolve}($object,$this->bindings[$object]);
57
+        if (isset($this->bindings[$object])) {
58
+            $this->app->{$appresolve}($object, $this->bindings[$object]);
59 59
         }
60 60
     }
61 61
 
@@ -64,25 +64,25 @@  discard block
 block discarded – undo
64 64
      * @param $callback
65 65
      * @param $container
66 66
      */
67
-    public function console($object,$callback,$container){
67
+    public function console($object, $callback, $container) {
68 68
 
69 69
         //If the console argument is an operator that exists in the resta kernel,
70 70
         //we run a callback method to check it. The bindings for the custom application commander will be run.
71
-        $this->bindForAppCommand($object,$container);
71
+        $this->bindForAppCommand($object, $container);
72 72
 
73 73
         //closure object
74 74
         $callBackResolve = Utils::callbackProcess($callback);
75 75
 
76 76
         // if the callbackresolve variable represents a class,
77 77
         // we directly register it's resolved status to the container object.
78
-        if(Utils::isNamespaceExists($callBackResolve)){
79
-            $this->app->register($object,$this->app->resolve(Utils::callbackProcess($callback)));
78
+        if (Utils::isNamespaceExists($callBackResolve)) {
79
+            $this->app->register($object, $this->app->resolve(Utils::callbackProcess($callback)));
80 80
         }
81
-        else{
81
+        else {
82 82
 
83 83
             // if callbackresolve doesn't represent a class,
84 84
             // we're register it's no resolved status.
85
-            $this->app->register($object,Utils::callbackProcess($callback));
85
+            $this->app->register($object, Utils::callbackProcess($callback));
86 86
         }
87 87
 
88 88
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,8 +77,7 @@
 block discarded – undo
77 77
         // we directly register it's resolved status to the container object.
78 78
         if(Utils::isNamespaceExists($callBackResolve)){
79 79
             $this->app->register($object,$this->app->resolve(Utils::callbackProcess($callback)));
80
-        }
81
-        else{
80
+        } else{
82 81
 
83 82
             // if callbackresolve doesn't represent a class,
84 83
             // we're register it's no resolved status.
Please login to merge, or discard this patch.
src/resta/Console/Color.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
     function convert($string, $colored = true)
218 218
     {
219 219
         static $conversions = array ( // static so the array doesn't get built
220
-                                      // everytime
220
+                                        // everytime
221 221
             // %y - yellow, and so on... {{{
222 222
             '%y' => array('color' => 'yellow'),
223 223
             '%g' => array('color' => 'green' ),
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
             $string = str_replace('%%', '% ', $string);
261 261
             foreach ($conversions as $key => $value) {
262 262
                 $string = str_replace($key, Console_Color::color($value),
263
-                          $string);
263
+                            $string);
264 264
             }
265 265
             $string = str_replace('% ', '%', $string);
266 266
 
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
  */
33 33
 
34 34
 
35
-$GLOBALS['_CONSOLE_COLOR_CODES'] = array (
35
+$GLOBALS['_CONSOLE_COLOR_CODES'] = array(
36 36
     'color' => array(
37 37
             'black'  => 30,
38 38
             'red'    => 31,
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             $color      = @$color['color'];
113 113
         }
114 114
 
115
-        if ($color == 'reset') {
115
+        if ($color=='reset') {
116 116
             return "\033[0m";
117 117
         }
118 118
 
@@ -216,37 +216,37 @@  discard block
 block discarded – undo
216 216
      */
217 217
     function convert($string, $colored = true)
218 218
     {
219
-        static $conversions = array ( // static so the array doesn't get built
219
+        static $conversions = array( // static so the array doesn't get built
220 220
                                       // everytime
221 221
             // %y - yellow, and so on... {{{
222 222
             '%y' => array('color' => 'yellow'),
223
-            '%g' => array('color' => 'green' ),
224
-            '%b' => array('color' => 'blue'  ),
225
-            '%r' => array('color' => 'red'   ),
223
+            '%g' => array('color' => 'green'),
224
+            '%b' => array('color' => 'blue'),
225
+            '%r' => array('color' => 'red'),
226 226
             '%p' => array('color' => 'purple'),
227 227
             '%m' => array('color' => 'purple'),
228
-            '%c' => array('color' => 'cyan'  ),
229
-            '%w' => array('color' => 'grey'  ),
230
-            '%k' => array('color' => 'black' ),
231
-            '%n' => array('color' => 'reset' ),
232
-            '%Y' => array('color' => 'yellow',  'style' => 'light'),
233
-            '%G' => array('color' => 'green',   'style' => 'light'),
234
-            '%B' => array('color' => 'blue',    'style' => 'light'),
235
-            '%R' => array('color' => 'red',     'style' => 'light'),
236
-            '%P' => array('color' => 'purple',  'style' => 'light'),
237
-            '%M' => array('color' => 'purple',  'style' => 'light'),
238
-            '%C' => array('color' => 'cyan',    'style' => 'light'),
239
-            '%W' => array('color' => 'grey',    'style' => 'light'),
240
-            '%K' => array('color' => 'black',   'style' => 'light'),
241
-            '%N' => array('color' => 'reset',   'style' => 'light'),
228
+            '%c' => array('color' => 'cyan'),
229
+            '%w' => array('color' => 'grey'),
230
+            '%k' => array('color' => 'black'),
231
+            '%n' => array('color' => 'reset'),
232
+            '%Y' => array('color' => 'yellow', 'style' => 'light'),
233
+            '%G' => array('color' => 'green', 'style' => 'light'),
234
+            '%B' => array('color' => 'blue', 'style' => 'light'),
235
+            '%R' => array('color' => 'red', 'style' => 'light'),
236
+            '%P' => array('color' => 'purple', 'style' => 'light'),
237
+            '%M' => array('color' => 'purple', 'style' => 'light'),
238
+            '%C' => array('color' => 'cyan', 'style' => 'light'),
239
+            '%W' => array('color' => 'grey', 'style' => 'light'),
240
+            '%K' => array('color' => 'black', 'style' => 'light'),
241
+            '%N' => array('color' => 'reset', 'style' => 'light'),
242 242
             '%3' => array('background' => 'yellow'),
243
-            '%2' => array('background' => 'green' ),
244
-            '%4' => array('background' => 'blue'  ),
245
-            '%1' => array('background' => 'red'   ),
243
+            '%2' => array('background' => 'green'),
244
+            '%4' => array('background' => 'blue'),
245
+            '%1' => array('background' => 'red'),
246 246
             '%5' => array('background' => 'purple'),
247
-            '%6' => array('background' => 'cyan'  ),
248
-            '%7' => array('background' => 'grey'  ),
249
-            '%0' => array('background' => 'black' ),
247
+            '%6' => array('background' => 'cyan'),
248
+            '%7' => array('background' => 'grey'),
249
+            '%0' => array('background' => 'black'),
250 250
             // Don't use this, I can't stand flashing text
251 251
             '%F' => array('style' => 'blink'),
252 252
             '%U' => array('style' => 'underline'),
Please login to merge, or discard this patch.