[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/doorkeeper/remarkup/ -> DoorkeeperRemarkupRuleAsana.php (source)

   1  <?php
   2  
   3  final class DoorkeeperRemarkupRuleAsana
   4    extends DoorkeeperRemarkupRule {
   5  
   6    public function apply($text) {
   7      return preg_replace_callback(
   8        '@https://app\\.asana\\.com/0/(\\d+)/(\\d+)@',
   9        array($this, 'markupAsanaLink'),
  10        $text);
  11    }
  12  
  13    public function markupAsanaLink($matches) {
  14      return $this->addDoorkeeperTag(
  15        array(
  16          'href' => $matches[0],
  17          'tag' => array(
  18            'ref' => array(
  19              DoorkeeperBridgeAsana::APPTYPE_ASANA,
  20              DoorkeeperBridgeAsana::APPDOMAIN_ASANA,
  21              DoorkeeperBridgeAsana::OBJTYPE_TASK,
  22              $matches[2],
  23            ),
  24            'extra' => array(
  25              'asana.context' => $matches[1],
  26            ),
  27          ),
  28        ));
  29    }
  30  
  31  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1