Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 3ae27e0

Browse files
committed
Merge branch 'develop'
Merging develop to master in preparation for v3.
2 parents b4354f7 + 747b7b1 commit 3ae27e0

File tree

91 files changed

+5323
-2460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+5323
-2460
lines changed

.gitattributes

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
/doc export-ignore
12
/benchmarks export-ignore
23
/test export-ignore
34
/vendor export-ignore
45
.coveralls.yml export-ignore
56
.gitattributes export-ignore
67
.gitignore export-ignore
78
.travis.yml export-ignore
8-
.php_cs export-ignore
9+
Makefile export-ignore
10+
mkdocs.yml export-ignore
911
phpunit.xml.dist export-ignore
12+
phpcs.xml export-ignore

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ clover.xml
1212
composer.lock
1313
coveralls-upload.json
1414
phpunit.xml
15-
vendor
15+
doc/html/
16+
vendor/

.php_cs

Lines changed: 0 additions & 45 deletions
This file was deleted.

.travis.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ matrix:
1717
- php: 5.5
1818
env:
1919
- EXECUTE_CS_CHECK=true
20+
- EXECUTE_DOC_CHECK=true
2021
- php: 5.6
2122
env:
2223
- EXECUTE_TEST_COVERALLS=true
@@ -33,15 +34,21 @@ notifications:
3334
before_install:
3435
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
3536
- composer self-update
37+
- if [[ $EXECUTE_DOC_CHECK == 'true' ]]; then composer require --dev --no-update phly/bookdown2mkdocs ; fi
3638
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls ; fi
3739

3840
install:
39-
- travis_retry composer install --no-interaction --ignore-platform-reqs
41+
- travis_retry composer install --no-interaction --ignore-platform-reqs --prefer-source
42+
- composer info -i
43+
44+
before_script:
45+
- if [[ $EXECUTE_DOC_CHECK == 'true' ]]; then cp mkdocs.yml mkdocs.yml.orig ; fi
4046

4147
script:
4248
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/phpunit --coverage-clover clover.xml ; fi
4349
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then ./vendor/bin/phpunit ; fi
44-
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/php-cs-fixer fix -v --diff --dry-run ; fi
50+
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/phpcs ; fi
51+
- if [[ $EXECUTE_DOC_CHECK == 'true' ]]; then make mkdocs ; diff mkdocs.yml mkdocs.yml.orig ; return $? ; fi
4552

4653
after_script:
4754
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/coveralls ; fi

CHANGELOG.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,91 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5+
## 3.0.0 - TBD
6+
7+
### Added
8+
9+
- [Migration documentation](doc/book/migration/) was added.
10+
- [Automated benchmarks](benchmarks/) were added.
11+
- `EventManager::__construct()` now accepts an optional
12+
`SharedEventManagerInterface` instance as the first argument, and an optional
13+
array of identifiers as the second. As identifiers have no meaning without a
14+
shared manager present, they are secondary to providing the shared manager.
15+
- `EventManagerInterface::trigger()` changes its signature to
16+
`trigger($eventName, $target = null, $argv = [])`; each argument has exactly
17+
one possible meaning; the `$eventName` can only be a string event name. The
18+
fourth `$callback` argument is removed.
19+
- `EventManagerInterface::triggerUntil()` changes its signature to
20+
`triggerUntil(callable $callback, $eventName, $target = null, $argv = null)`.
21+
Each argument has exactly one meaning.
22+
- `EventManagerInterface` adds two new methods for triggering provided
23+
`EventInterface` arguments: `triggerEvent(EventInterface $event)` and
24+
`triggerEventUntil(callable $callback, EventInterface $event)`.
25+
- `EventManagerInterface::attach()` and `detach()` change their signatures to
26+
`attach($eventName, callable $listener, $priority = 1)` and `detach(callable
27+
$listener, $eventName = null)`, respectively. Note that `$eventName` can now
28+
only be a string event name, not an array or `Traversable`.
29+
- `EventManagerInterface::setIdentifiers()` and `addIdentifiers()` change their
30+
signatures to each only accept an *array* of identifiers.
31+
- `SharedEventManagerInterface::getListeners()` changes signature to
32+
`getListeners(array $identifiers, $eventName)` and now guarantees return of an
33+
array. Note that the second argument is now *required*.
34+
- `SharedEventManagerInterface::attach()` changes signature to
35+
`attach($identifier, $eventName, callable $listener, $priority = 1)`. The
36+
`$identifier` and `$eventName` **must** be strings.
37+
- `SharedEventManagerInterface::detach()` changes signature to `detach(callable
38+
$listener, $identifier = null, $eventName = null)`; `$identifier` and
39+
`$eventName` **must** be strings if passed.
40+
- `ListenerAggregateInterface::attach()` adds an optional `$priority = 1`
41+
argument. This was used already in v2, but not dictated by the interface.
42+
- `FilterInterface::attach()` and `detach()` have changed signature to
43+
`attach(callable $callback)` and `detach(callable $ilter)`, respectively.
44+
- `LazyListener` allows wrapping:
45+
- fetching a listener service from a container-interop container, and
46+
- invoking a designated listener method with the provided event.
47+
- `LazyEventListener` extends `LazyListener`, and provides metadata for
48+
discovering the intended event name and priority at which to attach the lazy
49+
listener; these are consumed by:
50+
- `LazyListenerAggregate`, which, provided a list of `LazyEventListeners` and/or
51+
definitions to use to create them, acts as an aggregate for attaching a number
52+
of such listeners at once.
53+
- [#20](https://github.com/zendframework/zend-eventmanager/pull/20) updates the
54+
trait `Zend\EventManager\Test\EventListenerIntrospectionTrait` so that the
55+
implementation will work with the v3 changes; the tests written for v2
56+
continue to pass, allowing this trait to be used to provide compatibility
57+
testing between v2 and v3.
58+
59+
### Deprecated
60+
61+
- Nothing.
62+
63+
### Removed
64+
65+
- `GlobalEventManager` and `StaticEventManager` are removed (with prejudice!).
66+
- `ProvidesEvents`, which was previously deprecated, is removed.
67+
- `EventManagerInterface::setSharedManager()` is removed. Shared managers are
68+
now expected to be injected during instantiation.
69+
- `EventManagerInterface::getEvents()` and `getListeners()` are removed; they
70+
had now purpose within the implementation.
71+
- `EventManagerInterface::setEventClass()` was renamed to `setEventPrototype()`,
72+
which now expects an `EventInterface` instance. That instance will be cloned
73+
whenever a new event is created.
74+
- `EventManagerInterface::attachAggregate()` and `detachAggregate()` are
75+
removed. Users should use the `attach()` and `detach()` methods of the
76+
aggregates themselves.
77+
- `SharedEventAggregateAwareInterface` and `SharedListenerAggregateInterface`
78+
are removed. This was an undocumented and largely unused feature.
79+
- `SharedEventManagerAwareInterface` is removed. A new interface,
80+
`SharedEventsCapableInterface` defines the `getSharedManager()` method from
81+
the interface, and `EventManagerInterface` extends that new interface.
82+
- `SharedEventManagerInterface::getEvents()` is removed, as it had no purpose in
83+
the implementation.
84+
- `ResponseCollection::setStopped()` no longer implements a fluent interface.
85+
86+
### Fixed
87+
88+
- `FilterIterator::insert()` has been modified to raise an exception if the value provided is not a callable.
89+
590
## 2.6.2 - 2016-01-12
691

792
### Added

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# zend-eventmanager Makefile
2+
#
3+
# Primary purpose is for generating the mkdocs.yml from the bookdown.json
4+
# sources.
5+
#
6+
# Configurable variables:
7+
# - BOOKDOWN2MKDOCS - specify the path to the executable; defaults to
8+
# ./vendor/bin/bookdown2mkdocs
9+
#
10+
# Available targets:
11+
# - mkdocs - regenerate mkdocs.yml
12+
# - all - synonym for mkdocs target
13+
14+
BOOKDOWN2MKDOCS?=$(CURDIR)/vendor/bin/bookdown2mkdocs.php
15+
16+
.PHONY : all mkdocs bookdown2mkdocs
17+
18+
all : mkdocs
19+
20+
mkdocs :
21+
@echo "Generating mkdocs.yml from bookdown.json..."
22+
-$(BOOKDOWN2MKDOCS) convert --site-name=zend-eventmanager --repo-url=https://github.com/zendframework/zend-eventmanager --copyright-url=http://www.zend.com/ --copyright-author="Zend Technologies USA Inc."
23+
@echo "[DONE] Generating mkdocs.yml from bookdown.json"

benchmarks/MultipleEventIndividualSharedListener.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ public function setUp()
2323
foreach ($this->getEventList() as $event) {
2424
$this->sharedEvents->attach($identifiers[0], $event, $this->generateCallback());
2525
}
26-
$this->events = new EventManager();
27-
$this->events->setSharedManager($this->sharedEvents);
28-
$this->events->setIdentifiers([$identifiers[0]]);
26+
$this->events = new EventManager($this->sharedEvents, [$identifiers[0]]);
2927

3028
$this->eventsToTrigger = array_filter($this->getEventList(), function ($value) {
3129
return ($value !== '*');

benchmarks/MultipleEventMultipleLocalAndSharedListener.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ public function setUp()
2525
$this->sharedEvents->attach($identifier, $event, $this->generateCallback());
2626
}
2727
}
28-
$this->events = new EventManager();
29-
$this->events->setSharedManager($this->sharedEvents);
30-
$this->events->setIdentifiers($identifiers);
28+
$this->events = new EventManager($this->sharedEvents, $identifiers);
3129

3230
$this->eventsToTrigger = array_filter($this->getEventList(), function ($value) {
3331
return ($value !== '*');

benchmarks/MultipleEventMultipleSharedListener.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ public function setUp()
2525
$this->sharedEvents->attach($identifier, $event, $this->generateCallback());
2626
}
2727
}
28-
$this->events = new EventManager();
29-
$this->events->setSharedManager($this->sharedEvents);
30-
$this->events->setIdentifiers($identifiers);
28+
$this->events = new EventManager($this->sharedEvents, $identifiers);
3129

3230
$this->eventsToTrigger = array_filter($this->getEventList(), function ($value) {
3331
return ($value !== '*');

benchmarks/SingleEventMultipleSharedListener.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ public function setUp()
2121
for ($i = 0; $i < $this->numListeners; $i += 1) {
2222
$this->sharedEvents->attach($identifiers[0], 'dispatch', $this->generateCallback());
2323
}
24-
$this->events = new EventManager();
25-
$this->events->setSharedManager($this->sharedEvents);
26-
$this->events->setIdentifiers([$identifiers[0]]);
24+
$this->events = new EventManager($this->sharedEvents, [$identifiers[0]]);
2725
}
2826

2927
/**

0 commit comments

Comments
 (0)