Changeset View
Standalone View
src/applications/maniphest/storage/ManiphestTask.php
| Show First 20 Lines • Show All 242 Lines • ▼ Show 20 Lines | final class ManiphestTask extends ManiphestDAO | ||||
| public function getCoverImageFilePHID() { | public function getCoverImageFilePHID() { | ||||
| return idx($this->properties, 'cover.filePHID'); | return idx($this->properties, 'cover.filePHID'); | ||||
| } | } | ||||
| public function getCoverImageThumbnailPHID() { | public function getCoverImageThumbnailPHID() { | ||||
| return idx($this->properties, 'cover.thumbnailPHID'); | return idx($this->properties, 'cover.thumbnailPHID'); | ||||
| } | } | ||||
| public function getWorkboardOrderVectors() { | |||||
| return array( | |||||
| PhabricatorProjectColumn::ORDER_PRIORITY => array( | |||||
| (int)-$this->getPriority(), | |||||
amckinley: Just because this looked like a typo while scrolling... This is the same as
`(int) (-1 *… | |||||
Done Inline ActionsYeah. Some future diff swaps this to -(int)X which is arguably more intuitive than (int)-X even though I think they both do the same thing for all inputs since the unary - implies numeric cast. The (int) in (int)-X isn't technically redundant because -"1.1" has type double. This is all ultimately rooted in T12678. Basically: kind of a goofy mess, cleaned up slightly in future changes, means the same thing as (int)((int)-1 * (int)$x), all the tricky cases end up working out for all actual inputs as long as (int) is in there somewhere. epriestley: Yeah. Some future diff swaps this to `-(int)X` which is arguably more intuitive than `(int)-X`… | |||||
| ), | |||||
| ); | |||||
| } | |||||
| public function getPriorityKeyword() { | public function getPriorityKeyword() { | ||||
| $priority = $this->getPriority(); | $priority = $this->getPriority(); | ||||
| $keyword = ManiphestTaskPriority::getKeywordForTaskPriority($priority); | $keyword = ManiphestTaskPriority::getKeywordForTaskPriority($priority); | ||||
| if ($keyword !== null) { | if ($keyword !== null) { | ||||
| return $keyword; | return $keyword; | ||||
| } | } | ||||
| return ManiphestTaskPriority::UNKNOWN_PRIORITY_KEYWORD; | return ManiphestTaskPriority::UNKNOWN_PRIORITY_KEYWORD; | ||||
| } | } | ||||
| public function getWorkboardProperties() { | |||||
| return array( | |||||
| 'status' => $this->getStatus(), | |||||
| 'points' => (double)$this->getPoints(), | |||||
| 'priority' => $this->getPriority(), | |||||
Not Done Inline ActionsNo cast to int here? amckinley: No cast to `int` here? | |||||
Done Inline Actions(This was just being used to build a "priority(123)" string so the cast didn't actually matter, and I got rid of it in a future change by consolidating the string construction in PHP instead of spreading it out between PHP and JS.) epriestley: (This was just being used to build a `"priority(123)"` string so the cast didn't actually… | |||||
| ); | |||||
| } | |||||
| /* -( PhabricatorSubscribableInterface )----------------------------------- */ | /* -( PhabricatorSubscribableInterface )----------------------------------- */ | ||||
| public function isAutomaticallySubscribed($phid) { | public function isAutomaticallySubscribed($phid) { | ||||
| return ($phid == $this->getOwnerPHID()); | return ($phid == $this->getOwnerPHID()); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 341 Lines • Show Last 20 Lines | |||||
Just because this looked like a typo while scrolling... This is the same as
(int) (-1 * $this->getPriority()), right?