定制 synga/inheritance-finder 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

synga/inheritance-finder

Composer 安装命令:

composer require synga/inheritance-finder

包简介

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

README 文档

README

This package can find classes which are extended, implemented or is using a certain trait. It builds a cache and uses it to find the desired files.

##Usage

$config = new \Synga\InheritanceFinder\File\FileConfig();
$config->setApplicationRoot(__DIR__);
$config->setCacheDirectory(__DIR__);

$inheritanceFinder = Synga\InheritanceFinder\InheritanceFinderFactory::getInheritanceFinder($config);
$inheritanceFinder->findExtends('SomeNamespace\OtherNamespacePath\Class');

It will now find all classes which inherit from class SomeNamespace\OtherNamespacePath\Class whithin your ApplicationRoot directory

##Possible options:

  • findClass('full qualified namespace') - Can locate a file with the given namespace in the given directory
  • findExtends('full qualified namespace') - Can locate multiple classes which inherit from the given class in the given directory
  • findImplements('full qualified namespace') - Can locate multiple classes which implement or inherit from the given interface in the given directory
  • findTraitUse('full qualified namespace') - Can locate multiple classes which uses the given trait in the given directory
  • findMultiple('Classes [string or array of strings]', 'Interfaces [string or array of strings]', 'Traits [string or array of strings]') - Can locate multiple classes at once, it uses the methods discribed above.

##Acknowledgements:

  • Right now this package cannot handle multiple classes in one file. I will try to fix this in the near future.
  • The first run will be slow, because it is indexing all the files in your project root. I'm thinking off a manner to make it faster. I am planning of using react php for this so we can use multiple processes.
  • Don't use this code in production (you can use it FOR production, to build a cache of files). The performance results are strongly depending your hardware.

统计信息

  • 总下载量: 865
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-01-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固