/** * @param string $body * @param int $status * @param array $headers */ public function __construct($body = '', $status = 200, array $headers = []) { $this->status = $status; $this->body = $body; $this->headers = new Store(['Content-Type' => 'text/html']); $this->headers->setData($headers); }
/** * @param array $attributes */ public function add(array $attributes) { if (ArrayHelper::isAssoc($attributes)) { $this->attributes->setData($attributes); } else { foreach ($attributes as $attribute) { if (is_array($attribute)) { $this->attributes->setData($attribute); } else { $this->attributes->set($attribute, $attribute); } } } }
/** * Data with the same key will be overridden * * @param array $data */ public function addData(array $data) { $this->data->setData($data); }
/** * @return Store */ public function getConfig() { $store = new Store(require ROOT . '/config/public.php'); $store->setData(require ROOT . '/config/private.php'); return $store; }