2017 © Pedro Peláez
 

library cable-annotations

Annotations library for cable framework

image

cable/cable-annotations

Annotations library for cable framework

  • Tuesday, June 27, 2017
  • by anonymframework
  • Repository
  • 1 Watchers
  • 1 Stars
  • 56 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

Annonations

PHP Annonations library for cable framework, (*1)

Requirements

PHP 5.6+, (*2)

Installation


composer require cable/cable-annotations

use Cable\Annotation\Factory; $annotation = Factory::create();

Add a Command

/**
 *
 * @Name("Test") the name of command
 *
 */
class TestCommand extends Command{


     /**
      *
      * @Annotation() // you must add this 
      *                // if you want to use that property
      *
      * @Required() // if this parameter not given by user, 
      *              //will be thrown a exception
      *
      * @Default('Default value'); // default value of property
      *                             // if you set this, required exception will be never thrown
      *                             // so there is no point of using together Default and Required
      */                            
     public $name;

}


$annotation->addCommand(new TestCommand());

Using Command



class Test{ /** * * @Test(name = "test name") * * */ public function testing(){ } } // execute the class instance $class = $annotation->executeClass(new Test()); $methods = $annotation->methods(); // $annotation->get('methods') // same as above // $methods->get('Test'); foreach($methods->Test() as $test){ echo $test->name; // test name will be printed }

Using Paramaters

Giving Arrays


/** * * @Test(datas={test: "test"}) * * will be given as ["test" = "test"] * */

giving annotation into data


/** * * @Test(data= @Test(name = "data")) * * * // you can give @Test into data */

Saving Container

You can give any psr-11 container into annotation, (*3)


Annotation::setContainer($container); `` ```php /** * * @Test(data= aliasname{test:"test"}) * * * // you must save aliasname into the container */

The Versions

27/06 2017

dev-master

9999999-dev

Annotations library for cable framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Vahit

27/06 2017

1.0.9

1.0.9.0

Annotations library for cable framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Vahit

26/06 2017

1.0.8

1.0.8.0

Annotations library for cable framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Vahit

26/06 2017

1.0.7

1.0.7.0

Annotations library for cable framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Vahit

26/06 2017

1.0.6

1.0.6.0

Annotations library for cable framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Vahit

26/06 2017

1.0.5

1.0.5.0

Annotations library for cable framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Vahit

26/06 2017

1.0.4

1.0.4.0

Annotations library for cable framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Vahit

26/06 2017

1.0.3

1.0.3.0

Annotations library for cable framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Vahit

19/06 2017

1.0.2

1.0.2.0

Annotations library for cable framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Vahit

19/06 2017

1.0.1

1.0.1.0

Annotations library for cable framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Vahit

18/06 2017

1.0.0

1.0.0.0

Annotations library for cable framework

  Sources   Download

MIT

The Requires

 

by Vahit