This repository has been archived on 2024-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
core/vendor/sabre/event/lib/WildcardEmitter.php
Mario 580c3f4ffe another bulk of composer updates
(cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce)
2019-11-10 14:10:03 +01:00

38 lines
1000 B
PHP

<?php declare (strict_types=1);
namespace Sabre\Event;
/**
* This class is an EventEmitter with support for wildcard event handlers.
*
* What this means is that you can emit events like this:
*
* emit('change:firstName')
*
* and listen to this event like this:
*
* on('change:*')
*
* A few notes:
*
* - Wildcards only work at the end of an event name.
* - Currently you can only use 1 wildcard.
* - Using ":" as a separator is optional, but it's highly recommended to use
* some kind of separator.
*
* The WilcardEmitter is a bit slower than the regular Emitter. If you code
* must be very high performance, it might be better to try to use the other
* emitter. For must usage the difference is negligible though.
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class WildcardEmitter implements EmitterInterface {
use WildcardEmitterTrait;
}