Differential D21866 Diff 52158 src/infrastructure/markup/interpreter/PhabricatorRemarkupCowsayBlockInterpreter.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/markup/interpreter/PhabricatorRemarkupCowsayBlockInterpreter.php
Show All 9 Lines | final class PhabricatorRemarkupCowsayBlockInterpreter | ||||
public function markupContent($content, array $argv) { | public function markupContent($content, array $argv) { | ||||
$action = idx($argv, 'think') ? 'think' : 'say'; | $action = idx($argv, 'think') ? 'think' : 'say'; | ||||
$eyes = idx($argv, 'eyes', 'oo'); | $eyes = idx($argv, 'eyes', 'oo'); | ||||
$tongue = idx($argv, 'tongue', ' '); | $tongue = idx($argv, 'tongue', ' '); | ||||
$map = self::getCowMap(); | $map = self::getCowMap(); | ||||
$cow = idx($argv, 'cow'); | $cow = idx($argv, 'cow'); | ||||
$cow = ($cow === null ? '' : $cow); | |||||
$cow = phutil_utf8_strtolower($cow); | $cow = phutil_utf8_strtolower($cow); | ||||
if (empty($map[$cow])) { | if (empty($map[$cow])) { | ||||
$cow = 'default'; | $cow = 'default'; | ||||
} | } | ||||
$result = id(new PhutilCowsay()) | $result = id(new PhutilCowsay()) | ||||
->setTemplate($map[$cow]) | ->setTemplate($map[$cow]) | ||||
->setAction($action) | ->setAction($action) | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |