Completed
Push — master ( ff022d...6193b5 )
by Joao
02:18
created
src/Daemonize.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -28,36 +28,36 @@  discard block
 block discarded – undo
28 28
         }
29 29
         $targetServicePath = $targetPathAvailable[$template];
30 30
 
31
-        $templatePath = __DIR__ . "/../template/linux-" . $template . "-service.tpl";
31
+        $templatePath = __DIR__."/../template/linux-".$template."-service.tpl";
32 32
 
33 33
         if (!file_exists($templatePath)) {
34 34
             throw new \Exception("Template '$templatePath' not found");
35 35
         }
36 36
 
37
-        $bootstrap = $curdir . '/' . $bootstrap;
37
+        $bootstrap = $curdir.'/'.$bootstrap;
38 38
         if (!file_exists($bootstrap) && $check) {
39 39
             throw new \Exception("Bootstrap '$bootstrap' not found");
40 40
         }
41 41
 
42
-        $autoload = realpath(__DIR__ . "/../vendor/autoload.php");
42
+        $autoload = realpath(__DIR__."/../vendor/autoload.php");
43 43
         if (!file_exists($autoload)) {
44
-            $autoload = realpath(__DIR__ . "/../../../autoload.php");
44
+            $autoload = realpath(__DIR__."/../../../autoload.php");
45 45
             if (!file_exists($autoload) && $check) {
46 46
                 throw new \Exception('Daemonize autoload not found. Did you run `composer dump-autload`?');
47 47
             }
48 48
         }
49 49
 
50 50
         if (!empty($consoleArgs)) {
51
-            for ($i=0; $i<count($consoleArgs); $i++) {
51
+            for ($i = 0; $i < count($consoleArgs); $i++) {
52 52
                 $consoleArgs[$i] = str_replace('"', '\\"', $consoleArgs[$i]);
53 53
             }
54
-            $consoleArgsPrepared = '[ "' . implode('", "', $consoleArgs) . '" ]';
54
+            $consoleArgsPrepared = '[ "'.implode('", "', $consoleArgs).'" ]';
55 55
         } else {
56 56
             $consoleArgsPrepared = "[ ]";
57 57
         }
58 58
 
59
-        $serviceTemplatePath = __DIR__ . "/../template/_service.php.tpl";
60
-        $daemonizeService = __DIR__ . "/../services/$svcName.php";
59
+        $serviceTemplatePath = __DIR__."/../template/_service.php.tpl";
60
+        $daemonizeService = __DIR__."/../services/$svcName.php";
61 61
         $phpPath = PHP_BINARY;
62 62
 
63 63
         $vars = [
@@ -82,16 +82,16 @@  discard block
 block discarded – undo
82 82
             require_once($vars['#BOOTSTRAP#']);
83 83
             $classParts = explode('::', str_replace("\\\\", "\\", $vars['#CLASS#']));
84 84
             if (!class_exists($classParts[0])) {
85
-                throw new \Exception('Could not find class ' . $classParts[0]);
85
+                throw new \Exception('Could not find class '.$classParts[0]);
86 86
             }
87 87
             $className = $classParts[0];
88 88
             $classTest = new $className();
89 89
             if (!method_exists($classTest, $classParts[1])) {
90
-                throw new \Exception('Could not find method ' . $vars['#CLASS#']);
90
+                throw new \Exception('Could not find method '.$vars['#CLASS#']);
91 91
             }
92 92
         }
93 93
 
94
-        set_error_handler(function ($number, $error) {
94
+        set_error_handler(function($number, $error) {
95 95
             throw new \Exception($error);
96 96
         });
97 97
         file_put_contents($targetServicePath, $templateStr);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
     protected static function isDaemonizeService($filename)
140 140
     {
141
-        set_error_handler(function ($number, $error) {
141
+        set_error_handler(function($number, $error) {
142 142
             throw new \Exception($error);
143 143
         });
144 144
 
Please login to merge, or discard this patch.