Skip to content

Commit

Permalink
refactor: change self to static (cacheable) (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
SonyPradana authored Jun 21, 2024
1 parent 9d399d4 commit 9a04699
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/System/Integrate/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

/**
Expand All @@ -132,14 +132,14 @@ public static function export(array $path, string $tag = ''): void
*/
public static function getModules(): array
{
return self::$modules;
return static::$modules;
}

/**
* Flush shared modules.
*/
public static function flushModule(): void
{
self::$modules = [];
static::$modules = [];
}
}

0 comments on commit 9a04699

Please sign in to comment.