@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add some missing type hints

Summary: Add some typehints for Remarkup rules.

Test Plan: Browsed around some Remarkup text.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12694

+73 -29
+5 -1
src/applications/countdown/remarkup/PhabricatorCountdownRemarkupRule.php
··· 15 15 ->execute(); 16 16 } 17 17 18 - protected function renderObjectEmbed($object, $handle, $options) { 18 + protected function renderObjectEmbed( 19 + $object, 20 + PhabricatorObjectHandle $handle, 21 + $options) { 22 + 19 23 $viewer = $this->getEngine()->getConfig('viewer'); 20 24 21 25 return id(new PhabricatorCountdownView())
+5 -2
src/applications/dashboard/remarkup/PhabricatorDashboardRemarkupRule.php
··· 14 14 ->setViewer($viewer) 15 15 ->withIDs($ids) 16 16 ->execute(); 17 + } 17 18 18 - } 19 + protected function renderObjectEmbed( 20 + $object, 21 + PhabricatorObjectHandle $handle, 22 + $options) { 19 23 20 - protected function renderObjectEmbed($object, $handle, $options) { 21 24 $viewer = $this->getEngine()->getConfig('viewer'); 22 25 23 26 return id(new PhabricatorDashboardPanelRenderingEngine())
+1 -1
src/applications/diviner/markup/DivinerSymbolRemarkupRule.php
··· 33 33 $text); 34 34 } 35 35 36 - public function markupSymbol($matches) { 36 + public function markupSymbol(array $matches) { 37 37 if (!$this->isFlatText($matches[0])) { 38 38 return $matches[0]; 39 39 }
+5 -1
src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php
··· 28 28 return $objects; 29 29 } 30 30 31 - protected function renderObjectEmbed($object, $handle, $options) { 31 + protected function renderObjectEmbed( 32 + $object, 33 + PhabricatorObjectHandle $handle, 34 + $options) { 35 + 32 36 $options = $this->getFileOptions($options) + array( 33 37 'name' => $object->getName(), 34 38 );
+1 -1
src/applications/macro/markup/PhabricatorEmojiRemarkupRule.php
··· 13 13 $text); 14 14 } 15 15 16 - public function markupEmoji($matches) { 16 + public function markupEmoji(array $matches) { 17 17 if (!$this->isFlatText($matches[0])) { 18 18 return $matches[0]; 19 19 }
+1 -2
src/applications/macro/markup/PhabricatorIconRemarkupRule.php
··· 13 13 $text); 14 14 } 15 15 16 - public function markupIcon($matches) { 16 + public function markupIcon(array $matches) { 17 17 $engine = $this->getEngine(); 18 18 $text_mode = $engine->isTextMode(); 19 19 $mail_mode = $engine->isHTMLMailMode(); ··· 72 72 73 73 $icon_view = id(new PHUIIconView()) 74 74 ->setIconFont('fa-'.$icon, $color); 75 - 76 75 77 76 return $this->getEngine()->storeText($icon_view); 78 77 }
+1 -1
src/applications/macro/markup/PhabricatorImageMacroRemarkupRule.php
··· 13 13 $text); 14 14 } 15 15 16 - public function markupImageMacro($matches) { 16 + public function markupImageMacro(array $matches) { 17 17 if ($this->macros === null) { 18 18 $this->macros = array(); 19 19
+1 -1
src/applications/macro/markup/PhabricatorMemeRemarkupRule.php
··· 15 15 $text); 16 16 } 17 17 18 - public function markupMeme($matches) { 18 + public function markupMeme(array $matches) { 19 19 if (!$this->isFlatText($matches[0])) { 20 20 return $matches[0]; 21 21 }
+5 -1
src/applications/paste/remarkup/PhabricatorPasteRemarkupRule.php
··· 17 17 18 18 } 19 19 20 - protected function renderObjectEmbed($object, $handle, $options) { 20 + protected function renderObjectEmbed( 21 + $object, 22 + PhabricatorObjectHandle $handle, 23 + $options) { 24 + 21 25 $embed_paste = id(new PasteEmbedView()) 22 26 ->setPaste($object) 23 27 ->setHandle($handle);
+1 -1
src/applications/people/markup/PhabricatorMentionRemarkupRule.php
··· 26 26 $text); 27 27 } 28 28 29 - protected function markupMention($matches) { 29 + protected function markupMention(array $matches) { 30 30 $engine = $this->getEngine(); 31 31 32 32 if ($engine->isTextMode()) {
+10 -2
src/applications/pholio/remarkup/PholioRemarkupRule.php
··· 12 12 return '[1-9]\d*(?:/[1-9]\d*/?)?'; 13 13 } 14 14 15 - protected function getObjectHref($object, $handle, $id) { 15 + protected function getObjectHref( 16 + $object, 17 + PhabricatorObjectHandle $handle, 18 + $id) { 19 + 16 20 $href = $handle->getURI(); 17 21 18 22 // If the ID has a `M123/456` component, link to that specific image. ··· 51 55 return $results; 52 56 } 53 57 54 - protected function renderObjectEmbed($object, $handle, $options) { 58 + protected function renderObjectEmbed( 59 + $object, 60 + PhabricatorObjectHandle $handle, 61 + $options) { 62 + 55 63 $embed_mock = id(new PholioMockEmbedView()) 56 64 ->setMock($object); 57 65
+1 -2
src/applications/phriction/markup/PhrictionRemarkupRule.php
··· 13 13 $text); 14 14 } 15 15 16 - public function markupDocumentLink($matches) { 17 - 16 + public function markupDocumentLink(array $matches) { 18 17 $link = trim($matches[1]); 19 18 $name = trim(idx($matches, 2, $link)); 20 19 if (empty($matches[2])) {
+6 -1
src/applications/project/remarkup/ProjectRemarkupRule.php
··· 6 6 return '#'; 7 7 } 8 8 9 - protected function renderObjectRef($object, $handle, $anchor, $id) { 9 + protected function renderObjectRef( 10 + $object, 11 + PhabricatorObjectHandle $handle, 12 + $anchor, 13 + $id) { 14 + 10 15 if ($this->getEngine()->isTextMode()) { 11 16 return '#'.$id; 12 17 }
+5 -1
src/applications/slowvote/remarkup/SlowvoteRemarkupRule.php
··· 18 18 ->execute(); 19 19 } 20 20 21 - protected function renderObjectEmbed($object, $handle, $options) { 21 + protected function renderObjectEmbed( 22 + $object, 23 + PhabricatorObjectHandle $handle, 24 + $options) { 25 + 22 26 $viewer = $this->getEngine()->getConfig('viewer'); 23 27 24 28 $embed = id(new SlowvoteEmbedView())
+1 -1
src/infrastructure/markup/rule/PhabricatorNavigationRemarkupRule.php
··· 13 13 $text); 14 14 } 15 15 16 - public function markupNavigation($matches) { 16 + public function markupNavigation(array $matches) { 17 17 if (!$this->isFlatText($matches[0])) { 18 18 return $matches[0]; 19 19 }
+24 -10
src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php
··· 45 45 } 46 46 47 47 protected function renderObjectRefForAnyMedia ( 48 - $object, 49 - $handle, 50 - $anchor, 51 - $id) { 48 + $object, 49 + PhabricatorObjectHandle $handle, 50 + $anchor, 51 + $id) { 52 + 52 53 $href = $this->getObjectHref($object, $handle, $id); 53 54 $text = $this->getObjectNamePrefix().$id; 54 55 ··· 68 69 69 70 } 70 71 71 - protected function renderObjectRef($object, $handle, $anchor, $id) { 72 + protected function renderObjectRef( 73 + $object, 74 + PhabricatorObjectHandle $handle, 75 + $anchor, 76 + $id) { 77 + 72 78 $href = $this->getObjectHref($object, $handle, $id); 73 79 $text = $this->getObjectNamePrefix().$id; 74 80 $status_closed = PhabricatorObjectHandleStatus::STATUS_CLOSED; ··· 86 92 return $this->renderHovertag($text, $href, $attr); 87 93 } 88 94 89 - protected function renderObjectEmbedForAnyMedia($object, $handle, $options) { 95 + protected function renderObjectEmbedForAnyMedia( 96 + $object, 97 + PhabricatorObjectHandle $handle, 98 + $options) { 99 + 90 100 $name = $handle->getFullName(); 91 101 $href = $handle->getURI(); 92 102 ··· 100 110 return $this->renderObjectEmbed($object, $handle, $options); 101 111 } 102 112 103 - protected function renderObjectEmbed($object, $handle, $options) { 113 + protected function renderObjectEmbed( 114 + $object, 115 + PhabricatorObjectHandle $handle, 116 + $options) { 117 + 104 118 $name = $handle->getFullName(); 105 119 $href = $handle->getURI(); 106 120 $status_closed = PhabricatorObjectHandleStatus::STATUS_CLOSED; ··· 115 129 protected function renderObjectTagForMail( 116 130 $text, 117 131 $href, 118 - $handle) { 132 + PhabricatorObjectHandle $handle) { 119 133 120 134 $status_closed = PhabricatorObjectHandleStatus::STATUS_CLOSED; 121 135 $strikethrough = $handle->getStatus() == $status_closed ? ··· 243 257 return $results; 244 258 } 245 259 246 - public function markupObjectEmbed($matches) { 260 + public function markupObjectEmbed(array $matches) { 247 261 if (!$this->isFlatText($matches[0])) { 248 262 return $matches[0]; 249 263 } ··· 256 270 )); 257 271 } 258 272 259 - public function markupObjectReference($matches) { 273 + public function markupObjectReference(array $matches) { 260 274 if (!$this->isFlatText($matches[0])) { 261 275 return $matches[0]; 262 276 }