ssmiff/attribute-collector 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

ssmiff/attribute-collector

最新稳定版本:1.0.2

Composer 安装命令:

composer require ssmiff/attribute-collector

包简介

README 文档

README

Collect all public class/method/properties attributes into a single registry.

Usage

There are two built in memoizers, FileMemoizer and InMemoryMemoizer. These can optionally be used to cache the results of the discovery process.

Example:

use Ssmith\AttributeCollector\Cache\FileMemoizer;
use Ssmith\AttributeCollector\ComposerClassMap;
use Ssmith\AttributeCollector\Tests\fixtures\Attributes\TargetClass;

include __DIR__ . '/vendor/autoload.php';

$classMap = new ComposerClassMap([__DIR__ . '/tests/fixtures']);
$memoize = new InMemoryMemoizer();
$logger = new PrsLogger();
$discovery = new Ssmith\AttributeCollector\ClassAttributeCollector($classMap, $memoize, $logger);

$registry = $discovery->buildRegistry();

$allAttributesByName = $registry->forAttribute(MyAttribute::class);

$allAttributesOnClass = $registry->forClass(MyClass::class);
$allAttributesOnClassMethod = $registry->forMethod(MyClass::class, 'myMethod');
$allAttributesOnClassProperty = $registry->forProperty(MyClass::class, 'myProperty');
$distinctAttributes = $registry->count();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-02