saxulum/saxulum-annotation-manager 问题修复 & 功能扩展

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

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

saxulum/saxulum-annotation-manager

最新稳定版本:1.2.0

Composer 安装命令:

composer require saxulum/saxulum-annotation-manager

包简介

Saxulum Annotation Manager

README 文档

README

works with plain silex-php

Build Status Total Downloads Latest Stable Version Scrutinizer Code Quality

Features

  • An annotation manager

Requirements

  • php >=5.3
  • Doctrine Annotations >=1.1
  • Saxulum ClassFinder >=1.0
  • Symfony Finder Component >=2.3

Installation

Through Composer as saxulum/saxulum-annotation-manager.

AnnotationRegistry

Add this line after you added the autoload.php from composer

\Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(
    array($loader, 'loadClass')
);

Usage

Prepare the annotation Manager

use Doctrine\Common\Annotations\AnnotationReader;
use Saxulum\AnnotationManager\Manager\AnnotationManager;

$annotationReader = new AnnotationReader();
$annotationManager = new AnnotationManager($annotationReader);

ClassInfo based on paths

This will search each instantiable class within the given paths and return em as an array of Saxulum\AnnotationManager\Helper\ClassInfo instances.

$classInfos = $annotationManager->buildClassInfosBasedOnPaths(array(
    dirname(__DIR__) . '/Classes1',
    dirname(__DIR__) . '/Classes2'
));

ClassInfo based on path

This will search each instantiable class within the given path and return em as an array of Saxulum\AnnotationManager\Helper\ClassInfo instances.

$classInfos = $annotationManager->buildClassInfosBasedOnPath(
    dirname(__DIR__) . '/Classes1'
);

ClassInfo based on reflection classes

This will return an array of Saxulum\AnnotationManager\Helper\ClassInfo instances based on the given ReflectionClasses.

$classInfos = $annotationManager->buildClassInfos(array(
    new \ReflectionClass(new TestClass1()),
    new \ReflectionClass(new TestClass2())
));

ClassInfo based on reflection class

This will return an instance of Saxulum\AnnotationManager\Helper\ClassInfo based on the given ReflectionClass.

$classInfo = $annotationManager->buildClassInfo(
    new \ReflectionClass(new TestClass1())
);

ReflectionClasses based on path

This will search each instantiable class within the given path and return em as an array of \ReflectionClass instances.

$reflectionClasses = AnnotationManager::getReflectionClasses(
    dirname(__DIR__) . '/Classes1'
);

Classes based on SplFileInfo

This will search each class within the given file and return em as an array of class names.

$classes = AnnotationManager::findClassesWithinAFile(
    new SplFileInfo(
        dirname(__DIR__) . '/Classes1/TestClass1.php',
        '',
        'TestClass1.php'
    )
);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-03-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固