Completed
Push — cleanup ( 4198cf )
by Akihito
02:04
created
src/AppMetaModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     protected function configure() : void
29 29
     {
30 30
         $this->bind(AbstractAppMeta::class)->toInstance($this->appMeta);
31
-        $this->bind(AppInterface::class)->to($this->appMeta->name . '\Module\App');
31
+        $this->bind(AppInterface::class)->to($this->appMeta->name.'\Module\App');
32 32
         $this->bind()->annotatedWith(AppName::class)->toInstance($this->appMeta->name);
33 33
     }
34 34
 }
Please login to merge, or discard this patch.
src/Compiler.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -44,20 +44,20 @@  discard block
 block discarded – undo
44 44
         $autoload = $this->compileAutoload($appName, $context, $appDir);
45 45
         $preload = $this->compilePreload($appDir);
46 46
         $log = $this->compileDiScripts($appName, $context, $appDir);
47
-        $this->ns = (string) filemtime(realpath($appDir) . '/src');
47
+        $this->ns = (string) filemtime(realpath($appDir).'/src');
48 48
 
49 49
         return sprintf("Compile Log: %s\nautoload.php: %s\npreload.php: %s", $log, $autoload, $preload);
50 50
     }
51 51
 
52 52
     public function registerLoader(string $appDir) : void
53 53
     {
54
-        $loaderFile = $appDir . '/vendor/autoload.php';
55
-        if (! file_exists($loaderFile)) {
54
+        $loaderFile = $appDir.'/vendor/autoload.php';
55
+        if (!file_exists($loaderFile)) {
56 56
             throw new \RuntimeException('no loader');
57 57
         }
58 58
         $loaderFile = require $loaderFile;
59 59
         spl_autoload_register(
60
-            function ($class) use ($loaderFile) : void {
60
+            function($class) use ($loaderFile) : void {
61 61
                 $loaderFile->loadClass($class);
62 62
                 if ($class !== NullPage::class) {
63 63
                     $this->classes[] = $class;
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         foreach ($appMeta->getResourceListGenerator() as [$className]) {
86 86
             $this->scanClass($injector, $reader, $namedParams, (string) $className);
87 87
         }
88
-        $logFile = realpath($appMeta->logDir) . '/compile.log';
88
+        $logFile = realpath($appMeta->logDir).'/compile.log';
89 89
         $this->saveCompileLog($appMeta, $context, $logFile);
90 90
 
91 91
         return $logFile;
@@ -101,15 +101,15 @@  discard block
 block discarded – undo
101 101
 
102 102
     private function dumpAutoload(string $appDir, array $paths) : string
103 103
     {
104
-        $autoloadFile = '<?php' . PHP_EOL;
104
+        $autoloadFile = '<?php'.PHP_EOL;
105 105
         foreach ($paths as $path) {
106 106
             $autoloadFile .= sprintf(
107 107
                 "require %s';\n",
108 108
                 $this->getRelativePath($appDir, $path)
109 109
             );
110 110
         }
111
-        $autoloadFile .= "require __DIR__ . '/vendor/autoload.php';" . PHP_EOL;
112
-        $loaderFile = realpath($appDir) . '/autoload.php';
111
+        $autoloadFile .= "require __DIR__ . '/vendor/autoload.php';".PHP_EOL;
112
+        $loaderFile = realpath($appDir).'/autoload.php';
113 113
         file_put_contents($loaderFile, $autoloadFile);
114 114
 
115 115
         return $loaderFile;
@@ -118,15 +118,15 @@  discard block
 block discarded – undo
118 118
     private function compilePreload(string $appDir) : string
119 119
     {
120 120
         $paths = $this->getPaths($this->classes, $appDir);
121
-        $output = '<?php' . PHP_EOL;
122
-        $output .= "opcache_compile_file(__DIR__ . '/vendor/autoload.php');" . PHP_EOL;
121
+        $output = '<?php'.PHP_EOL;
122
+        $output .= "opcache_compile_file(__DIR__ . '/vendor/autoload.php');".PHP_EOL;
123 123
         foreach ($paths as $path) {
124 124
             $output .= sprintf(
125 125
                 "opcache_compile_file(%s');\n",
126 126
                 $this->getRelativePath($appDir, $path)
127 127
             );
128 128
         }
129
-        $preloadFile = realpath($appDir) . '/preload.php';
129
+        $preloadFile = realpath($appDir).'/preload.php';
130 130
         file_put_contents($preloadFile, $output);
131 131
 
132 132
         return $preloadFile;
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
     {
137 137
         $dir = (string) realpath($rootDir);
138 138
         if (strpos($file, $dir) !== false) {
139
-            return (string) preg_replace('#^' . preg_quote($dir, '#') . '#', "__DIR__ . '", $file);
139
+            return (string) preg_replace('#^'.preg_quote($dir, '#').'#', "__DIR__ . '", $file);
140 140
         }
141 141
 
142 142
         return $file;
@@ -182,11 +182,11 @@  discard block
 block discarded – undo
182 182
     private function saveNamedParam(NamedParameterInterface $namedParameter, $instance, string $method) : void
183 183
     {
184 184
         // named parameter
185
-        if (! \in_array($method, ['onGet', 'onPost', 'onPut', 'onPatch', 'onDelete', 'onHead'], true)) {
185
+        if (!\in_array($method, ['onGet', 'onPost', 'onPut', 'onPatch', 'onDelete', 'onHead'], true)) {
186 186
             return;
187 187
         }
188 188
         $callable = [$instance, $method];
189
-        if (! is_callable($callable)) {
189
+        if (!is_callable($callable)) {
190 190
             return;
191 191
         }
192 192
         try {
@@ -212,12 +212,12 @@  discard block
 block discarded – undo
212 212
         $paths = [];
213 213
         foreach ($classes as $class) {
214 214
             // could be phpdoc tag by annotation loader
215
-            $isAutoloadFailed = ! class_exists($class, false) && ! interface_exists($class, false) && ! trait_exists($class, false);
215
+            $isAutoloadFailed = !class_exists($class, false) && !interface_exists($class, false) && !trait_exists($class, false);
216 216
             if ($isAutoloadFailed) {
217 217
                 continue;
218 218
             }
219 219
             $filePath = (string) (new ReflectionClass($class))->getFileName();
220
-            if (! file_exists($filePath) || strpos($filePath, 'phar') === 0) {
220
+            if (!file_exists($filePath) || strpos($filePath, 'phar') === 0) {
221 221
                 continue;
222 222
             }
223 223
             $paths[] = $this->getRelativePath($appDir, $filePath);
Please login to merge, or discard this patch.