2017 © Pedro Peláez
 

library annotations

image

glueapps/annotations

  • Friday, June 1, 2018
  • by andaniel05
  • Repository
  • 0 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Installation

$ composer require glueapps/annotations

Usage

<?php

use GlueApps\Annotations\Parser;

$text = '
@Annotation1
@Annotation2()
@Annotation3(attr1="val1", attr2="val2")
';

$annotations = (new Parser)->parse($text);
$annotation1 = $annotations[0];
$annotation2 = $annotations[1];
$annotation3 = $annotations[2];

$annotation1->getName(); // Annotation1
$annotation1->getAttributes(); // []

$annotation2->getName(); // Annotation2
$annotation2->getAttributes(); // []

$annotation3->getName(); // Annotation3
$annotation3->getAttributes(); // ['attr1' => 'val1', 'attr2' => 'val2']
$annotation3->getAttribute('attr1'); // val1

The Versions

01/06 2018

1.0.x-dev

1.0.9999999.9999999-dev

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Andy Daniel Navarro Taño
by GlueApps Community