2017 © Pedro Peláez
 

library annotation

注释拓展

image

joking/annotation

注释拓展

  • Friday, August 4, 2017
  • by CloverWeb
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

annotation

拓展PHP注释,在注释上可以使用更多的@标签,并且可以比较简单的读取这些@标签, (*1)

例如:, (*2)

在使用之前需要先创建一个标签类, (*3)

class ContainerLabel {
    public $value;
    public $param;

    public function __construct($value , $param) {
        $this->value = $value;
        $this->param = $param;
    }
}

然后开始注册, (*4)

Annotation::register("标签的名字 Container" , "标签的实体类 ContainerLabel::class");



/**
 * @Container('className' , param="lalala")
 */
 class Name {

 }

然后你可以这样读读取它, (*5)

$reflectionClass = new ReflectionClass(Name::class);
$reflectionAnnotationClass = new ReflectionAnnotationClass($reflectionClass);
$label = $reflectionAnnotationClass->getAnnotation("Container")

echo $label->param;

输出 lalala

还有更多功能有待开发,等等我想睡觉, (*6)

The Versions

04/08 2017

dev-master

9999999-dev

注释拓展

  Sources   Download

joking

The Requires

  • php >=7.1

 

by joking

29/07 2017

v1.0.x-dev

1.0.9999999.9999999-dev

注释拓展

  Sources   Download

joking

The Requires

  • php >=5.6

 

by joking

29/07 2017

v1.0

1.0.0.0

注释拓展

  Sources   Download

joking

The Requires

  • php >=5.6

 

by joking