2017 © Pedro Peláez
 

library events-capable

Provides a config-based initializer that attaches listeners to implementations of \Zend\EventManager\EventsCapableInterface.

image

abacaphiliac/events-capable

Provides a config-based initializer that attaches listeners to implementations of \Zend\EventManager\EventsCapableInterface.

  • Tuesday, April 12, 2016
  • by abacaphiliac
  • Repository
  • 2 Watchers
  • 2 Stars
  • 3,690 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 5 % Grown

The README.md

Scrutinizer Code Quality Code Coverage Build Status, (*1)

abacaphiliac/events-capable

Tired of writing backwards-compatible logic in all of your factory code to wire up listeners? Is your service implementation registered with Zend's service manager? Then this package might be right for you!, (*2)

This package provides a config-based initializer that attaches listeners to implementations of \Zend\EventManager\EventsCapableInterface. When the service concrete is instantiated by service manager, it will pass through the initializer provided by this package. If your service is Events Capable, then the initializer will check the config for registered listeners to attach to the service's event manager., (*3)

Installation

Install the latest version with, (*4)

composer require abacaphiliac/events-capable

Basic Usage (Configuration)

  1. Update service_manager config.
    1. Add initializer.
    2. Add listener.
  2. Update abacaphiliac/events-capable config:
    1. Add \Zend\EventManager\EventsCapableInterface implementation.
    2. Add \Zend\EventManager\ListenerAggregateInterface implementation.

Configuration Examples

Update service_manager config:

return [
    'service_manager' => [
        'factories' => [
            \MyListener::class => \MyListenerFactory::class,
        ],
        'initializers' => [
            \abacaphiliac\EventsCapable\EventsCapableInitializer::class,
        ],
    ],
];

Update abacaphiliac/events-capable config:

return [
    'abacaphiliac/events-capable' => [
        'eventsCapable' => [
            \MyEventsCapableService::class => [
                \MyListener::class,
            ],
        ],
    ],
];

Contributing

composer install && vendor/bin/phing

This library attempts to comply with PSR-1, PSR-2, and PSR-4. If you notice compliance oversights, please send a patch via pull request., (*5)

The Versions

12/04 2016

dev-master

9999999-dev

Provides a config-based initializer that attaches listeners to implementations of \Zend\EventManager\EventsCapableInterface.

  Sources   Download

MIT

The Requires

 

The Development Requires

12/04 2016

0.2.1

0.2.1.0

Provides a config-based initializer that attaches listeners to implementations of \Zend\EventManager\EventsCapableInterface.

  Sources   Download

MIT

The Requires

 

The Development Requires

11/04 2016

dev-develop

dev-develop

Provides a config-based initializer that attaches listeners to implementations of \Zend\EventManager\EventsCapableInterface.

  Sources   Download

MIT

The Requires

 

The Development Requires

20/01 2016

0.2.0

0.2.0.0

Provides a config-based initializer that attaches listeners to implementations of \Zend\EventManager\EventsCapableInterface.

  Sources   Download

MIT

The Requires

 

The Development Requires

28/12 2015

0.1.0

0.1.0.0

Provides a config-based initializer that attaches listeners to implementations of \Zend\EventManager\EventsCapableInterface.

  Sources   Download

MIT

The Requires

 

The Development Requires