imbo/imbo — pull request #248 by christeredvartsen (2014-01-29 13:43:58+00:00)
Title: Change configuration format for event listeners

Today the event listeners use the configuration like this:

```php
return array(
'eventListeners' => array(
'maxImageSizeListener' => array(
'listener' => 'Imbo\EventListener\MaxImageSize',
'params' => array(1024, 768),
),
),
);
```

The params are injected into the constructor using Reflection, and the signature of the constructor of the `Imbo\EventListener\MaxImageSize` class looks like this:

```php
public function __construct($width, $height) {
}
```

I propose a change to this so that I can remove the use of Reflection. I'd much rather use the following config format:

```php
return array(
'eventListeners' => array(
'maxImageSizeListener' => array(
'listener' => 'Imbo\EventListener\MaxImageSize',
'params' => array('width' => 1024, 'height' => 768),
),
),
);
```

and have the constructor to all event listeners look like this:

```php
public function __construct(array $params = array()) {
}
```

This means that some custom configurations "out there" needs to be updated.

Thoughts?