PHPackages                             cable/cable-annotations - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. cable/cable-annotations

ActiveLibrary[Framework](/categories/framework)

cable/cable-annotations
=======================

Annotations library for cable framework

1.0.9(8y ago)11652MITPHP

Since Jun 18Pushed 8y ago1 watchersCompare

[ Source](https://github.com/CableFramework/Annonations)[ Packagist](https://packagist.org/packages/cable/cable-annotations)[ RSS](/packages/cable-cable-annotations/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (11)Used By (2)

Annonations
===========

[](#annonations)

PHP Annonations library for cable framework

Requirements
------------

[](#requirements)

PHP 5.6+

Installation
------------

[](#installation)

```
composer require cable/cable-annotations
```

```
use Cable\Annotation\Factory;

$annotation = Factory::create();
```

Add a Command
-------------

[](#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
-------------

[](#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
----------------

[](#using-paramaters)

### Giving Arrays

[](#giving-arrays)

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

### giving annotation into data

[](#giving-annotation-into-data)

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

#### Saving Container

[](#saving-container)

You can give any psr-11 container into annotation

```
Annotation::setContainer($container);

``

```php

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

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

10

Last Release

3244d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c3f1e53b43ef665cfe41f9c7fa30ca07d8c615020c30eeccdc4be0209a32bc3?d=identicon)[anonymframework](/maintainers/anonymframework)

---

Top Contributors

[![anonymframework](https://avatars.githubusercontent.com/u/13378594?v=4)](https://github.com/anonymframework "anonymframework (29 commits)")

### Embed Badge

![Health badge](/badges/cable-cable-annotations/health.svg)

```
[![Health](https://phpackages.com/badges/cable-cable-annotations/health.svg)](https://phpackages.com/packages/cable-cable-annotations)
```

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k18.5M1.6k](/packages/cakephp-cakephp)[silverstripe/framework

The SilverStripe framework

7213.5M2.5k](/packages/silverstripe-framework)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M343](/packages/drupal-core-recommended)[cakephp/core

CakePHP Framework Core classes

6026.8M39](/packages/cakephp-core)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
