Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUICrumbsView.php
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | public function getActions() { | ||||
return $this->actions; | return $this->actions; | ||||
} | } | ||||
public function render() { | public function render() { | ||||
require_celerity_resource('phui-crumbs-view-css'); | require_celerity_resource('phui-crumbs-view-css'); | ||||
$action_view = null; | $action_view = null; | ||||
if ($this->actions) { | if ($this->actions) { | ||||
// TODO: This block of code takes "PHUIListItemView" objects and turns | |||||
// them into some weird abomination by reading most of their properties | |||||
// out. Some day, this workflow should render the items and CSS should | |||||
// resytle them in place without needing a wholly separate set of | |||||
// DOM nodes. | |||||
$actions = array(); | $actions = array(); | ||||
foreach ($this->actions as $action) { | foreach ($this->actions as $action) { | ||||
if ($action->getType() == PHUIListItemView::TYPE_DIVIDER) { | if ($action->getType() == PHUIListItemView::TYPE_DIVIDER) { | ||||
amckinley: I'm sure there's an obvious reason why we can't make a lint rule that detects "incorrect"… | |||||
Done Inline ActionsNo technical reason, it's just a lot of work to write the rule because there are so many cases. Not weird special cases or anything, just a lot of actual language constructs that affect indentation so you have to enumerate all the different control statements and class and switch and try/catch and so on. epriestley: No technical reason, it's just a lot of work to write the rule because there are so many cases. | |||||
$actions[] = phutil_tag( | $actions[] = phutil_tag( | ||||
'span', | 'span', | ||||
array( | array( | ||||
'class' => 'phui-crumb-action-divider', | 'class' => 'phui-crumb-action-divider', | ||||
)); | )); | ||||
continue; | continue; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |
I'm sure there's an obvious reason why we can't make a lint rule that detects "incorrect" indentation, but it's escaping me. I know we already enforce requiring braces instead of single-line blocks... Is it just that we don't want to mandate the number of spaces in an indent, which means we'd have to detect the "intended" number before enforcing things?