dev-master
9999999-devUtility for navigating to related source files
MIT
The Requires
The Development Requires
by Daniel Leech
Utility for navigating to related source files
, (*1)
Library to infer paths from a given path where paths share path segments., (*2)
For example, infer test paths for a given source file and vice-versa., (*3)
Path finder accepts a hash map of destinations and their schemas. The placeholders can be used to identify common parts of the path., (*4)
$pathFinder = PathFinder::fromDestinations([ 'source' => 'lib/<kernel>.php', 'unit_test' => 'tests/Unit/<kernel>Test.php', 'benchmark' => 'benchmarks/<kernel>Bench.php', ]); $targets = $pathFinder->targetsFor('lib/Acme/Post.php'); // [ // 'unit_test' => 'tests/Unit/Acme/PostTest.php', // 'benchmark' => 'benchmarks/Acme/PostBench.php', // ]
$pathFinder = PathFinder::fromDestinations([ 'source' => 'lib/<module>/<kernel>.php', 'unit_test' => 'tests/<module>/Unit/<kernel>Test.php', 'benchmark' => 'benchmarks/<module>/<kernel>Bench.php', ]); $targets = $pathFinder->targetsFor('lib/MyModule/Acme/Post.php'); // [ // 'unit_test' => 'tests/MyModule/Unit/Acme/PostTest.php', // 'benchmark' => 'benchmarks/MyModule/Acme/PostBench.php', // ]
This package is open source and welcomes contributions! Feel free to open a pull request on this repository., (*5)
#phpactor
channel on the Slack Symfony Devs channel.Utility for navigating to related source files
MIT