PHPackages                             hshn/class-matcher-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. hshn/class-matcher-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

hshn/class-matcher-bundle
=========================

v0.1.0(11y ago)0543MITPHPPHP &gt;=5.4

Since Aug 6Pushed 11y ago1 watchersCompare

[ Source](https://github.com/hshn/HshnClassMatcherBundle)[ Packagist](https://packagist.org/packages/hshn/class-matcher-bundle)[ RSS](/packages/hshn-class-matcher-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (2)Used By (0)

HshnClassMatcherBundle
======================

[](#hshnclassmatcherbundle)

[![Build Status](https://camo.githubusercontent.com/62e1621c399fbf6a28613a9643e2e8443d4b5a1077b1f23f044164914c83adc3/68747470733a2f2f7472617669732d63692e6f72672f6873686e2f4873686e436c6173734d61746368657242756e646c652e7376673f6272616e63683d747261766973)](https://travis-ci.org/hshn/HshnClassMatcherBundle)

Make easy to define class matcher as a service in Symfony.

Configure
---------

[](#configure)

```
# app/config/config.yml
hshn_class_matcher:
    matchers:
        matcher1: { equals: FooExtended }       # matches FooExtended
        matcher2: { implemented: FooInterface } # matches class that implements FooInterface
        matcher3: { extended: Foo }             # matches class that extends Foo
        matcher4: { anything: ~ }               # matches anything
        matcher5: { and: [matcher1, matcher3] } # matches class that matches matcher 'matcher1' and 'matcher3'
        matcher6: { or: [matcher1, matcher2] }  # matches class that matches matcher 'matcher1' or 'matcher2'
        matcher7: { not: matcher3 }             # matches class that do not extends Foo
```

Usage
-----

[](#usage)

```
