text = $text; if (null === $text || null === $format) { return $this; } switch ($format) { case 'strong': return $this->strong(); case 'em': return $this->em(); case 'info': return $this->info(); case 'warning': return $this->warning(); case 'error': return $this->error(); default: return $text; } } public function strong($text = null) { if (null === $text) { $text = $this->text; } return "{$text}"; } public function em($text = null) { if (null === $text) { $text = $this->text; } return "{$text}"; } public function info($text = null) { if (null === $text) { $text = $this->text; } return '
' . $text . '
'; } public function warning($text = null) { if (null === $text) { $text = $this->text; } return '
' . $text . '
'; } public function error($text = null) { if (null === $text) { $text = $this->text; } return '
' . $text . '
'; } }