2017 © Pedro Peláez
 

library annotation

Rudra framework

image

rudra/annotation

Rudra framework

  • Friday, June 22, 2018
  • by jagepard
  • Repository
  • 1 Watchers
  • 1 Stars
  • 64 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 113 % Grown

The README.md

PHPunit Scrutinizer Code Quality Maintainability CodeFactor, (*1)

GitHub

Annotations and attributes reader / Читатель аннотаций и атрибутов | API

Installation / Установка

composer require rudra/annotation, (*2)

Using / Использование

$annotation = new Annotation();
An example of reading annotations / Пример чтения аннотаций
$annotation->getAnnotations(PageController::class);
$annotation->getAnnotations(PageController::class, "indexAction");

```php /** * @Routing(url = '') * @Defaults(name = 'user1', lastname = 'sample', age='0', address = {country : 'Russia'; state : 'Tambov'}, phone = '000-00000000') * @assertResult(false) * @Validate(name = 'min:150', phone = 'max:9') * @Middleware('Middleware', params = {int1 : '123'}) */ class PageController { /** * @Routing(url = '') * @Defaults(name = 'user1', lastname = 'sample', age='0', address = {country : 'Russia'; state : 'Tambov'}, phone = '000-00000000') * @assertResult(false) * @Validate(name = 'min:150', phone = 'max:9') * @Middleware('Middleware', params = {int1 : '123'}) */ public function indexAction() { // Your code }
}, (*3)

##### An example of reading attributes / Пример чтения атрибутов
```php
$annotation->getAttributes(PageController::class);
$annotation->getAttributes(PageController::class, "indexAction");

```php, (*4)

[Routing(url:'')]

[Defaults(name:'user1', lastname:'sample', age:'0', address:['country' => 'Russia', 'state' => 'Tambov'], phone:'000-00000000')]

[assertResult(false)]

[Validate(name:'min:150', phone:'max:9')]

[Middleware('Middleware', params:['int1' => '123'])]

class PageController { #[Routing(url:'')] #[Defaults(name:'user1', lastname:'sample', age:'0', address:['country' => 'Russia', 'state' => 'Tambov'], phone:'000-00000000')] #[assertResult(false)] #[Validate(name:'min:150', phone:'max:9')] #[Middleware('Middleware', params:['int1' => '123'])] public function indexAction() { // Your code }
}, (*5)

##### Result in both cases / Результат чтения в обоих случаях:
```php
[
    'Routing' => [['url' => ""]],
    'Defaults' => [
        [
            'name' => "user1",
            'lastname' => "sample",
            'age' => "0",
            'address' => [
                'country' => "Russia",
                'state' => "Tambov",
            ],
            'phone' => "000-00000000",
        ],
    ],
    'assertResult' => [["false"]],
    'Validate' => [
        [
            'name' => "min:150",
            'phone' => "max:9",
        ],
    ],
    'Middleware' => [
        [
            0 => "'Middleware'",
            'params' => [
                'int1' => '123',
            ],
        ],
    ],
];

The Versions

22/06 2018

dev-master

9999999-dev

Rudra framework

  Sources   Download

GPL-3.0-or-later

The Requires

 

The Development Requires

annotations annotation rudra annotation-processing

29/05 2018

v2.0.0

2.0.0.0

Rudra framework

  Sources   Download

GPL-3.0-or-later

The Requires

 

The Development Requires

annotations annotation rudra annotation-processing