Skip to content

Conversation

@binaryfire
Copy link
Contributor

Note: This bug was found by PHPStan at level 5

When pathsToPublish() is called with no arguments, it should return all published paths from all providers. Instead, it was returning an empty array.

The bug: pathsForProviderOrGroup() always returned [] at the end, even when no filter was specified. The calling code checks for null to determine whether to fall back to returning all paths.

The fix: Return null when no filter is specified (both $provider and $group are null), and return [] only when a filter was specified but not found. This matches Laravel's behavior.

Added tests for:

  • pathsToPublish() with no args returns all paths
  • pathsToPublish() with non-existent provider returns []
  • pathsToPublish() with non-existent group returns []

When pathsToPublish() is called with no arguments, it should return
all published paths from all providers. Instead, it was returning an
empty array.

The bug: pathsForProviderOrGroup() always returned [] at the end,
even when no filter was specified. The calling code checks for null
to determine whether to fall back to returning all paths.

The fix: Return null when no filter is specified (both $provider and
$group are null), and return [] only when a filter was specified but
not found. This matches Laravel's behavior.

Added tests for:
- pathsToPublish() with no args returns all paths
- pathsToPublish() with non-existent provider returns []
- pathsToPublish() with non-existent group returns []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant