2017 © Pedro Peláez
 

symfony-bundle class-matcher-bundle

image

hshn/class-matcher-bundle

  • Thursday, August 7, 2014
  • by hshn
  • Repository
  • 1 Watchers
  • 0 Stars
  • 523 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

HshnClassMatcherBundle

Build Status, (*1)

Make easy to define class matcher as a service in Symfony., (*2)

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

<?php

$provider = $container->get('hshn_class_matcher.matcher_provider');
$provider->get('matcher1')->matches('Foo'); // true or false

The Versions

07/08 2014

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shota Hoshino

06/08 2014

v0.1.0

0.1.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shota Hoshino