Passed
Push — master ( a9f91b...39332f )
by Php Easy Api
03:03
created
src/resta/Console/ConsoleArguments.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     {
17 17
 
18 18
         //if there is no arguments constant
19
-        if(!defined('arguments'))  define ('arguments',['api']);
19
+        if (!defined('arguments'))  define('arguments', ['api']);
20 20
 
21 21
         //get psr standard console arguments
22 22
         return core()->consoleArguments = Utils::upperCase(arguments);
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      * @method getConsoleClass
27 27
      * @return mixed
28 28
      */
29
-    public function getConsoleClass(){
29
+    public function getConsoleClass() {
30 30
 
31 31
         return current($this->getArguments());
32 32
     }
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      * @method getConsoleClassMethod
36 36
      * @return mixed
37 37
      */
38
-    public function getConsoleClassMethod(){
38
+    public function getConsoleClassMethod() {
39 39
 
40 40
         return $this->getArguments()[1];
41 41
     }
@@ -44,44 +44,44 @@  discard block
 block discarded – undo
44 44
      * @method getConsoleClassMethod
45 45
      * @return mixed
46 46
      */
47
-    public function getConsoleClassRealArguments(){
47
+    public function getConsoleClassRealArguments() {
48 48
 
49
-        return array_slice($this->getArguments(),2);
49
+        return array_slice($this->getArguments(), 2);
50 50
     }
51 51
 
52 52
     /**
53 53
      * @method getConsoleArgumentsWithKey
54 54
      * @return array
55 55
      */
56
-    public function getConsoleArgumentsWithKey(){
56
+    public function getConsoleArgumentsWithKey() {
57 57
 
58 58
         //get console class real arguments
59
-        $getConsoleClassRealArguments=$this->getConsoleClassRealArguments();
59
+        $getConsoleClassRealArguments = $this->getConsoleClassRealArguments();
60 60
 
61
-        $listKey=[];
62
-        $listKey['project']=null;
61
+        $listKey = [];
62
+        $listKey['project'] = null;
63 63
 
64
-        if(property_exists($this,'consoleClassNamespace')){
64
+        if (property_exists($this, 'consoleClassNamespace')) {
65 65
             $listKey['class'] = strtolower(class_basename($this->consoleClassNamespace));
66 66
             $listKey['classMethod'] = strtolower($this->getConsoleClassMethod());
67 67
         }
68 68
 
69
-        foreach($getConsoleClassRealArguments as $key=>$value){
69
+        foreach ($getConsoleClassRealArguments as $key=>$value) {
70 70
 
71
-            if($key=="0"){
71
+            if ($key=="0") {
72 72
 
73
-                $listKey['project']=$value;
73
+                $listKey['project'] = $value;
74 74
             }
75
-            else{
75
+            else {
76 76
 
77
-                $colonExplode=explode(":",$value);
78
-                $listKey[strtolower($colonExplode[0])]=ucfirst($colonExplode[1]);
77
+                $colonExplode = explode(":", $value);
78
+                $listKey[strtolower($colonExplode[0])] = ucfirst($colonExplode[1]);
79 79
             }
80 80
 
81 81
         }
82 82
 
83 83
         //get app version
84
-        $listKey['version']=UrlVersionIdentifier::version();
84
+        $listKey['version'] = UrlVersionIdentifier::version();
85 85
 
86 86
         return $listKey;
87 87
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     /**
91 91
      * @return string
92 92
      */
93
-    public function consoleClassNamespace(){
93
+    public function consoleClassNamespace() {
94 94
         return 'Resta\Console\\Source\\'.$this->getConsoleClass().'\\'.$this->getConsoleClass();
95 95
     }
96 96
 
@@ -101,18 +101,18 @@  discard block
 block discarded – undo
101 101
     public function defineAppnameForCustomConsole()
102 102
     {
103 103
 
104
-        $arguments=$this->getArguments();
104
+        $arguments = $this->getArguments();
105 105
 
106 106
         $this->getConsoleArgumentsWithKey();
107 107
 
108
-        if(isset($arguments[2])){
109
-            $app=$arguments[2];
108
+        if (isset($arguments[2])) {
109
+            $app = $arguments[2];
110 110
         }
111 111
 
112
-        if(!defined('group')){
113
-            define('group',StaticPathList::$projectPrefixGroup);
112
+        if (!defined('group')) {
113
+            define('group', StaticPathList::$projectPrefixGroup);
114 114
         }
115 115
 
116
-        if(!defined('app') and isset($arguments[2])) define('app',$app);
116
+        if (!defined('app') and isset($arguments[2])) define('app', $app);
117 117
     }
118 118
 }
119 119
\ No newline at end of file
Please login to merge, or discard this patch.