Completed
Push — master ( 5ad7ef...2b7a6e )
by Alireza
01:45
created
src/Console.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
     /**
41 41
      * Register all commands
42 42
      *
43
-     * @return object
43
+     * @return null|integer
44 44
      */
45 45
     public function start()
46 46
     {
Please login to merge, or discard this patch.
src/ConsoleStyle.php 2 patches
Doc Comments   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,6 @@  discard block
 block discarded – undo
61 61
      * Write a string as warning output.
62 62
      *
63 63
      * @param  string          $string
64
-     * @param  null|int|string $verbosity
65 64
      * @return void
66 65
      */
67 66
     public function note($string)
@@ -124,6 +123,9 @@  discard block
 block discarded – undo
124 123
         return $level;
125 124
     }
126 125
 
126
+    /**
127
+     * @param string $message
128
+     */
127 129
     public function addInput($message)
128 130
     {
129 131
         $this->info('>>> ' . $message . ' :');
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     {
118 118
         if (isset($this->verbosityMap[$level])) {
119 119
             $level = $this->verbosityMap[$level];
120
-        } elseif (! is_int($level)) {
120
+        } elseif (!is_int($level)) {
121 121
             $level = $this->verbosity;
122 122
         }
123 123
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
     public function addInput($message)
128 128
     {
129
-        $this->info('>>> ' . $message . ' :');
129
+        $this->info('>>> '.$message.' :');
130 130
         $userHandle = fopen("php://stdin", "r");
131 131
         $input = fgets($userHandle);
132 132
         fclose($userHandle);
Please login to merge, or discard this patch.
src/Commands/ChmodCommandLocally.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         $this->addArgument('directory', InputArgument::REQUIRED, 'Get the directory');
28 28
     }
29 29
 
30
-    protected function execute(InputInterface $input , OutputInterface $output)
30
+    protected function execute(InputInterface $input, OutputInterface $output)
31 31
     {
32 32
         $command = new Style($input, $output);
33 33
 
Please login to merge, or discard this patch.
src/Commands/ChmodCommandHostly.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         $this->addArgument('directory', InputArgument::REQUIRED, 'Get the directory');
28 28
     }
29 29
 
30
-    protected function execute(InputInterface $input , OutputInterface $output)
30
+    protected function execute(InputInterface $input, OutputInterface $output)
31 31
     {
32 32
         $command = new Style($input, $output);
33 33
 
Please login to merge, or discard this patch.
src/Commands/LocallyIpCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         $this->addArgument('directory', InputArgument::REQUIRED, 'Get the directory');
28 28
     }
29 29
 
30
-    protected function execute(InputInterface $input , OutputInterface $output)
30
+    protected function execute(InputInterface $input, OutputInterface $output)
31 31
     {
32 32
         $command = new Style($input, $output);
33 33
 
Please login to merge, or discard this patch.
src/Commands/PublicIpCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         $this->addArgument('directory', InputArgument::REQUIRED, 'Get the directory');
28 28
     }
29 29
 
30
-    protected function execute(InputInterface $input , OutputInterface $output)
30
+    protected function execute(InputInterface $input, OutputInterface $output)
31 31
     {
32 32
         $command = new Style($input, $output);
33 33
 
Please login to merge, or discard this patch.
src/Commands/LampCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         $this->addArgument('directory', InputArgument::REQUIRED, 'Get the directory');
28 28
     }
29 29
 
30
-    protected function execute(InputInterface $input , OutputInterface $output)
30
+    protected function execute(InputInterface $input, OutputInterface $output)
31 31
     {
32 32
         $command = new Style($input, $output);
33 33
 
Please login to merge, or discard this patch.
src/Commands/HookSetupCommand.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $this->setName('hook:setup')
32 32
             ->setDescription('Setup hook of your packagist package');
33 33
 
34
-        $this->addOption('clear' , 'c', InputOption::VALUE_NONE, 'Clear default details');
34
+        $this->addOption('clear', 'c', InputOption::VALUE_NONE, 'Clear default details');
35 35
     }
36 36
 
37 37
     /**
@@ -40,28 +40,28 @@  discard block
 block discarded – undo
40 40
      * @param InputInterface $input
41 41
      * @param OutputInterface $output
42 42
      */
43
-    protected function execute(InputInterface $input , OutputInterface $output)
43
+    protected function execute(InputInterface $input, OutputInterface $output)
44 44
     {
45
-        $authFile = $this->getHomeDir() . '/.Josh/auth.json';
45
+        $authFile = $this->getHomeDir().'/.Josh/auth.json';
46 46
 
47
-        if($input->getOption('clear')){
47
+        if ($input->getOption('clear')) {
48 48
             unlink($authFile);
49 49
         }
50 50
 
51 51
         $command = new Style($input, $output);
52 52
 
53
-        if(! file_exists($authFile)){
53
+        if (!file_exists($authFile)) {
54 54
 
55 55
             $username = $command->addInput('Enter your packagist username');
56 56
 
57
-            if(empty($username)) {
57
+            if (empty($username)) {
58 58
                 $command->error("Packagist username is required !");
59 59
                 exit;
60 60
             }
61 61
 
62 62
             $api = $command->addInput('Enter your packagist API');
63 63
 
64
-            if(empty($api)) {
64
+            if (empty($api)) {
65 65
                 $command->error("Packagist API is required !");
66 66
                 exit;
67 67
             }
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
 
76 76
             $answer = $helper->ask($input, $output, $question);
77 77
 
78
-            if($answer){
78
+            if ($answer) {
79 79
                 touch($authFile);
80
-                chmod($authFile,0777);
81
-                file_put_contents($authFile,json_encode([
80
+                chmod($authFile, 0777);
81
+                file_put_contents($authFile, json_encode([
82 82
                     'api' => $api,
83 83
                     'username' => $username
84 84
                 ]));
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
 
93 93
             $command->line("");
94 94
 
95
-            $command->line("Packagist API : ". $auth['api']);
95
+            $command->line("Packagist API : ".$auth['api']);
96 96
 
97
-            $command->line('Packagist Username : '. $auth['username']);
97
+            $command->line('Packagist Username : '.$auth['username']);
98 98
 
99 99
             $command->note(
100 100
                 'If you want change your details type `josh hook:setup --clear` '
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             $username = $auth['username'];
106 106
         }
107 107
 
108
-        $this->sendRequest($command,$api,$username);
108
+        $this->sendRequest($command, $api, $username);
109 109
     }
110 110
 
111 111
     /**
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
     {
120 120
         $package = $command->addInput('Enter your package-url');
121 121
 
122
-        if(empty(trim($package))) {
122
+        if (empty(trim($package))) {
123 123
             $command->error("Package-url is required !");
124 124
             exit;
125 125
         }
126 126
 
127 127
         $command->info("Sending request ...");
128 128
 
129
-        $data = [ 'repository' => [ 'url' => $package ] ];
129
+        $data = ['repository' => ['url' => $package]];
130 130
 
131 131
         $client = new Guzzle([
132 132
             'base_uri' => 'https://packagist.org/',
@@ -135,12 +135,12 @@  discard block
 block discarded – undo
135 135
             ]
136 136
         ]);
137 137
 
138
-        $result = $client->post('/api/update-package?username=' . $username .
139
-            '&apiToken=' . $api,[ 'json' => $data ]);
138
+        $result = $client->post('/api/update-package?username='.$username.
139
+            '&apiToken='.$api, ['json' => $data]);
140 140
 
141 141
         $result = json_decode($result->getBody()->getContents(), true);
142 142
 
143
-        if($result['status'] !== 'success') {
143
+        if ($result['status'] !== 'success') {
144 144
             $command->error("Message : ".$result['message']." | Failed ");
145 145
             exit;
146 146
         }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      */
155 155
     public function getHomeDir()
156 156
     {
157
-        if(empty($_SERVER['HOME'])){
157
+        if (empty($_SERVER['HOME'])) {
158 158
             return posix_getpwuid(posix_getuid());
159 159
         }
160 160
 
Please login to merge, or discard this patch.