@@ -30,10 +30,10 @@ |
||
| 30 | 30 | |
| 31 | 31 | public function newApp(AbstractAppMeta $appMeta, string $contexts, Cache $cache = null) : AbstractApp |
| 32 | 32 | { |
| 33 | - $cacheNs = filemtime($appMeta->appDir . '/src'); |
|
| 33 | + $cacheNs = filemtime($appMeta->appDir.'/src'); |
|
| 34 | 34 | $injector = new AppInjector($appMeta->name, $contexts, $appMeta, $cacheNs); |
| 35 | 35 | $cache = $cache instanceof Cache ? $cache : $injector->getCachedInstance(Cache::class); |
| 36 | - $appId = $appMeta->name . $contexts . $cacheNs; |
|
| 36 | + $appId = $appMeta->name.$contexts.$cacheNs; |
|
| 37 | 37 | $app = $cache->fetch($appId); |
| 38 | 38 | if ($app instanceof AbstractApp) { |
| 39 | 39 | return $app; |
@@ -54,17 +54,17 @@ discard block |
||
| 54 | 54 | $this->context = $context; |
| 55 | 55 | $this->appMeta = $appMeta instanceof AbstractAppMeta ? $appMeta : new Meta($name, $context); |
| 56 | 56 | $this->cacheSpace = $cacheSpace; |
| 57 | - $scriptDir = $this->appMeta->tmpDir . '/di'; |
|
| 58 | - ! \file_exists($scriptDir) && \mkdir($scriptDir); |
|
| 57 | + $scriptDir = $this->appMeta->tmpDir.'/di'; |
|
| 58 | + !\file_exists($scriptDir) && \mkdir($scriptDir); |
|
| 59 | 59 | $this->scriptDir = $scriptDir; |
| 60 | - $appDir = $this->appMeta->tmpDir . '/app'; |
|
| 61 | - ! \file_exists($appDir) && \mkdir($appDir); |
|
| 62 | - touch($appDir . '/.do_not_clear'); |
|
| 60 | + $appDir = $this->appMeta->tmpDir.'/app'; |
|
| 61 | + !\file_exists($appDir) && \mkdir($appDir); |
|
| 62 | + touch($appDir.'/.do_not_clear'); |
|
| 63 | 63 | $this->appDir = $appDir; |
| 64 | - $this->injector = new ScriptInjector($this->scriptDir, function () { |
|
| 64 | + $this->injector = new ScriptInjector($this->scriptDir, function() { |
|
| 65 | 65 | return $this->getModule(); |
| 66 | 66 | }); |
| 67 | - if (! $cacheSpace) { |
|
| 67 | + if (!$cacheSpace) { |
|
| 68 | 68 | $this->clear(); |
| 69 | 69 | } |
| 70 | 70 | } |
@@ -90,16 +90,16 @@ discard block |
||
| 90 | 90 | if ((new Unlink)->once($this->appMeta->tmpDir)) { |
| 91 | 91 | return; |
| 92 | 92 | } |
| 93 | - ! is_dir($this->appMeta->tmpDir . '/di') && \mkdir($this->appMeta->tmpDir . '/di'); |
|
| 94 | - file_put_contents($this->scriptDir . ScriptInjector::MODULE, serialize($this->getModule())); |
|
| 93 | + !is_dir($this->appMeta->tmpDir.'/di') && \mkdir($this->appMeta->tmpDir.'/di'); |
|
| 94 | + file_put_contents($this->scriptDir.ScriptInjector::MODULE, serialize($this->getModule())); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | public function getCachedInstance($interface, $name = Name::ANY) |
| 98 | 98 | { |
| 99 | - $lockFile = $this->appMeta->appDir . '/composer.lock'; |
|
| 99 | + $lockFile = $this->appMeta->appDir.'/composer.lock'; |
|
| 100 | 100 | $this->cacheSpace .= file_exists($lockFile) ? (string) filemtime($lockFile) : ''; |
| 101 | 101 | $cache = new FilesystemCache($this->appDir); |
| 102 | - $id = $interface . $name . $this->context . $this->cacheSpace; |
|
| 102 | + $id = $interface.$name.$this->context.$this->cacheSpace; |
|
| 103 | 103 | $instance = $cache->fetch($id); |
| 104 | 104 | if ($instance) { |
| 105 | 105 | return $instance; |