backendtea/dependency-finder

找出确切哪些类依赖于其他哪些类

0.0.2 2019-08-10 20:56 UTC

This package is auto-updated.

Last update: 2024-09-11 19:59:28 UTC


README

这是什么

这个库允许你查找PHP文件的依赖。

它被创建用来帮助另一个库,这个库允许你只对更改的文件(及其依赖)运行测试

使用方法

<?php
require_once __DIR__.'/vendor/autoload.php';

use Depend\DependencyFinder;


$finder = new DependencyFinder([__DIR__.'/src/',  './vendor/psr/container/src', __DIR__.'/tests']);

$finder->build();

$deps = $finder->getAllFilesDependingOn(['./tests/Fixtures/Circular/A.php']);

foreach ($deps as $dep) {
    var_dump($dep);
}

$finder->reBuild(['./src/Domain/User.php', './tests/Domain/User.php', './src/functions.php']);