private function checkTitle(&$title)
{
if (!is_string($title)) {
$type = gettype($title);
throw new InvalidArgumentException("The title must be a string value, [{$type}] is given.");
}
$title = trim($title);
if (empty($title)) {
throw new InvalidArgumentException('The title is required and must not be empty.');
}
}