Completed
Push — master ( 852d76...8d66d4 )
by Sébastien
03:25
created
src/PjbServer/Tools/Network/PortTester.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
             }
74 74
         }
75 75
         if (!in_array($this->options['backend'], $this->supportedBackends)) {
76
-            throw new \InvalidArgumentException("Unsupported backend '" . $this->options['backend'] . "'");
76
+            throw new \InvalidArgumentException("Unsupported backend '".$this->options['backend']."'");
77 77
         }
78 78
     }
79 79
 
Please login to merge, or discard this patch.
src/PjbServer/Tools/Console/Command/LoggerTrait.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,11 +24,11 @@
 block discarded – undo
24 24
      */
25 25
     public function logServerConfig(ConsoleLogger $logger, Config $config)
26 26
     {
27
-        $logger->info("* config port       :" . $config->getPort());
28
-        $logger->info("* config log_file   :" . $config->getLogFile());
29
-        $logger->info("* config pid_file   :" . $config->getPidFile());
30
-        $logger->info("* config classpaths :" . implode(',', $config->getClasspaths()));
31
-        $logger->info("* config java_bin   :" . $config->getJavaBin());
32
-        $logger->info("* config server_jar :" . $config->getServerJar());
27
+        $logger->info("* config port       :".$config->getPort());
28
+        $logger->info("* config log_file   :".$config->getLogFile());
29
+        $logger->info("* config pid_file   :".$config->getPidFile());
30
+        $logger->info("* config classpaths :".implode(',', $config->getClasspaths()));
31
+        $logger->info("* config java_bin   :".$config->getJavaBin());
32
+        $logger->info("* config server_jar :".$config->getServerJar());
33 33
     }
34 34
 }
Please login to merge, or discard this patch.
src/PjbServer/Tools/Console/Command/PjbServerRestartCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
         $this->server = new StandaloneServer($config, $logger);
60 60
         $this->server->restart();
61 61
 
62
-        $logger->debug("Server output: \n" . $this->server->getOutput());
62
+        $logger->debug("Server output: \n".$this->server->getOutput());
63 63
 
64 64
         $output->writeln("Server successfully restarted on port $port");
65 65
         return 0;
Please login to merge, or discard this patch.
src/PjbServer/Tools/StandaloneServer/Config.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
     {
186 186
         // Four levels back.
187 187
         $ds  = DIRECTORY_SEPARATOR;
188
-        $dir = __DIR__ . "$ds..$ds..$ds..$ds..$ds";
188
+        $dir = __DIR__."$ds..$ds..$ds..$ds..$ds";
189 189
         $base_dir = realpath($dir);
190 190
         if (!$base_dir) {
191 191
             $message = "Cannot resolve project base directory.";
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 
212 212
         // Step 2: server_jar file must exists
213 213
         if (!is_file($config['server_jar']) || !is_readable($config['server_jar'])) {
214
-            throw new Exception\InvalidArgumentException("Server jar file not exists or unreadable. server-jar: '" . $config['server_jar'] ."'");
214
+            throw new Exception\InvalidArgumentException("Server jar file not exists or unreadable. server-jar: '".$config['server_jar']."'");
215 215
         }
216 216
 
217 217
         // Step 3: log and pid file should be creatable
Please login to merge, or discard this patch.
src/PjbServer/Tools/System/Linux/LinuxProcess.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     public function isRunning($pid)
40 40
     {
41 41
         $cmd = sprintf("kill -0 %d 2>&1", $pid);
42
-        $this->logger->debug(__METHOD__ . ": Exec command: $cmd");
42
+        $this->logger->debug(__METHOD__.": Exec command: $cmd");
43 43
         exec($cmd, $output, $return_var);
44 44
         $running = ($return_var === 0);
45 45
         return $running;
@@ -60,13 +60,13 @@  discard block
 block discarded – undo
60 60
             if ($wait) {
61 61
                 $sleep_time = '0.2';
62 62
                 $cmd = sprintf("kill %d; while ps -p %d; do sleep %s;done;", $pid, $pid, $sleep_time);
63
-                $this->logger->debug(__METHOD__ . " Exec command: $cmd");
63
+                $this->logger->debug(__METHOD__." Exec command: $cmd");
64 64
                 exec($cmd, $output, $return_var);
65 65
                 $killed = ($return_var === 0);
66 66
                 if ($killed) {
67
-                    $this->logger->debug(__METHOD__ . " Successfully killed process {$pid}");
67
+                    $this->logger->debug(__METHOD__." Successfully killed process {$pid}");
68 68
                 } else {
69
-                    $this->logger->notice(__METHOD__ . " Cannot kill process {$pid}, $output");
69
+                    $this->logger->notice(__METHOD__." Cannot kill process {$pid}, $output");
70 70
                 }
71 71
             } else {
72 72
                 //@todo
Please login to merge, or discard this patch.
src/PjbServer/Tools/System/Process.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
                 $process = new Linux\LinuxProcess($logger);
52 52
                 break;
53 53
             default:
54
-                $msg = "System style '" . (string) $style . "' is not supported";
54
+                $msg = "System style '".(string) $style."' is not supported";
55 55
                 throw new UnsupportedSystemException($msg);
56 56
         }
57 57
         return $process;
Please login to merge, or discard this patch.
src/PjbServer/Tools/System/ProcessInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
      * @param bool $wait
17 17
      * @return void
18 18
      */
19
-    public function kill($pid, $wait=false);
19
+    public function kill($pid, $wait = false);
20 20
 
21 21
     /**
22 22
      * Check whether a pid is running
Please login to merge, or discard this patch.
src/PjbServer/Tools/StandaloneServer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      * @param LoggerInterface $logger
69 69
      *
70 70
      */
71
-    public function __construct(StandaloneServer\Config $config, LoggerInterface $logger=null)
71
+    public function __construct(StandaloneServer\Config $config, LoggerInterface $logger = null)
72 72
     {
73 73
         $this->config = $config;
74 74
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
      * @param boolean $clearPidFileOnException clear th pid file if the server was not running
176 176
      * @return void
177 177
      */
178
-    public function stop($throwException=false, $clearPidFileOnException=false)
178
+    public function stop($throwException = false, $clearPidFileOnException = false)
179 179
     {
180 180
         $this->logger->notice("Stopping server");
181 181
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
      * @param boolean $test_is_running
245 245
      * @return boolean
246 246
      */
247
-    public function isStarted($test_is_running=true)
247
+    public function isStarted($test_is_running = true)
248 248
     {
249 249
         // In case of previous run, let's us
250 250
         if (!$this->started && $test_is_running) {
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
         $classpath = implode(':', $jars);
284 284
         $threads = $this->config->getThreads();
285 285
 
286
-        $directives = ' -D' . implode(' -D', [
286
+        $directives = ' -D'.implode(' -D', [
287 287
                     'php.java.bridge.daemon="false"',
288 288
                     "php.java.bridge.threads=$threads"
289 289
         ]);
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
      * @param boolean $throwsException if false discard exception if pidfile not exists
350 350
      * @return boolean
351 351
      */
352
-    public function isProcessRunning($throwsException=false)
352
+    public function isProcessRunning($throwsException = false)
353 353
     {
354 354
         $running = false;
355 355
         try {
Please login to merge, or discard this patch.