PHP code example of phpactor / path-finder

1. Go to this page and download the library: Download phpactor/path-finder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

phpactor / path-finder example snippets


$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',
// ]