for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the LineMob package.
*
* (c) Ishmael Doss <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace LineMob\Core;
/**
* @property string $text
* @property string $userId
* @property string $replyToken
* @author Ishmael Doss <[email protected]>
class Input
{
* @var array
private $data = [];
public function __construct(array $data)
$data['text'] = trim(preg_replace(['/ +/'], [' '], $data['text']));
$this->data = $data;
}
* {@inheritdoc}
public function __toString()
return (string)$this->data['text'];
public function __get($name)
return $this->data[$name];
public function __set($name, $value)
throw new \LogicException('Impossible to set on a frozen input.');