Skip to content

Commit

Permalink
Not using a custom method from L11
Browse files Browse the repository at this point in the history
  • Loading branch information
luisdalmolin committed Oct 29, 2024
1 parent b6a1471 commit d8e021e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Commands/GenerateEnumsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@ public function handle(): int
*/
protected function enums(): Collection
{
return DiscoverEnums::within(app_path(config()->string('paragon.enums.paths.php')))
return DiscoverEnums::within(app_path((string) config('paragon.enums.paths.php')))

Check failure on line 50 in src/Commands/GenerateEnumsCommand.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Cannot cast mixed to string.
->reject(function ($enum) {
if (! enum_exists($enum)) {
return true;
}

$reflector = new ReflectionEnum($enum);

$paths = Arr::map(
$pathsToIgnore = Arr::map(
Arr::wrap(config('paragon.enums.paths.ignore')),
fn (string $path): string => Str::finish(app_path($path), '/'),
);

return $reflector->getAttributes(IgnoreParagon::class)
|| Str::startsWith((string) $reflector->getFileName(), $paths);
|| Str::startsWith((string) $reflector->getFileName(), $pathsToIgnore);
})
->values();
}
Expand Down

0 comments on commit d8e021e

Please sign in to comment.