Completed
Push — master ( 50f9fe...7dd5cf )
by Sergi Tur
02:34
created
src/Console/PackageListCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,6 +48,6 @@
 block discarded – undo
48 48
      */
49 49
     private function parsePackageInfo($package)
50 50
     {
51
-        return 'Composer name: '.$package['name'];
51
+        return 'Composer name: '.$package[ 'name' ];
52 52
     }
53 53
 }
Please login to merge, or discard this patch.
src/Parser/LlumRCParser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
     public function getCredentials()
51 51
     {
52 52
         $rc_file = $this->parse();
53
-        if ( array_key_exists('username',$rc_file) && array_key_exists('username',$rc_file)) {
54
-            return [$rc_file['username'],$rc_file['token']];
53
+        if (array_key_exists('username', $rc_file) && array_key_exists('username', $rc_file)) {
54
+            return [ $rc_file[ 'username' ], $rc_file[ 'token' ] ];
55 55
         }
56 56
     }
57 57
 
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
     public function getGitHubUsername()
64 64
     {
65 65
         $rc_file = $this->parse();
66
-        if ( array_key_exists('username',$rc_file)) {
67
-            return $rc_file['username'];
66
+        if (array_key_exists('username', $rc_file)) {
67
+            return $rc_file[ 'username' ];
68 68
         }
69 69
     }
70 70
 
Please login to merge, or discard this patch.
src/Github/GithubAPI.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      * @return string
71 71
      */
72 72
     protected function repo_json_stub() {
73
-        return __DIR__ . '/stubs/repo_json.stub';
73
+        return __DIR__.'/stubs/repo_json.stub';
74 74
     }
75 75
 
76 76
     /**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      * @return string
80 80
      */
81 81
     protected function authorization_url() {
82
-        return $this->api_url . $this->authorizations_uri;
82
+        return $this->api_url.$this->authorizations_uri;
83 83
     }
84 84
 
85 85
     /**
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      * @return string
89 89
      */
90 90
     protected function create_repo_url() {
91
-        return $this->api_url . $this->repos_uri;
91
+        return $this->api_url.$this->repos_uri;
92 92
     }
93 93
 
94 94
     /**
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     {
103 103
         $response = $this->client->request('POST', $this->authorization_url(),
104 104
             [
105
-                "auth" => [ $username, $password],
105
+                "auth" => [ $username, $password ],
106 106
                 "json" => $this->authorizationsRequestJson()
107 107
             ]
108 108
         );
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     /**
115 115
      * @return array
116 116
      */
117
-    protected function authorizationsRequestJson(){
117
+    protected function authorizationsRequestJson() {
118 118
         return [
119 119
             'scopes' => [ 'public_repo' ],
120 120
             'note' =>  uniqid('llum_')
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         return $this->client->request('POST', $this->create_repo_url(),
134 134
             [
135 135
                 "auth" => $this->credentials(),
136
-                "json" => json_decode($this->compileStub($repo_name, $repo_description),true),
136
+                "json" => json_decode($this->compileStub($repo_name, $repo_description), true),
137 137
             ]
138 138
         );
139 139
     }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             "REPO_DESCRIPTION" => $repo_description
176 176
         ];
177 177
         return $this->compile(
178
-            $this->filesystem->get($this->repo_json_stub()) ,
178
+            $this->filesystem->get($this->repo_json_stub()),
179 179
             $data);
180 180
     }
181 181
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
      */
189 189
     protected function compile($template, $data)
190 190
     {
191
-        foreach($data as $key => $value)
191
+        foreach ($data as $key => $value)
192 192
         {
193 193
             $template = preg_replace("/\\$$key\\$/i", $value, $template);
194 194
         }
Please login to merge, or discard this patch.
src/Compiler/RCFileCompiler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function compile($template, $data)
15 15
     {
16
-        foreach($data as $key => $value)
16
+        foreach ($data as $key => $value)
17 17
         {
18 18
             $template = preg_replace("/\\$$key\\$/i", $value, $template);
19 19
         }
Please login to merge, or discard this patch.
src/Filesystem/Filesystem.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
      */
34 34
     public function make($file, $content)
35 35
     {
36
-        if ( $this->exists($file))
36
+        if ($this->exists($file))
37 37
         {
38 38
             throw new FileAlreadyExists;
39 39
         }
Please login to merge, or discard this patch.
src/LlumRCFile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,6 +18,6 @@
 block discarded – undo
18 18
      */
19 19
     public function path()
20 20
     {
21
-        return getenv("HOME") . $this->relative_file_path;
21
+        return getenv("HOME").$this->relative_file_path;
22 22
     }
23 23
 }
24 24
\ No newline at end of file
Please login to merge, or discard this patch.
src/Console/InitCommand.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      * @return string
81 81
      */
82 82
     protected function getStubPath() {
83
-        return __DIR__ . '/stubs/llumrc.stub';
83
+        return __DIR__.'/stubs/llumrc.stub';
84 84
     }
85 85
 
86 86
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     public function init(InputInterface $input, OutputInterface $output)
106 106
     {
107 107
         try {
108
-            $this->executeWizard($input,$output);
108
+            $this->executeWizard($input, $output);
109 109
             $this->filesytem->overwrite(
110 110
                 (new LlumRCFile())->path(),
111 111
                 $this->compiler->compile(
@@ -122,10 +122,10 @@  discard block
 block discarded – undo
122 122
      * @param InputInterface $input
123 123
      * @param OutputInterface $output
124 124
      */
125
-    protected function executeWizard(InputInterface $input, OutputInterface $output){
125
+    protected function executeWizard(InputInterface $input, OutputInterface $output) {
126 126
 
127
-        $this->askGithubUsername($input,$output);
128
-        $this->askGithubToken($input,$output);
127
+        $this->askGithubUsername($input, $output);
128
+        $this->askGithubToken($input, $output);
129 129
 
130 130
         $this->data = [
131 131
             "GITHUB_USERNAME" => $this->github_username,
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     public function askGithubUsername(InputInterface $input, OutputInterface $output)
142 142
     {
143 143
         $defaultusername = $this->defaultUsername();
144
-        $question = new Question('<info>Please enter your github username (' . $defaultusername . ') ? </info>', $defaultusername);
144
+        $question = new Question('<info>Please enter your github username ('.$defaultusername.') ? </info>', $defaultusername);
145 145
         $this->github_username = $this->getHelper('question')->ask($input, $output, $question);
146 146
     }
147 147
 
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
     {
162 162
         $question = new ConfirmationQuestion('<info>Do you want to use our assistant to obtain token via Github API (Y/n)? </info>', true);
163 163
         if ($this->getHelper('question')->ask($input, $output, $question)) {
164
-            $this->github_token =$this->api->getPersonalToken(
164
+            $this->github_token = $this->api->getPersonalToken(
165 165
                 $this->github_username,
166
-                $this->askGithubPassword($input,$output));
166
+                $this->askGithubPassword($input, $output));
167 167
         }
168 168
     }
169 169
 
Please login to merge, or discard this patch.
src/Console/GithubCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      */
21 21
     protected function showErrorRunLlumInitFirst(OutputInterface $output, $varname)
22 22
     {
23
-        $output->writeln('<error>' . $varname
23
+        $output->writeln('<error>'.$varname
24 24
             . ' not found in config file. Run git init before executing this command!</error>');
25 25
         die();
26 26
     }
@@ -31,6 +31,6 @@  discard block
 block discarded – undo
31 31
      * @param OutputInterface $output
32 32
      */
33 33
     protected function showMessageRunningCommand(OutputInterface $output, $commandName) {
34
-        $output->writeln('<info>Running command ' . $commandName . '...</info>');
34
+        $output->writeln('<info>Running command '.$commandName.'...</info>');
35 35
     }
36 36
 }
37 37
\ No newline at end of file
Please login to merge, or discard this patch.
src/Console/GithubRepoCommand.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -79,15 +79,15 @@  discard block
 block discarded – undo
79 79
         $this->api->setCredentials($this->getCredentials($output));
80 80
         $name = $this->repoName($input);
81 81
         try {
82
-            $this->api->createRepo($name,$this->repoDescription($input));
82
+            $this->api->createRepo($name, $this->repoDescription($input));
83 83
         } catch (ServerException $se) {
84 84
             //TODO
85 85
             $output->writeln('<error>Server exception thrown</error>');
86 86
             die();
87 87
         } catch (ClientException $ce) {
88
-            $this->showError( $ce , $output );
88
+            $this->showError($ce, $output);
89 89
         }
90
-        $output->writeln('<info>Repository ' . $name . ' created</info>');
90
+        $output->writeln('<info>Repository '.$name.' created</info>');
91 91
     }
92 92
 
93 93
 
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
     public function getCredentials(OutputInterface $output)
118 118
     {
119 119
         $credentials = $this->parser->getCredentials();
120
-        if ( is_null($credentials)) {
121
-            $this->showErrorRunLlumInitFirst($output,"Credentials");
120
+        if (is_null($credentials)) {
121
+            $this->showErrorRunLlumInitFirst($output, "Credentials");
122 122
         };
123 123
         return $credentials;
124 124
     }
Please login to merge, or discard this patch.