Skip to content

Lazy container listeners #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 21, 2016
Merged

Lazy container listeners #138

merged 3 commits into from
Nov 21, 2016

Conversation

AydinHassan
Copy link
Member

  • Only fetch container entries used for listeners when dispatching the event
  • Add some methods + tests to ArrayObject + bring in Collection which is basically alias for ArrayObject as it looks weird using ArrayObject in the code when you want to use collection features.
  • Move default event listeners to config and remove from the factory
  • Migrate some tests to prophecy - so much nicer ❤️
  • Change config structure for event listeners to allow grouping together events.

Eg

//before
[
    'some-event' => [
        'CoolFeature1Listener'
        'CoolFeature2Listener'
    ],
    'some-other-event' => [
        'CoolFeature1Listener',
    ]
]
//after
[
    'cool-feature1' => [
        'some-event' => [
            'CoolFeature1Listener'
        ],
        'some-other-event' => [
            'CoolFeature1Listener',
        ]
    ]
    'cool-feature2' => [
        'some-event' => [
            'CoolFeature2Listener'
        ],
    ],
]

@codecov-io
Copy link

codecov-io commented Nov 21, 2016

Current coverage is 90.01% (diff: 100%)

Merging #138 into develop will increase coverage by 0.23%

@@            develop       #138   diff @@
==========================================
  Files            72         74     +2   
  Lines          1673       1713    +40   
  Methods         303        314    +11   
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           1502       1542    +40   
  Misses          171        171          
  Partials          0          0          

Powered by Codecov. Last update f8510f3...622ff82

@mikeymike
Copy link
Member

LGTM ... any reason to not just refactor the ArrayObject to Collection ? ... is it used outside of the lib?

@AydinHassan
Copy link
Member Author

No but its used in some places as a wrapper for array as arrays arn't passed by ref. So it makes sense in that case. I'll have a think about it another time.

@AydinHassan AydinHassan force-pushed the lazy-container-listeners branch from 622ff82 to c858084 Compare November 21, 2016 22:35
@AydinHassan AydinHassan merged commit 8ea28cb into develop Nov 21, 2016
@AydinHassan AydinHassan deleted the lazy-container-listeners branch November 21, 2016 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants