Files
events/common/Alias/Event/Body.php
2021-03-30 16:32:39 -03:00

24 lines
484 B
PHP

<?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;
}
}