Events WebSocket

This commit is contained in:
2021-03-30 16:32:39 -03:00
parent 3c341a4b9d
commit 4556a50f58
12 changed files with 300 additions and 0 deletions

View File

@ -0,0 +1,23 @@
<?php
namespace ProVM\Common\Alias\Event;
use ProVM\Common\Define\Event\Body as BodyInterface;
class Body implements BodyInterface {
protected $body = [];
public function write($data) {
if (is_object($data)) {
return $this->write((array) $data);
}
if (!is_array($data)) {
$this->body []= $data;
return;
}
foreach ($data as $key => $line) {
$this->body[$key] = $line;
}
}
public function read() {
return $this->body;
}
}