Completed
Push — fix-compile ( af21ca...556ec5 )
by Akihito
06:25
created
src/Compiler.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         foreach ($appMeta->getResourceListGenerator() as list($className)) {
60 60
             $this->scanClass($injector, $reader, $namedParams, $className);
61 61
         }
62
-        $logFile = realpath($appMeta->logDir . '/compile.log');
62
+        $logFile = realpath($appMeta->logDir.'/compile.log');
63 63
         $this->saveCompileLog($appMeta, $context, $logFile);
64 64
 
65 65
         return $logFile;
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 
68 68
     private function compileLoader(string $appName, string $context, string $appDir) : string
69 69
     {
70
-        $loaderFile = $appDir . '/vendor/autoload.php';
71
-        if (! file_exists($loaderFile)) {
70
+        $loaderFile = $appDir.'/vendor/autoload.php';
71
+        if (!file_exists($loaderFile)) {
72 72
             return '';
73 73
         }
74 74
         $loaderFile = require $loaderFile;
75 75
         spl_autoload_register(
76
-            function ($class) use ($loaderFile) {
76
+            function($class) use ($loaderFile) {
77 77
                 $loaderFile->loadClass($class);
78 78
                 if ($class !== NullPage::class) {
79 79
                     $this->classes[] = $class;
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
         );
85 85
 
86 86
         $this->invokeTypicalReuqest($appName, $context);
87
-        $fies = '<?php' . PHP_EOL;
87
+        $fies = '<?php'.PHP_EOL;
88 88
         foreach ($this->classes as $class) {
89
-            $isAutoloadFailed = ! class_exists($class, false) && ! interface_exists($class, false) && ! trait_exists($class, false); // could be phpdoc tag by anotation loader
89
+            $isAutoloadFailed = !class_exists($class, false) && !interface_exists($class, false) && !trait_exists($class, false); // could be phpdoc tag by anotation loader
90 90
             if ($isAutoloadFailed) {
91 91
                 continue;
92 92
             }
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
                 $this->getRelaticePath($appDir, (new \ReflectionClass($class))->getFileName())
96 96
             );
97 97
         }
98
-        $fies .= "require __DIR__ . '/vendor/autoload.php';" . PHP_EOL . PHP_EOL;
99
-        $loaderFile = realpath($appDir . '/autoload.php');
98
+        $fies .= "require __DIR__ . '/vendor/autoload.php';".PHP_EOL.PHP_EOL;
99
+        $loaderFile = realpath($appDir.'/autoload.php');
100 100
         file_put_contents($loaderFile, $fies);
101 101
 
102 102
         return $loaderFile;
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             return str_replace("{$rootDir}", "__DIR__ . '", $file);
109 109
         }
110 110
 
111
-        return "'" . $file;
111
+        return "'".$file;
112 112
     }
113 113
 
114 114
     private function invokeTypicalReuqest(string $appName, string $context)
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     private function saveNamedParam(NamedParameterInterface $namedParameter, $instance, string $method)
151 151
     {
152 152
         // named parameter
153
-        if (! \in_array($method, ['onGet', 'onPost', 'onPut', 'onPatch', 'onDelete', 'onHead'], true)) {
153
+        if (!\in_array($method, ['onGet', 'onPost', 'onPut', 'onPatch', 'onDelete', 'onHead'], true)) {
154 154
             return;
155 155
         }
156 156
         try {
Please login to merge, or discard this patch.