Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function format(StatusInterface $status)
 {
     return $status->setText(preg_replace_callback('#(?P<all>(?P<href>href=("|\'))?(?P<link>https?://(?P<name>[^\\s]+)))#', function ($matches) {
         if ($matches['href']) {
             return $matches['all'];
         }
         return sprintf('<a href="%s">%s</a>', $matches['link'], $matches['name']);
     }, $status->getText()));
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function format(StatusInterface $status)
 {
     return $status->setText(preg_replace('/#(\\w+)/', sprintf('<a href="' . self::HASHTAG_URL . '">#%s</a>', '$1', '$1'), $status->getText()));
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function isValid(StatusInterface $status)
 {
     return 0 !== strpos($status->getText(), '@');
 }