Skip to content

Commit

Permalink
Merge branch '7.x' into 8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Dec 14, 2024
2 parents 6440dfa + 8fd4c8f commit 0177873
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 0 additions & 6 deletions src/Foundation/Console/PurgeSkeletonCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,10 @@ public function handle(Filesystem $filesystem, ConfigContract $config)

['files' => $files, 'directories' => $directories] = $config->getPurgeAttributes();

$workingPath = $this->laravel->basePath();

$environmentFile = Env::get('TESTBENCH_ENVIRONMENT_FILE_USING', '.env');

(new Actions\DeleteFiles(
filesystem: $filesystem,
workingPath: $workingPath,
))->handle(
Collection::make([
$environmentFile,
Expand All @@ -62,7 +59,6 @@ public function handle(Filesystem $filesystem, ConfigContract $config)

(new Actions\DeleteFiles(
filesystem: $filesystem,
workingPath: $workingPath,
))->handle(
LazyCollection::make(function () use ($filesystem) {
yield $this->laravel->databasePath('database.sqlite');
Expand All @@ -76,7 +72,6 @@ public function handle(Filesystem $filesystem, ConfigContract $config)
(new Actions\DeleteFiles(
filesystem: $filesystem,
components: $this->components,
workingPath: $workingPath,
))->handle(
LazyCollection::make($files)
->map(fn ($file) => $this->laravel->basePath($file))
Expand All @@ -88,7 +83,6 @@ public function handle(Filesystem $filesystem, ConfigContract $config)
(new Actions\DeleteDirectories(
filesystem: $filesystem,
components: $this->components,
workingPath: $workingPath,
))->handle(
Collection::make($directories)
->map(fn ($directory) => $this->laravel->basePath($directory))
Expand Down
8 changes: 6 additions & 2 deletions src/Workbench/Workbench.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,16 @@ public static function applicationUserModel(): ?string

/**
* Detect namespace by type.
*
* @param string $type
* @param bool $force
* @return string|null
*/
public static function detectNamespace(string $type): ?string
public static function detectNamespace(string $type, bool $force = false): ?string
{
$type = trim($type, '/');

if (! isset(static::$cachedNamespaces[$type])) {
if (! isset(static::$cachedNamespaces[$type]) || $force === true) {
static::$cachedNamespaces[$type] = null;

/** @var array{'autoload-dev': array{'psr-4': array<string, array<int, string>|string>}} $composer */
Expand Down

0 comments on commit 0177873

Please sign in to comment.