Skip to content

Commit

Permalink
✨ New PSR4PathsTrait
Browse files Browse the repository at this point in the history
This commit introduces a new `PSR4PathsTrait` to add a custom `$psr4_paths` property to sniffs.

The value expected by the `$psr4_paths` property mirrors the `autoload` directive for Composer, with the prefix as the array key and a comma separated list of relative paths as the array value.
Multiple PSR-4 paths can be passed (array elements).

Includes utility functions to validate the property value, to verify if an arbitrary file is in one of the PSR4 paths and to retrieve the matched PSR-4 path information.

Includes dedicated unit tests for this trait.
  • Loading branch information
jrfnl committed Nov 20, 2023
1 parent 9d4841e commit 0fa3146
Show file tree
Hide file tree
Showing 2 changed files with 718 additions and 0 deletions.
Loading

0 comments on commit 0fa3146

Please sign in to comment.