From 9a04699581d8c50eda6839cd1e778147f5ec8f4d Mon Sep 17 00:00:00 2001 From: Angger Pradana Date: Fri, 21 Jun 2024 07:09:14 +0700 Subject: [PATCH] refactor: change self to static (cacheable) (#350) --- src/System/Integrate/ServiceProvider.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/System/Integrate/ServiceProvider.php b/src/System/Integrate/ServiceProvider.php index c1de149d..13779d16 100644 --- a/src/System/Integrate/ServiceProvider.php +++ b/src/System/Integrate/ServiceProvider.php @@ -92,13 +92,13 @@ public static function importDir(string $from, string $to, bool $overwrite = fal $dst = $to . '/' . $file; if (is_dir($src)) { - if (false === self::importDir($src, $dst, $overwrite)) { + if (false === static::importDir($src, $dst, $overwrite)) { closedir($dir); return false; } } else { - if (false === self::importFile($src, $dst, $overwrite)) { + if (false === static::importFile($src, $dst, $overwrite)) { closedir($dir); return false; @@ -118,11 +118,11 @@ public static function importDir(string $from, string $to, bool $overwrite = fal */ public static function export(array $path, string $tag = ''): void { - if (false === array_key_exists($tag, self::$modules)) { - self::$modules[$tag] = []; + if (false === array_key_exists($tag, static::$modules)) { + static::$modules[$tag] = []; } - self::$modules[$tag] = array_merge(self::$modules[$tag], $path); + static::$modules[$tag] = array_merge(static::$modules[$tag], $path); } /** @@ -132,7 +132,7 @@ public static function export(array $path, string $tag = ''): void */ public static function getModules(): array { - return self::$modules; + return static::$modules; } /** @@ -140,6 +140,6 @@ public static function getModules(): array */ public static function flushModule(): void { - self::$modules = []; + static::$modules = []; } }