From f9311c37fe8e5883b18625b734ee444d79bbf2a7 Mon Sep 17 00:00:00 2001 From: gwleuverink Date: Wed, 8 Jan 2025 14:26:06 +0100 Subject: [PATCH] use 8.1 compatible syntax --- src/Commands/BuildCommand.php | 27 +++++++++++++++++++++++++ src/Traits/CopiesToBuildDirectory.php | 29 +-------------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/Commands/BuildCommand.php b/src/Commands/BuildCommand.php index b1556d0..cde8c4d 100644 --- a/src/Commands/BuildCommand.php +++ b/src/Commands/BuildCommand.php @@ -36,6 +36,33 @@ protected function buildPath(): string return __DIR__.'/../../resources/js/resources/app'; } + const CLEANUP_PATTERNS = [ + // Skip .git and Dev directories + '.git', + 'docker', + 'packages', + + // Only needed for local testing + 'vendor/nativephp/electron/vendor', + 'vendor/nativephp/laravel/vendor', + + 'vendor/nativephp/php-bin', + 'vendor/nativephp/electron/bin', + 'vendor/nativephp/electron/resources', + 'node_modules', + 'dist', + + '**/.github', + + 'database/*.sqlite', + 'database/*.sqlite-shm', + 'database/*.sqlite-wal', + + 'storage/logs/*', + 'storage/views/*', + 'storage/sessions/*', + ]; + public function handle(): void { $this->setAppName(slugify: true); diff --git a/src/Traits/CopiesToBuildDirectory.php b/src/Traits/CopiesToBuildDirectory.php index 897965a..580a25c 100644 --- a/src/Traits/CopiesToBuildDirectory.php +++ b/src/Traits/CopiesToBuildDirectory.php @@ -13,33 +13,6 @@ trait CopiesToBuildDirectory { abstract protected function buildPath(): string; - const SKIP_PATTERNS = [ - // Skip .git and Dev directories - '.git', - 'docker', - 'packages', - - // Only needed for local testing - 'vendor/nativephp/electron/vendor', - 'vendor/nativephp/laravel/vendor', - - 'vendor/nativephp/php-bin', - 'vendor/nativephp/electron/bin', - 'vendor/nativephp/electron/resources', - 'node_modules', - 'dist', - - '**/.github', - - 'database/*.sqlite', - 'database/*.sqlite-shm', - 'database/*.sqlite-wal', - - 'storage/logs/*', - 'storage/views/*', - 'storage/sessions/*', - ]; - protected function copyToBuildDirectory() { intro('Copying App to build directory...'); @@ -55,7 +28,7 @@ protected function copyToBuildDirectory() $filter = new RecursiveCallbackFilterIterator($directory, function ($current) { $relativePath = substr($current->getPathname(), strlen(base_path()) + 1); - $patterns = config('nativephp.cleanup_exclude_files') + static::SKIP_PATTERNS; + $patterns = config('nativephp.cleanup_exclude_files') + static::CLEANUP_PATTERNS; // Check each skip pattern against the current file/directory foreach ($patterns as $pattern) {