lockfile again

This commit is contained in:
Tim Bendt
2025-11-26 11:50:55 -05:00
parent af3c23cb6e
commit 6ceecaa69e
4461 changed files with 641349 additions and 10 deletions

View File

@@ -0,0 +1,49 @@
<?php
namespace League\Event;
class BufferedEmitter extends Emitter
{
/**
* @var EventInterface[]
*/
protected $bufferedEvents = [];
/**
* @inheritdoc
*/
public function emit($event)
{
$this->bufferedEvents[] = $event;
return $event;
}
/**
* @inheritdoc
*/
public function emitBatch(array $events)
{
foreach ($events as $event) {
$this->bufferedEvents[] = $event;
}
return $events;
}
/**
* Emit the buffered events.
*
* @return array
*/
public function emitBufferedEvents()
{
$result = [];
while ($event = array_shift($this->bufferedEvents)) {
$result[] = parent::emit($event);
}
return $result;
}
}