PHPackages                             skrip42/strategy-bundle - 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. skrip42/strategy-bundle

ActiveSymfony-bundle[Framework](/categories/framework)

skrip42/strategy-bundle
=======================

strategy in symfony

v1.0.0(5y ago)128MITPHPPHP ^7.1

Since Dec 8Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Skrip42/strategyBundle)[ Packagist](https://packagist.org/packages/skrip42/strategy-bundle)[ Docs](https://github.com/Skrip42/strategyBundle)[ RSS](/packages/skrip42-strategy-bundle/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

strategy-bundle
===============

[](#strategy-bundle)

implement strategy and specification pattern in symfony

install:
--------

[](#install)

- run `composer require skrip42/strategy-bundle`

base usage:
-----------

[](#base-usage)

### strategy:

[](#strategy)

extends strategy manager:

```
namespace App\Services\Test;

use Skrip42\Bundle\StrategyBundle\StrategyManagerAbstract;

class TestStrategyManager extends StrategyManagerAbstract
{
}
```

implements strategy interface:

```
namespace App\Services\Test;

use Skrip42\Bundle\StrategyBundle\StrategyInterface;

abstract class TestStrategyAbstract implements StrategyInterface
{
    abstract public function doSomething();
}
```

create strategies:

```
namespace App\Services\Test;

class Strategy1 extends TestStrategyAbstract
{
    public function doSomething()
    {
        .....
    }
}

class Strategy2 extends TestStrategyAbstract
{
    public function doSomething()
    {
        .....
    }
}
```

define:

```
    App\Services\Test\TestStrategyManager:
        tags: [skrip42.strategy_manager]
        properties:
          strategy:
            strategy1: App\Services\Test\Strategy1
            strategy2: App\Services\Test\Strategy2
```

and call strategy by name!

```
public function test(TestStrategyManager $manager): Response
{
    $strategy = $manager->get('strategy1');
    $anotherStrategy = $manager->get('strategy2');
}
```

### specification:

[](#specification)

extends strategy manager:

```
namespace App\Services\Test;

use Skrip42\Bundle\StrategyBundle\StrategyManagerAbstract;

class TestSpecificationManager extends SpecificationManagerAbstract
{
}
```

implements strategy interface:

```
namespace App\Services\Test;

use Skrip42\Bundle\StrategyBundle\SpecificationInterface;

abstract class TestSpecificationAbstract implements SpecificationInterface
{
    abstract public function isStatisfiedBy($criteria) : bool;
    abstract public function doSomething();
}
```

create strategies:

```
namespace App\Services\Test;

class Specification1 extends TestSpecificationAbstract
{
    public function isStatisfiedBy($criteria) : bool
    {
        ...check condition
    }

    public function doSomething()
    {
        .....
    }
}

class Specification2 extends TestSpecificationAbstract
{
    public function isStatisfiedBy($criteria) : bool
    {
        ...check condition
    }

    public function doSomething()
    {
        .....
    }
}
```

define:

```
    App\Services\Test\TestSpecificationManager:
        tags: [skrip42.specification_manager]
        properties:
          specification:
            strategy1: App\Services\Test\Specification1
            strategy2: App\Services\Test\Specification2
```

and call specification!

```
public function test(TestSpecificationManager $manager): Response
{
    $specification = $manager->getFirst($condition); //get the first specification that meets the condition
    $specification = $manager->getAll($condition);   //get all specifications that meets the condition
}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1987d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ac2ab44421653cebc795140356530287c37ba8c2011790683db6d2b316ea0e8d?d=identicon)[skrip42](/maintainers/skrip42)

---

Top Contributors

[![Skrip42](https://avatars.githubusercontent.com/u/11675343?v=4)](https://github.com/Skrip42 "Skrip42 (2 commits)")

### Embed Badge

![Health badge](/badges/skrip42-strategy-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/skrip42-strategy-bundle/health.svg)](https://phpackages.com/packages/skrip42-strategy-bundle)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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