1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

Apply lint rules to Phabricator

Summary: Mostly applies a new call spacing rule; also a few things that have slipped through via pull requests and such

Test Plan: `find src/ -type f -name '*.php' | xargs -n16 arc lint --output summary --apply-patches`

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D5002
This commit is contained in:
epriestley 2013-02-19 13:33:10 -08:00
parent 63f35ee94f
commit a22bea2a74
128 changed files with 341 additions and 662 deletions

View file

@ -28,8 +28,7 @@ final class AuditPeopleMenuEventListener extends PhutilEventListener {
->setIsExternal(true) ->setIsExternal(true)
->setName($name) ->setName($name)
->setHref($href) ->setHref($href)
->setKey($name) ->setKey($name));
);
$event->setValue('menu', $menu); $event->setValue('menu', $menu);
} }

View file

@ -44,8 +44,7 @@ final class PhabricatorCalendarBrowseController
$details = "\n\n".rtrim($status->getDescription()); $details = "\n\n".rtrim($status->getDescription());
} }
$event->setDescription( $event->setDescription(
$status->getTerseSummary($user).$details $status->getTerseSummary($user).$details);
);
$event->setEventID($status->getID()); $event->setEventID($status->getID());
$month_view->addEvent($event); $month_view->addEvent($event);
} }

View file

@ -28,8 +28,7 @@ final class PhabricatorCalendarDeleteStatusController
$uri->setQueryParams( $uri->setQueryParams(
array( array(
'deleted' => true, 'deleted' => true,
) ));
);
return id(new AphrontRedirectResponse()) return id(new AphrontRedirectResponse())
->setURI($uri); ->setURI($uri);
} }
@ -40,12 +39,10 @@ final class PhabricatorCalendarDeleteStatusController
$dialog->appendChild(phutil_tag( $dialog->appendChild(phutil_tag(
'p', 'p',
array(), array(),
pht('Permanently delete this status? This action can not be undone.') pht('Permanently delete this status? This action can not be undone.')));
));
$dialog->addSubmitButton(pht('Delete')); $dialog->addSubmitButton(pht('Delete'));
$dialog->addCancelButton( $dialog->addCancelButton(
$this->getApplicationURI('status/edit/'.$status->getID().'/') $this->getApplicationURI('status/edit/'.$status->getID().'/'));
);
return id(new AphrontDialogResponse())->setDialog($dialog); return id(new AphrontDialogResponse())->setDialog($dialog);

View file

@ -85,8 +85,7 @@ final class PhabricatorCalendarEditStatusController
$user, $user,
'Y'), 'Y'),
$redirect => true, $redirect => true,
) ));
);
return id(new AphrontRedirectResponse()) return id(new AphrontRedirectResponse())
->setURI($uri); ->setURI($uri);
} }
@ -125,8 +124,7 @@ final class PhabricatorCalendarEditStatusController
} else { } else {
$submit->addCancelButton( $submit->addCancelButton(
$this->getApplicationURI('status/delete/'.$status->getID().'/'), $this->getApplicationURI('status/delete/'.$status->getID().'/'),
pht('Delete Status') pht('Delete Status'));
);
} }
$form->appendChild($submit); $form->appendChild($submit);
@ -138,16 +136,14 @@ final class PhabricatorCalendarEditStatusController
id(new PhabricatorHeaderView())->setHeader($page_title), id(new PhabricatorHeaderView())->setHeader($page_title),
$error_view, $error_view,
$form, $form,
) ));
);
return $this->buildApplicationPage( return $this->buildApplicationPage(
$nav, $nav,
array( array(
'title' => $page_title, 'title' => $page_title,
'device' => true 'device' => true
) ));
);
} }
} }

View file

@ -32,16 +32,14 @@ final class PhabricatorCalendarViewStatusController
array( array(
id(new PhabricatorHeaderView())->setHeader($page_title), id(new PhabricatorHeaderView())->setHeader($page_title),
$status_list, $status_list,
) ));
);
return $this->buildApplicationPage( return $this->buildApplicationPage(
$nav, $nav,
array( array(
'title' => $page_title, 'title' => $page_title,
'device' => true 'device' => true
) ));
);
} }
private function buildStatusList(array $statuses) { private function buildStatusList(array $statuses) {
@ -62,8 +60,7 @@ final class PhabricatorCalendarViewStatusController
array( array(
'month' => $month, 'month' => $month,
'year' => $year, 'year' => $year,
) ));
);
$href = (string) $uri; $href = (string) $uri;
} }
$from = phabricator_datetime($status->getDateFrom(), $user); $from = phabricator_datetime($status->getDateFrom(), $user);
@ -115,8 +112,7 @@ final class PhabricatorCalendarViewStatusController
} else { } else {
$page_title = pht( $page_title = pht(
'Upcoming Statuses for %s', 'Upcoming Statuses for %s',
$this->getHandle($this->phid)->getName() $this->getHandle($this->phid)->getName());
);
} }
return $page_title; return $page_title;
} }

View file

@ -170,16 +170,14 @@ final class AphrontCalendarMonthView extends AphrontView {
$prev_link = phutil_tag( $prev_link = phutil_tag(
'a', 'a',
array('href' => (string) $uri->setQueryParams($query)), array('href' => (string) $uri->setQueryParams($query)),
"\xE2\x86\x90" "\xE2\x86\x90");
);
list($next_year, $next_month) = $this->getNextYearAndMonth(); list($next_year, $next_month) = $this->getNextYearAndMonth();
$query = array('year' => $next_year, 'month' => $next_month); $query = array('year' => $next_year, 'month' => $next_month);
$next_link = phutil_tag( $next_link = phutil_tag(
'a', 'a',
array('href' => (string) $uri->setQueryParams($query)), array('href' => (string) $uri->setQueryParams($query)),
"\xE2\x86\x92" "\xE2\x86\x92");
);
$left_th = phutil_tag('th', array(), $prev_link); $left_th = phutil_tag('th', array(), $prev_link);
$right_th = phutil_tag('th', array(), $next_link); $right_th = phutil_tag('th', array(), $next_link);

View file

@ -91,8 +91,7 @@ final class PhabricatorConfigAllController
array( array(
'title' => $title, 'title' => $title,
'device' => true, 'device' => true,
) ));
);
} }
} }

View file

@ -46,8 +46,7 @@ final class PhabricatorConfigGroupController
array( array(
'title' => $title, 'title' => $title,
'device' => true, 'device' => true,
) ));
);
} }
private function buildOptionList(array $options) { private function buildOptionList(array $options) {

View file

@ -41,8 +41,7 @@ final class PhabricatorConfigIssueListController
array( array(
'title' => $title, 'title' => $title,
'device' => true, 'device' => true,
) ));
);
} }
private function buildIssueList(array $issues) { private function buildIssueList(array $issues) {

View file

@ -54,8 +54,7 @@ final class PhabricatorConfigIssueViewController
array( array(
'title' => $title, 'title' => $title,
'device' => true, 'device' => true,
) ));
);
} }
private function renderIssue(PhabricatorSetupIssue $issue) { private function renderIssue(PhabricatorSetupIssue $issue) {

View file

@ -38,8 +38,7 @@ final class PhabricatorConfigListController
array( array(
'title' => $title, 'title' => $title,
'device' => true, 'device' => true,
) ));
);
} }
private function buildConfigOptionsList(array $groups) { private function buildConfigOptionsList(array $groups) {

View file

@ -131,8 +131,7 @@ final class PhabricatorCoreConfigOptions
$this->newOption('phabricator.uninstalled-applications', 'set', array()) $this->newOption('phabricator.uninstalled-applications', 'set', array())
->setLocked(true) ->setLocked(true)
->setDescription( ->setDescription(
pht('Array containing list of Uninstalled applications.') pht('Array containing list of Uninstalled applications.')),
),
); );
} }

View file

@ -64,9 +64,10 @@ final class PhabricatorSetupIssueView extends AphrontView {
// TODO: We should do a better job of detecting how to install extensions // TODO: We should do a better job of detecting how to install extensions
// on the current system. // on the current system.
$install_commands = hsprintf( $install_commands = hsprintf(
"\$ sudo apt-get install php5-<em>extname</em> # Debian / Ubuntu\n". "\$ sudo apt-get install php5-<em>extname</em> ".
"\$ sudo yum install php-<em>extname</em> # Red Hat / Derivatives" "# Debian / Ubuntu\n".
); "\$ sudo yum install php-<em>extname</em> ".
"# Red Hat / Derivatives");
$fallback_info = pht( $fallback_info = pht(
"If those commands don't work, try Google. The process of installing ". "If those commands don't work, try Google. The process of installing ".

View file

@ -78,14 +78,12 @@ abstract class ConpherenceController extends PhabricatorController {
->execute(); ->execute();
$unread_conpherences = array_select_keys( $unread_conpherences = array_select_keys(
$all_conpherences, $all_conpherences,
array_keys($unread) array_keys($unread));
);
$this->setUnreadConpherences($unread_conpherences); $this->setUnreadConpherences($unread_conpherences);
$read_conpherences = array_select_keys( $read_conpherences = array_select_keys(
$all_conpherences, $all_conpherences,
array_keys($read) array_keys($read));
);
$this->setReadConpherences($read_conpherences); $this->setReadConpherences($read_conpherences);
if (!$this->getSelectedConpherencePHID()) { if (!$this->getSelectedConpherencePHID()) {
@ -109,8 +107,7 @@ abstract class ConpherenceController extends PhabricatorController {
$nav->addButton( $nav->addButton(
'new', 'new',
pht('New Conversation'), pht('New Conversation'),
$this->getApplicationURI('new/') $this->getApplicationURI('new/'));
);
$nav->addLabel(pht('Unread')); $nav->addLabel(pht('Unread'));
$nav = $this->addConpherencesToNav($unread_conpherences, $nav); $nav = $this->addConpherencesToNav($unread_conpherences, $nav);
$nav->addLabel(pht('Read')); $nav->addLabel(pht('Read'));
@ -129,8 +126,7 @@ abstract class ConpherenceController extends PhabricatorController {
$uri = $this->getApplicationURI('view/'.$conpherence->getID().'/'); $uri = $this->getApplicationURI('view/'.$conpherence->getID().'/');
$data = $conpherence->getDisplayData( $data = $conpherence->getDisplayData(
$user, $user,
null null);
);
$title = $data['title']; $title = $data['title'];
$subtitle = $data['subtitle']; $subtitle = $data['subtitle'];
$unread_count = $data['unread_count']; $unread_count = $data['unread_count'];
@ -185,12 +181,10 @@ abstract class ConpherenceController extends PhabricatorController {
id(new PhabricatorMenuItemView()) id(new PhabricatorMenuItemView())
->setName(pht('New Conversation')) ->setName(pht('New Conversation'))
->setHref($this->getApplicationURI('new/')) ->setHref($this->getApplicationURI('new/'))
->setIcon('create') ->setIcon('create'))
)
->addCrumb( ->addCrumb(
id(new PhabricatorCrumbView()) id(new PhabricatorCrumbView())
->setName(pht('Conpherence')) ->setName(pht('Conpherence')));
);
return $crumbs; return $crumbs;
} }
@ -206,8 +200,7 @@ abstract class ConpherenceController extends PhabricatorController {
'form_pane' => 'conpherence-form', 'form_pane' => 'conpherence-form',
'menu_pane' => 'conpherence-menu', 'menu_pane' => 'conpherence-menu',
'fancy_ajax' => (bool) $this->getSelectedConpherencePHID() 'fancy_ajax' => (bool) $this->getSelectedConpherencePHID()
) ));
);
Javelin::initBehavior('conpherence-init', Javelin::initBehavior('conpherence-init',
array( array(
'selected_conpherence_id' => $this->getSelectedConpherencePHID(), 'selected_conpherence_id' => $this->getSelectedConpherencePHID(),
@ -216,16 +209,14 @@ abstract class ConpherenceController extends PhabricatorController {
'messages' => 'conpherence-messages', 'messages' => 'conpherence-messages',
'widgets_pane' => 'conpherence-widget-pane', 'widgets_pane' => 'conpherence-widget-pane',
'form_pane' => 'conpherence-form' 'form_pane' => 'conpherence-form'
) ));
);
Javelin::initBehavior('conpherence-drag-and-drop-photo', Javelin::initBehavior('conpherence-drag-and-drop-photo',
array( array(
'target' => 'conpherence-header-pane', 'target' => 'conpherence-header-pane',
'form_pane' => 'conpherence-form', 'form_pane' => 'conpherence-form',
'upload_uri' => '/file/dropupload/', 'upload_uri' => '/file/dropupload/',
'activated_class' => 'conpherence-header-upload-photo', 'activated_class' => 'conpherence-header-upload-photo',
) ));
);
} }
} }

View file

@ -59,8 +59,7 @@ final class ConpherenceListController extends
array( array(
'title' => $title, 'title' => $title,
'device' => true, 'device' => true,
) ));
);
} }
private function renderEmptyMainPane() { private function renderEmptyMainPane() {
@ -77,16 +76,14 @@ final class ConpherenceListController extends
'class' => 'conpherence-header-pane', 'class' => 'conpherence-header-pane',
'id' => 'conpherence-header-pane', 'id' => 'conpherence-header-pane',
), ),
'' ''),
),
phutil_tag( phutil_tag(
'div', 'div',
array( array(
'class' => 'conpherence-widget-pane', 'class' => 'conpherence-widget-pane',
'id' => 'conpherence-widget-pane' 'id' => 'conpherence-widget-pane'
), ),
'' ''),
),
javelin_tag( javelin_tag(
'div', 'div',
array( array(
@ -100,19 +97,15 @@ final class ConpherenceListController extends
'class' => 'conpherence-messages', 'class' => 'conpherence-messages',
'id' => 'conpherence-messages' 'id' => 'conpherence-messages'
), ),
'' ''),
),
phutil_tag( phutil_tag(
'div', 'div',
array( array(
'id' => 'conpherence-form' 'id' => 'conpherence-form'
), ),
'' '')
) ))
) ));
)
)
);
} }

View file

@ -44,8 +44,7 @@ final class ConpherenceNewController extends ConpherenceController {
$file_phids = $file_phids =
PhabricatorMarkupEngine::extractFilePHIDsFromEmbeddedFiles( PhabricatorMarkupEngine::extractFilePHIDsFromEmbeddedFiles(
array($message) array($message));
);
if ($file_phids) { if ($file_phids) {
$files = id(new PhabricatorFileQuery()) $files = id(new PhabricatorFileQuery())
->setViewer($user) ->setViewer($user)
@ -70,14 +69,12 @@ final class ConpherenceNewController extends ConpherenceController {
->attachComment( ->attachComment(
id(new ConpherenceTransactionComment()) id(new ConpherenceTransactionComment())
->setContent($message) ->setContent($message)
->setConpherencePHID($conpherence->getPHID()) ->setConpherencePHID($conpherence->getPHID()));
);
$content_source = PhabricatorContentSource::newForSource( $content_source = PhabricatorContentSource::newForSource(
PhabricatorContentSource::SOURCE_WEB, PhabricatorContentSource::SOURCE_WEB,
array( array(
'ip' => $request->getRemoteAddr() 'ip' => $request->getRemoteAddr()
) ));
);
id(new ConpherenceEditor()) id(new ConpherenceEditor())
->setContentSource($content_source) ->setContentSource($content_source)
->setContinueOnNoEffect(true) ->setContinueOnNoEffect(true)
@ -151,16 +148,14 @@ final class ConpherenceNewController extends ConpherenceController {
->setUser($user) ->setUser($user)
->setDatasource('/typeahead/common/users/') ->setDatasource('/typeahead/common/users/')
->setLabel(pht('To')) ->setLabel(pht('To'))
->setError($e_participants) ->setError($e_participants))
)
->appendChild( ->appendChild(
id(new PhabricatorRemarkupControl()) id(new PhabricatorRemarkupControl())
->setName('message') ->setName('message')
->setValue($message) ->setValue($message)
->setLabel(pht('Message')) ->setLabel(pht('Message'))
->setPlaceHolder(pht('Drag and drop to include files...')) ->setPlaceHolder(pht('Drag and drop to include files...'))
->setError($e_message) ->setError($e_message));
);
if ($request->isAjax()) { if ($request->isAjax()) {
$form->setTitle($title); $form->setTitle($title);
@ -172,8 +167,7 @@ final class ConpherenceNewController extends ConpherenceController {
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue(pht('Submit')) ->setValue(pht('Submit'))
->addCancelButton($cancel_uri) ->addCancelButton($cancel_uri));
);
$this->loadStartingConpherences(); $this->loadStartingConpherences();
$this->setSelectedConpherencePHID(null); $this->setSelectedConpherencePHID(null);
@ -194,7 +188,6 @@ final class ConpherenceNewController extends ConpherenceController {
array( array(
'title' => $title, 'title' => $title,
'device' => true, 'device' => true,
) ));
);
} }
} }

View file

@ -56,8 +56,7 @@ final class ConpherenceUpdateController extends
$message = $request->getStr('text'); $message = $request->getStr('text');
$xactions = $editor->generateTransactionsFromText( $xactions = $editor->generateTransactionsFromText(
$conpherence, $conpherence,
$message $message);
);
break; break;
case 'metadata': case 'metadata':
$xactions = array(); $xactions = array();
@ -82,20 +81,17 @@ final class ConpherenceUpdateController extends
0, 0,
0, 0,
ConpherenceImageData::HEAD_WIDTH, ConpherenceImageData::HEAD_WIDTH,
ConpherenceImageData::HEAD_HEIGHT ConpherenceImageData::HEAD_HEIGHT);
);
// this is handled outside the editor for now. no particularly // this is handled outside the editor for now. no particularly
// good reason to move it inside // good reason to move it inside
$conpherence->setImagePHIDs( $conpherence->setImagePHIDs(
array( array(
ConpherenceImageData::SIZE_HEAD => $header_file->getPHID(), ConpherenceImageData::SIZE_HEAD => $header_file->getPHID(),
) ));
);
$conpherence->setImages( $conpherence->setImages(
array( array(
ConpherenceImageData::SIZE_HEAD => $header_file, ConpherenceImageData::SIZE_HEAD => $header_file,
) ));
);
} else { } else {
$e_file[] = $orig_file; $e_file[] = $orig_file;
$errors[] = $errors[] =
@ -112,14 +108,12 @@ final class ConpherenceUpdateController extends
$top, $top,
$left, $left,
ConpherenceImageData::HEAD_WIDTH, ConpherenceImageData::HEAD_WIDTH,
ConpherenceImageData::HEAD_HEIGHT ConpherenceImageData::HEAD_HEIGHT);
);
$image_phid = $xformed->getPHID(); $image_phid = $xformed->getPHID();
$xactions[] = id(new ConpherenceTransaction()) $xactions[] = id(new ConpherenceTransaction())
->setTransactionType( ->setTransactionType(
ConpherenceTransactionType::TYPE_PICTURE_CROP ConpherenceTransactionType::TYPE_PICTURE_CROP)
)
->setNewValue($image_phid); ->setNewValue($image_phid);
} }
if ($title != $conpherence->getTitle()) { if ($title != $conpherence->getTitle()) {
@ -143,15 +137,13 @@ final class ConpherenceUpdateController extends
} }
} else if (empty($errors)) { } else if (empty($errors)) {
$errors[] = pht( $errors[] = pht(
'That was a non-update. Try cancel.' 'That was a non-update. Try cancel.');
);
} }
} }
if ($updated) { if ($updated) {
return id(new AphrontRedirectResponse())->setURI( return id(new AphrontRedirectResponse())->setURI(
$this->getApplicationURI($conpherence_id.'/') $this->getApplicationURI($conpherence_id.'/'));
);
} }
if ($errors) { if ($errors) {
@ -166,8 +158,7 @@ final class ConpherenceUpdateController extends
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setLabel(pht('Title')) ->setLabel(pht('Title'))
->setName('title') ->setName('title')
->setValue($conpherence->getTitle()) ->setValue($conpherence->getTitle()));
);
$image = $conpherence->getImage(ConpherenceImageData::SIZE_ORIG); $image = $conpherence->getImage(ConpherenceImageData::SIZE_ORIG);
if ($image) { if ($image) {
@ -180,28 +171,23 @@ final class ConpherenceUpdateController extends
array( array(
'src' => 'src' =>
$conpherence->loadImageURI(ConpherenceImageData::SIZE_HEAD), $conpherence->loadImageURI(ConpherenceImageData::SIZE_HEAD),
)) ))))
)
)
->appendChild( ->appendChild(
id(new AphrontFormCropControl()) id(new AphrontFormCropControl())
->setLabel(pht('Crop Image')) ->setLabel(pht('Crop Image'))
->setValue($image) ->setValue($image)
->setWidth(ConpherenceImageData::HEAD_WIDTH) ->setWidth(ConpherenceImageData::HEAD_WIDTH)
->setHeight(ConpherenceImageData::HEAD_HEIGHT) ->setHeight(ConpherenceImageData::HEAD_HEIGHT))
)
->appendChild( ->appendChild(
id(new ConpherenceFormDragAndDropUploadControl()) id(new ConpherenceFormDragAndDropUploadControl())
->setLabel(pht('Change Image')) ->setLabel(pht('Change Image')));
);
} else { } else {
$form $form
->appendChild( ->appendChild(
id(new ConpherenceFormDragAndDropUploadControl()) id(new ConpherenceFormDragAndDropUploadControl())
->setLabel(pht('Image')) ->setLabel(pht('Image')));
);
} }
require_celerity_resource('conpherence-update-css'); require_celerity_resource('conpherence-update-css');
@ -216,7 +202,6 @@ final class ConpherenceUpdateController extends
->appendChild($error_view) ->appendChild($error_view)
->appendChild($form) ->appendChild($form)
->addSubmitButton() ->addSubmitButton()
->addCancelButton($this->getApplicationURI($conpherence->getID().'/')) ->addCancelButton($this->getApplicationURI($conpherence->getID().'/')));
);
} }
} }

View file

@ -63,8 +63,7 @@ final class ConpherenceViewController extends
$conpherence = $this->getConpherence(); $conpherence = $this->getConpherence();
$display_data = $conpherence->getDisplayData( $display_data = $conpherence->getDisplayData(
$user, $user,
ConpherenceImageData::SIZE_HEAD ConpherenceImageData::SIZE_HEAD);
);
$edit_href = $this->getApplicationURI('update/'.$conpherence->getID().'/'); $edit_href = $this->getApplicationURI('update/'.$conpherence->getID().'/');
$class_mod = $display_data['image_class']; $class_mod = $display_data['image_class'];
@ -74,8 +73,7 @@ final class ConpherenceViewController extends
array( array(
'class' => 'upload-photo' 'class' => 'upload-photo'
), ),
pht('Drop photo here to change this Conpherence photo.') pht('Drop photo here to change this Conpherence photo.')).
).
javelin_tag( javelin_tag(
'a', 'a',
array( array(
@ -83,30 +81,26 @@ final class ConpherenceViewController extends
'href' => $edit_href, 'href' => $edit_href,
'sigil' => 'workflow edit-action', 'sigil' => 'workflow edit-action',
), ),
'' '').
).
phutil_tag( phutil_tag(
'div', 'div',
array( array(
'class' => $class_mod.'header-image', 'class' => $class_mod.'header-image',
'style' => 'background-image: url('.$display_data['image'].');' 'style' => 'background-image: url('.$display_data['image'].');'
), ),
'' '').
).
phutil_tag( phutil_tag(
'div', 'div',
array( array(
'class' => $class_mod.'title', 'class' => $class_mod.'title',
), ),
$display_data['title'] $display_data['title']).
).
phutil_tag( phutil_tag(
'div', 'div',
array( array(
'class' => $class_mod.'subtitle', 'class' => $class_mod.'subtitle',
), ),
$display_data['subtitle'] $display_data['subtitle']);
);
return array('header' => $header); return array('header' => $header);
} }
@ -154,12 +148,10 @@ final class ConpherenceViewController extends
->appendChild( ->appendChild(
id(new PhabricatorRemarkupControl()) id(new PhabricatorRemarkupControl())
->setUser($user) ->setUser($user)
->setName('text') ->setName('text'))
)
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue(pht('Pontificate')) ->setValue(pht('Pontificate')))->render();
)->render();
$scrollbutton = javelin_tag( $scrollbutton = javelin_tag(
'a', 'a',

View file

@ -60,8 +60,7 @@ final class ConpherenceWidgetController extends
'widgets-tasks' => 1, 'widgets-tasks' => 1,
'widgets-calendar' => 1, 'widgets-calendar' => 1,
) )
) ));
);
$conpherence = $this->getConpherence(); $conpherence = $this->getConpherence();
@ -82,8 +81,7 @@ final class ConpherenceWidgetController extends
'id' => 'widgets-files-toggle', 'id' => 'widgets-files-toggle',
'class' => 'sprite-conpher conpher_files_off first-icon' 'class' => 'sprite-conpher conpher_files_off first-icon'
), ),
'' ''),
),
javelin_tag( javelin_tag(
'a', 'a',
array( array(
@ -95,8 +93,7 @@ final class ConpherenceWidgetController extends
'id' => 'widgets-tasks-toggle', 'id' => 'widgets-tasks-toggle',
'class' => 'sprite-conpher conpher_list_off conpher_list_on', 'class' => 'sprite-conpher conpher_list_off conpher_list_on',
), ),
'' ''),
),
javelin_tag( javelin_tag(
'a', 'a',
array( array(
@ -108,10 +105,8 @@ final class ConpherenceWidgetController extends
'id' => 'widgets-calendar-toggle', 'id' => 'widgets-calendar-toggle',
'class' => 'sprite-conpher conpher_calendar_off', 'class' => 'sprite-conpher conpher_calendar_off',
), ),
'' '')
) )).
)
).
phutil_tag( phutil_tag(
'div', 'div',
array( array(
@ -119,16 +114,14 @@ final class ConpherenceWidgetController extends
'id' => 'widgets-files', 'id' => 'widgets-files',
'style' => 'display: none;' 'style' => 'display: none;'
), ),
$this->renderFilesWidgetPaneContent() $this->renderFilesWidgetPaneContent()).
).
phutil_tag( phutil_tag(
'div', 'div',
array( array(
'class' => 'widgets-body', 'class' => 'widgets-body',
'id' => 'widgets-tasks', 'id' => 'widgets-tasks',
), ),
$this->renderTaskWidgetPaneContent() $this->renderTaskWidgetPaneContent()).
).
phutil_tag( phutil_tag(
'div', 'div',
array( array(
@ -136,8 +129,7 @@ final class ConpherenceWidgetController extends
'id' => 'widgets-calendar', 'id' => 'widgets-calendar',
'style' => 'display: none;' 'style' => 'display: none;'
), ),
$this->renderCalendarWidgetPaneContent() $this->renderCalendarWidgetPaneContent());
);
return array('widgets' => $widgets); return array('widgets' => $widgets);
} }
@ -156,8 +148,7 @@ final class ConpherenceWidgetController extends
array( array(
'src' => $thumb 'src' => $thumb
), ),
'' ''),
),
$file->getName() $file->getName()
); );
} }
@ -193,8 +184,7 @@ final class ConpherenceWidgetController extends
array( array(
'href' => '/T'.$task->getID() 'href' => '/T'.$task->getID()
), ),
$task->getTitle() $task->getTitle())
)
); );
} }
$table = id(new AphrontTableView($data)) $table = id(new AphrontTableView($data))
@ -244,12 +234,10 @@ final class ConpherenceWidgetController extends
$epoch_range = phabricator_format_local_time( $epoch_range = phabricator_format_local_time(
$status->getDateFrom(), $status->getDateFrom(),
$user, $user,
$time_str $time_str) . ' - ' . phabricator_format_local_time(
) . ' - ' . phabricator_format_local_time(
$status->getDateTo(), $status->getDateTo(),
$user, $user,
$time_str $time_str);
);
$content[] = phutil_tag( $content[] = phutil_tag(
'div', 'div',
@ -262,31 +250,26 @@ final class ConpherenceWidgetController extends
array( array(
'class' => 'epoch-range' 'class' => 'epoch-range'
), ),
$epoch_range $epoch_range),
),
phutil_tag( phutil_tag(
'div', 'div',
array( array(
'class' => 'icon', 'class' => 'icon',
), ),
'' ''),
),
phutil_tag( phutil_tag(
'div', 'div',
array( array(
'class' => 'description' 'class' => 'description'
), ),
$status->getTerseSummary($user) $status->getTerseSummary($user)),
),
phutil_tag( phutil_tag(
'div', 'div',
array( array(
'class' => 'participant' 'class' => 'participant'
), ),
$handles[$status->getUserPHID()]->getName() $handles[$status->getUserPHID()]->getName())
) ));
)
);
} }
} }
} }

View file

@ -12,8 +12,7 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor {
$files = array(); $files = array();
$file_phids = $file_phids =
PhabricatorMarkupEngine::extractFilePHIDsFromEmbeddedFiles( PhabricatorMarkupEngine::extractFilePHIDsFromEmbeddedFiles(
array($text) array($text));
);
// Since these are extracted from text, we might be re-including the // Since these are extracted from text, we might be re-including the
// same file -- e.g. a mock under discussion. Filter files we // same file -- e.g. a mock under discussion. Filter files we
// already have. // already have.
@ -36,8 +35,7 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor {
->attachComment( ->attachComment(
id(new ConpherenceTransactionComment()) id(new ConpherenceTransactionComment())
->setContent($text) ->setContent($text)
->setConpherencePHID($conpherence->getPHID()) ->setConpherencePHID($conpherence->getPHID()));
);
return $xactions; return $xactions;
} }
@ -99,14 +97,12 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor {
case ConpherenceTransactionType::TYPE_PICTURE: case ConpherenceTransactionType::TYPE_PICTURE:
$object->setImagePHID( $object->setImagePHID(
$xaction->getNewValue(), $xaction->getNewValue(),
ConpherenceImageData::SIZE_ORIG ConpherenceImageData::SIZE_ORIG);
);
break; break;
case ConpherenceTransactionType::TYPE_PICTURE_CROP: case ConpherenceTransactionType::TYPE_PICTURE_CROP:
$object->setImagePHID( $object->setImagePHID(
$xaction->getNewValue(), $xaction->getNewValue(),
ConpherenceImageData::SIZE_HEAD ConpherenceImageData::SIZE_HEAD);
);
break; break;
} }
} }
@ -127,8 +123,7 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor {
$editor->addEdge( $editor->addEdge(
$object->getPHID(), $object->getPHID(),
$edge_type, $edge_type,
$file_phid $file_phid);
);
} }
$editor->save(); $editor->save();
// fallthrough // fallthrough
@ -205,8 +200,7 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor {
if (!$title) { if (!$title) {
$title = pht( $title = pht(
'%s sent you a message.', '%s sent you a message.',
$this->getActor()->getUserName() $this->getActor()->getUserName());
);
} }
$phid = $object->getPHID(); $phid = $object->getPHID();

View file

@ -28,8 +28,7 @@ final class ConpherencePeopleMenuEventListener extends PhutilEventListener {
->setIsExternal(true) ->setIsExternal(true)
->setName($name) ->setName($name)
->setHref($conpherence_uri) ->setHref($conpherence_uri)
->setKey($name) ->setKey($name));
);
$event->setValue('menu', $menu); $event->setValue('menu', $menu);
} }

View file

@ -49,8 +49,7 @@ final class ConpherenceReplyHandler extends PhabricatorMailReplyHandler {
$edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE; $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE;
$file_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( $file_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$conpherence->getPHID(), $conpherence->getPHID(),
$edge_type $edge_type);
);
$conpherence->attachFilePHIDs($file_phids); $conpherence->attachFilePHIDs($file_phids);
$participants = id(new ConpherenceParticipant()) $participants = id(new ConpherenceParticipant())
->loadAllWhere('conpherencePHID = %s', $conpherence->getPHID()); ->loadAllWhere('conpherencePHID = %s', $conpherence->getPHID());
@ -75,8 +74,7 @@ final class ConpherenceReplyHandler extends PhabricatorMailReplyHandler {
$body = $this->enhanceBodyWithAttachments( $body = $this->enhanceBodyWithAttachments(
$body, $body,
$file_phids, $file_phids,
'{F%d}' '{F%d}');
);
$xactions = array(); $xactions = array();
if ($this->getMailAddedParticipantPHIDs()) { if ($this->getMailAddedParticipantPHIDs()) {
@ -89,9 +87,7 @@ final class ConpherenceReplyHandler extends PhabricatorMailReplyHandler {
$xactions, $xactions,
$editor->generateTransactionsFromText( $editor->generateTransactionsFromText(
$conpherence, $conpherence,
$body $body));
)
);
$editor->applyTransactions($conpherence, $xactions); $editor->applyTransactions($conpherence, $xactions);

View file

@ -73,8 +73,7 @@ final class ConpherenceParticipantQuery
$where[] = qsprintf( $where[] = qsprintf(
$conn_r, $conn_r,
'participationStatus = %d', 'participationStatus = %d',
$this->participationStatus $this->participationStatus);
);
} }
if ($this->dateTouched) { if ($this->dateTouched) {
@ -83,8 +82,7 @@ final class ConpherenceParticipantQuery
$conn_r, $conn_r,
'dateTouched %Q %d', 'dateTouched %Q %d',
$this->dateTouchedSort, $this->dateTouchedSort,
$this->dateTouched $this->dateTouched);
);
} }
} }

View file

@ -101,8 +101,7 @@ final class ConpherenceThreadQuery
$conpherence_participants = mpull( $conpherence_participants = mpull(
$conpherence_participants, $conpherence_participants,
null, null,
'getParticipantPHID' 'getParticipantPHID');
);
$current_conpherence->attachParticipants($conpherence_participants); $current_conpherence->attachParticipants($conpherence_participants);
} }
@ -163,20 +162,17 @@ final class ConpherenceThreadQuery
$start_of_week = phabricator_format_local_time( $start_of_week = phabricator_format_local_time(
strtotime('today'), strtotime('today'),
$this->getViewer(), $this->getViewer(),
'U' 'U');
);
$end_of_week = phabricator_format_local_time( $end_of_week = phabricator_format_local_time(
strtotime('midnight +1 week'), strtotime('midnight +1 week'),
$this->getViewer(), $this->getViewer(),
'U' 'U');
);
$statuses = id(new PhabricatorUserStatus()) $statuses = id(new PhabricatorUserStatus())
->loadAllWhere( ->loadAllWhere(
'userPHID in (%Ls) AND dateTo >= %d AND dateFrom <= %d', 'userPHID in (%Ls) AND dateTo >= %d AND dateFrom <= %d',
$participant_phids, $participant_phids,
$start_of_week, $start_of_week,
$end_of_week $end_of_week);
);
$statuses = mgroup($statuses, 'getUserPHID'); $statuses = mgroup($statuses, 'getUserPHID');
// attached files // attached files
@ -208,15 +204,13 @@ final class ConpherenceThreadQuery
private function loadOrigPics(array $conpherences) { private function loadOrigPics(array $conpherences) {
return $this->loadPics( return $this->loadPics(
$conpherences, $conpherences,
ConpherenceImageData::SIZE_ORIG ConpherenceImageData::SIZE_ORIG);
);
} }
private function loadHeaderPics(array $conpherences) { private function loadHeaderPics(array $conpherences) {
return $this->loadPics( return $this->loadPics(
$conpherences, $conpherences,
ConpherenceImageData::SIZE_HEAD ConpherenceImageData::SIZE_HEAD);
);
} }
private function loadPics(array $conpherences, $size) { private function loadPics(array $conpherences, $size) {

View file

@ -130,8 +130,7 @@ final class ConpherenceThread extends ConpherenceDAO
return array_slice( return array_slice(
$this->transactions, $this->transactions,
$length - $begin - $amount, $length - $begin - $amount,
$amount $amount);
);
} }
public function attachFilePHIDs(array $file_phids) { public function attachFilePHIDs(array $file_phids) {
@ -209,8 +208,7 @@ final class ConpherenceThread extends ConpherenceDAO
if ($snippet === null) { if ($snippet === null) {
$snippet = phutil_utf8_shorten( $snippet = phutil_utf8_shorten(
$transaction->getComment()->getContent(), $transaction->getComment()->getContent(),
48 48);
);
if ($transaction->getAuthorPHID() == $user->getPHID()) { if ($transaction->getAuthorPHID() == $user->getPHID()) {
$snippet = "\xE2\x86\xB0 " . $snippet; $snippet = "\xE2\x86\xB0 " . $snippet;
} }

View file

@ -25,8 +25,7 @@ final class ConpherenceFormDragAndDropUploadControl extends AphrontFormControl {
'form_pane' => 'conpherence-form', 'form_pane' => 'conpherence-form',
'upload_uri' => '/file/dropupload/', 'upload_uri' => '/file/dropupload/',
'activated_class' => 'conpherence-dialogue-upload-photo', 'activated_class' => 'conpherence-dialogue-upload-photo',
) ));
);
require_celerity_resource('conpherence-update-css'); require_celerity_resource('conpherence-update-css');
return phutil_tag( return phutil_tag(
@ -35,8 +34,7 @@ final class ConpherenceFormDragAndDropUploadControl extends AphrontFormControl {
'id' => $drop_id, 'id' => $drop_id,
'class' => 'conpherence-dialogue-drag-photo', 'class' => 'conpherence-dialogue-drag-photo',
), ),
pht('Drag and drop an image here to upload it.') pht('Drag and drop an image here to upload it.'));
);
} }
} }

View file

@ -87,8 +87,7 @@ final class ConpherenceTransactionView extends AphrontView {
array( array(
'class' => $content_class 'class' => $content_class
), ),
$this->renderSingleView($content)) $this->renderSingleView($content)));
);
return $transaction_view->render(); return $transaction_view->render();
} }

View file

@ -76,8 +76,7 @@ final class ConduitAPI_differential_finishpostponedlinters_Method
$messages_property = id(new DifferentialDiffProperty())->loadOneWhere( $messages_property = id(new DifferentialDiffProperty())->loadOneWhere(
'diffID = %d AND name = %s', 'diffID = %d AND name = %s',
$diff_id, $diff_id,
'arc:lint' 'arc:lint');
);
if ($messages_property) { if ($messages_property) {
$messages = $messages_property->getData(); $messages = $messages_property->getData();
} else { } else {

View file

@ -51,8 +51,7 @@ final class ConduitAPI_differential_setdiffproperty_Method
$messages_property = id(new DifferentialDiffProperty())->loadOneWhere( $messages_property = id(new DifferentialDiffProperty())->loadOneWhere(
'diffID = %d AND name = %s', 'diffID = %d AND name = %s',
$diff_id, $diff_id,
'arc:lint' 'arc:lint');
);
if ($messages_property) { if ($messages_property) {
$results = $messages_property->getData(); $results = $messages_property->getData();
} else { } else {

View file

@ -50,8 +50,7 @@ final class ConduitAPI_differential_updateunitresults_Method
$diff_property = id(new DifferentialDiffProperty())->loadOneWhere( $diff_property = id(new DifferentialDiffProperty())->loadOneWhere(
'diffID = %d AND name = %s', 'diffID = %d AND name = %s',
$diff_id, $diff_id,
'arc:unit' 'arc:unit');
);
if (!$diff_property) { if (!$diff_property) {
throw new ConduitException('ERR_NO_RESULTS'); throw new ConduitException('ERR_NO_RESULTS');

View file

@ -23,8 +23,7 @@ final class DifferentialRevisionStatsController extends DifferentialController {
$phid, $phid,
$phid, $phid,
$this->filter, $this->filter,
$phid $phid);
);
return $table->loadAllFromArray($rows); return $table->loadAllFromArray($rows);
} }
@ -46,8 +45,7 @@ final class DifferentialRevisionStatsController extends DifferentialController {
$phid, $phid,
$phid, $phid,
$this->filter, $this->filter,
$phid $phid);
);
return $table->loadAllFromArray($rows); return $table->loadAllFromArray($rows);
} }
@ -60,8 +58,7 @@ final class DifferentialRevisionStatsController extends DifferentialController {
$diff_teml = new DifferentialDiff(); $diff_teml = new DifferentialDiff();
$diffs = $diff_teml->loadAllWhere( $diffs = $diff_teml->loadAllWhere(
'revisionID in (%Ld)', 'revisionID in (%Ld)',
array_keys($revisions) array_keys($revisions));
);
return $diffs; return $diffs;
} }

View file

@ -157,16 +157,14 @@ final class DifferentialRevisionViewController extends DifferentialController {
'p', 'p',
array(), array(),
pht('All specified reviewers are disabled and this revision '. pht('All specified reviewers are disabled and this revision '.
'needs review. You may want to add some new reviewers.') 'needs review. You may want to add some new reviewers.')));
));
} else { } else {
$reviewer_warning->appendChild( $reviewer_warning->appendChild(
phutil_tag( phutil_tag(
'p', 'p',
array(), array(),
pht('This revision has no specified reviewers and needs '. pht('This revision has no specified reviewers and needs '.
'review. You may want to add some reviewers.') 'review. You may want to add some reviewers.')));
));
} }
} }
} }

View file

@ -28,8 +28,7 @@ final class DifferentialPeopleMenuEventListener extends PhutilEventListener {
->setIsExternal(true) ->setIsExternal(true)
->setHref($href) ->setHref($href)
->setName($name) ->setName($name)
->setKey($name) ->setKey($name));
);
$event->setValue('menu', $menu); $event->setValue('menu', $menu);
} }

View file

@ -159,8 +159,7 @@ final class DifferentialChangesetParser {
return $parser->parseHunksForHighlightMasks( return $parser->parseHunksForHighlightMasks(
$changeset->getHunks(), $changeset->getHunks(),
$this->originalLeft->getHunks(), $this->originalLeft->getHunks(),
$this->originalRight->getHunks() $this->originalRight->getHunks());
);
} }
/** /**
@ -890,8 +889,7 @@ final class DifferentialChangesetParser {
$mask_force, $mask_force,
$feedback_mask, $feedback_mask,
$range_start, $range_start,
$range_len $range_len);
);
$renderer $renderer
->setGaps($gaps) ->setGaps($gaps)
@ -901,8 +899,7 @@ final class DifferentialChangesetParser {
$html = $renderer->renderTextChange( $html = $renderer->renderTextChange(
$range_start, $range_start,
$range_len, $range_len,
$rows $rows);
);
return $renderer->renderChangesetTable($html); return $renderer->renderChangesetTable($html);
} }

View file

@ -27,9 +27,7 @@ final class DifferentialChangesetTwoUpRenderer
'colspan' => 6, 'colspan' => 6,
'class' => 'show-more' 'class' => 'show-more'
), ),
pht('Context not available.') pht('Context not available.')));
)
);
} }
$html = array(); $html = array();
@ -375,9 +373,7 @@ final class DifferentialChangesetTwoUpRenderer
'img', 'img',
array( array(
'src' => $old_file->getBestURI(), 'src' => $old_file->getBestURI(),
) )));
)
);
} }
$new = null; $new = null;
@ -391,9 +387,7 @@ final class DifferentialChangesetTwoUpRenderer
'img', 'img',
array( array(
'src' => $new_file->getBestURI(), 'src' => $new_file->getBestURI(),
) )));
)
);
} }
$html_old = array(); $html_old = array();

View file

@ -34,8 +34,7 @@ final class DifferentialSearchIndexer
foreach ($aux_fields as $aux_field) { foreach ($aux_fields as $aux_field) {
$doc->addField( $doc->addField(
$aux_field->getKeyForSearchIndex(), $aux_field->getKeyForSearchIndex(),
$aux_field->getValueForSearchIndex() $aux_field->getValueForSearchIndex());
);
} }
$doc->addRelationship( $doc->addRelationship(

View file

@ -123,8 +123,7 @@ final class DifferentialRevisionDetailView extends AphrontView {
id(new PhabricatorTagView()) id(new PhabricatorTagView())
->setType(PhabricatorTagView::TYPE_STATE) ->setType(PhabricatorTagView::TYPE_STATE)
->setName($status_name) ->setName($status_name)
->setBackgroundColor($status_color) ->setBackgroundColor($status_color));
);
return $view; return $view;
} }

View file

@ -38,8 +38,7 @@ final class ConduitAPI_diffusion_getrecentcommitsbypath_Method
$limit = nonempty( $limit = nonempty(
$request->getValue('limit'), $request->getValue('limit'),
self::DEFAULT_LIMIT self::DEFAULT_LIMIT);
);
$history = DiffusionHistoryQuery::newFromDiffusionRequest($drequest) $history = DiffusionHistoryQuery::newFromDiffusionRequest($drequest)
->setLimit($limit) ->setLimit($limit)

View file

@ -40,8 +40,7 @@ final class DiffusionCommitController extends DiffusionController {
->setTitle('Error displaying commit.') ->setTitle('Error displaying commit.')
->appendChild('Failed to load the commit because the commit has not '. ->appendChild('Failed to load the commit because the commit has not '.
'been parsed yet.'), 'been parsed yet.'),
array('title' => 'Commit Still Parsing') array('title' => 'Commit Still Parsing'));
);
} }
$commit_data = $drequest->loadCommitData(); $commit_data = $drequest->loadCommitData();
@ -83,8 +82,7 @@ final class DiffusionCommitController extends DiffusionController {
$commit_properties = $this->loadCommitProperties( $commit_properties = $this->loadCommitProperties(
$commit, $commit,
$commit_data, $commit_data,
$parent_query->loadParents() $parent_query->loadParents());
);
$property_list = id(new PhabricatorPropertyListView()) $property_list = id(new PhabricatorPropertyListView())
->setHasKeyboardShortcuts(true); ->setHasKeyboardShortcuts(true);
foreach ($commit_properties as $key => $value) { foreach ($commit_properties as $key => $value) {
@ -280,8 +278,7 @@ final class DiffusionCommitController extends DiffusionController {
$change_list_title = DiffusionView::nameCommit( $change_list_title = DiffusionView::nameCommit(
$repository, $repository,
$commit->getCommitIdentifier() $commit->getCommitIdentifier());
);
$change_list = new DifferentialChangesetListView(); $change_list = new DifferentialChangesetListView();
$change_list->setTitle($change_list_title); $change_list->setTitle($change_list_title);
$change_list->setChangesets($changesets); $change_list->setChangesets($changesets);
@ -320,8 +317,7 @@ final class DiffusionCommitController extends DiffusionController {
$commit_id = 'r'.$callsign.$commit->getCommitIdentifier(); $commit_id = 'r'.$callsign.$commit->getCommitIdentifier();
$short_name = DiffusionView::nameCommit( $short_name = DiffusionView::nameCommit(
$repository, $repository,
$commit->getCommitIdentifier() $commit->getCommitIdentifier());
);
$crumbs = $this->buildCrumbs(array( $crumbs = $this->buildCrumbs(array(
'commit' => true, 'commit' => true,
@ -351,8 +347,7 @@ final class DiffusionCommitController extends DiffusionController {
$content, $content,
array( array(
'title' => $commit_id 'title' => $commit_id
) ));
);
} }
private function loadCommitProperties( private function loadCommitProperties(
@ -373,11 +368,9 @@ final class DiffusionCommitController extends DiffusionController {
->execute(); ->execute();
$task_phids = array_keys( $task_phids = array_keys(
$edges[$commit_phid][PhabricatorEdgeConfig::TYPE_COMMIT_HAS_TASK] $edges[$commit_phid][PhabricatorEdgeConfig::TYPE_COMMIT_HAS_TASK]);
);
$proj_phids = array_keys( $proj_phids = array_keys(
$edges[$commit_phid][PhabricatorEdgeConfig::TYPE_COMMIT_HAS_PROJECT] $edges[$commit_phid][PhabricatorEdgeConfig::TYPE_COMMIT_HAS_PROJECT]);
);
$phids = array_merge($task_phids, $proj_phids); $phids = array_merge($task_phids, $proj_phids);
if ($data->getCommitDetail('authorPHID')) { if ($data->getCommitDetail('authorPHID')) {

View file

@ -24,8 +24,7 @@ final class DiffusionCommitEditController extends DiffusionController {
$edge_type = PhabricatorEdgeConfig::TYPE_COMMIT_HAS_PROJECT; $edge_type = PhabricatorEdgeConfig::TYPE_COMMIT_HAS_PROJECT;
$current_proj_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( $current_proj_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$commit_phid, $commit_phid,
$edge_type $edge_type);
);
$handles = $this->loadViewerHandles($current_proj_phids); $handles = $this->loadViewerHandles($current_proj_phids);
$proj_t_values = mpull($handles, 'getFullName', 'getPHID'); $proj_t_values = mpull($handles, 'getFullName', 'getPHID');

View file

@ -188,14 +188,12 @@ abstract class DiffusionController extends PhabricatorController {
$crumb = new PhabricatorCrumbView(); $crumb = new PhabricatorCrumbView();
if ($spec['commit']) { if ($spec['commit']) {
$crumb->setName( $crumb->setName(
"Tags for r{$callsign}{$raw_commit}" "Tags for r{$callsign}{$raw_commit}");
);
$crumb->setHref($drequest->generateURI( $crumb->setHref($drequest->generateURI(
array( array(
'action' => 'commit', 'action' => 'commit',
'commit' => $raw_commit, 'commit' => $raw_commit,
)) )));
);
} else { } else {
$crumb->setName('Tags'); $crumb->setName('Tags');
} }
@ -264,8 +262,7 @@ abstract class DiffusionController extends PhabricatorController {
$crumb->setHref($drequest->generateURI( $crumb->setHref($drequest->generateURI(
array( array(
'path' => '', 'path' => '',
) + $uri_params) ) + $uri_params));
);
$crumb_list[] = $crumb; $crumb_list[] = $crumb;
$path_parts = explode('/', $path); $path_parts = explode('/', $path);

View file

@ -27,8 +27,7 @@ final class DiffusionPeopleMenuEventListener extends PhutilEventListener {
->setIsExternal(true) ->setIsExternal(true)
->setHref($href) ->setHref($href)
->setName($name) ->setName($name)
->setKey($name) ->setKey($name));
);
$event->setValue('menu', $menu); $event->setValue('menu', $menu);
} }

View file

@ -13,8 +13,7 @@ final class DiffusionGitBranchQuery extends DiffusionBranchQuery {
list($stdout) = $repository->execxLocalCommand( list($stdout) = $repository->execxLocalCommand(
'for-each-ref %C --sort=-creatordate --format=%s refs/remotes', 'for-each-ref %C --sort=-creatordate --format=%s refs/remotes',
$count ? '--count='.(int)$count : null, $count ? '--count='.(int)$count : null,
'%(refname:short) %(objectname)' '%(refname:short) %(objectname)');
);
$branch_list = self::parseGitRemoteBranchOutput( $branch_list = self::parseGitRemoteBranchOutput(
$stdout, $stdout,

View file

@ -8,8 +8,7 @@ final class DiffusionGitExistsQuery extends DiffusionExistsQuery {
list($err, $merge_base) = $repository->execLocalCommand( list($err, $merge_base) = $repository->execLocalCommand(
'cat-file -t %s', 'cat-file -t %s',
$request->getCommit() $request->getCommit());
);
return !$err; return !$err;
} }

View file

@ -8,8 +8,7 @@ final class DiffusionMercurialExistsQuery extends DiffusionExistsQuery {
list($err, $stdout) = $repository->execLocalCommand( list($err, $stdout) = $repository->execLocalCommand(
'id --rev %s', 'id --rev %s',
$request->getCommit() $request->getCommit());
);
return !$err; return !$err;

View file

@ -8,8 +8,7 @@ final class DiffusionSvnExistsQuery extends DiffusionExistsQuery {
list($info) = $repository->execxRemoteCommand( list($info) = $repository->execxRemoteCommand(
'info %s', 'info %s',
$repository->getRemoteURI() $repository->getRemoteURI());
);
$matches = null; $matches = null;
$exists = false; $exists = false;

View file

@ -12,8 +12,7 @@ final class DiffusionGitTagListQuery extends DiffusionTagListQuery {
'for-each-ref %C --sort=-creatordate --format=%s refs/tags', 'for-each-ref %C --sort=-creatordate --format=%s refs/tags',
$count ? '--count='.(int)$count : null, $count ? '--count='.(int)$count : null,
'%(objectname) %(objecttype) %(refname) %(*objectname) %(*objecttype) '. '%(objectname) %(objecttype) %(refname) %(*objectname) %(*objecttype) '.
'%(subject)%01%(creator)' '%(subject)%01%(creator)');
);
$stdout = trim($stdout); $stdout = trim($stdout);
if (!strlen($stdout)) { if (!strlen($stdout)) {

View file

@ -45,8 +45,7 @@ final class DiffusionBranchTableView extends DiffusionView {
'branch' => $branch->getName(), 'branch' => $branch->getName(),
)) ))
), ),
'History' 'History'),
),
phutil_tag( phutil_tag(
'a', 'a',
array( array(

View file

@ -49,8 +49,7 @@ final class DiffusionEmptyResultView extends DiffusionView {
'text' => 'existed', 'text' => 'existed',
'commit' => $existed, 'commit' => $existed,
'params' => array('view' => $this->view), 'params' => array('view' => $this->view),
) ));
);
$title = 'Path Was Deleted'; $title = 'Path Was Deleted';
$body = hsprintf( $body = hsprintf(

View file

@ -108,8 +108,7 @@ final class PhabricatorFeedStoryPublisher {
foreach ($uris as $uri) { foreach ($uris as $uri) {
$task = PhabricatorWorker::scheduleTask( $task = PhabricatorWorker::scheduleTask(
'FeedPublisherWorker', 'FeedPublisherWorker',
array('chrono_key' => $chrono_key, 'uri' => $uri) array('chrono_key' => $chrono_key, 'uri' => $uri));
);
} }
return $story; return $story;

View file

@ -34,12 +34,13 @@ final class PhabricatorFeedStoryProject extends PhabricatorFeedStory {
} }
break; break;
case PhabricatorProjectTransactionType::TYPE_STATUS: case PhabricatorProjectTransactionType::TYPE_STATUS:
$old_name = PhabricatorProjectStatus::getNameForStatus($old);
$new_name = PhabricatorProjectStatus::getNameForStatus($new);
$action = hsprintf( $action = hsprintf(
'changed project %s status from %s to %s.', 'changed project %s status from %s to %s.',
$this->linkTo($proj_phid), $this->linkTo($proj_phid),
$this->renderString(PhabricatorProjectStatus::getNameForStatus($old)), $this->renderString($old_name),
$this->renderString(PhabricatorProjectStatus::getNameForStatus($new)) $this->renderString($new_name));
);
break; break;
case PhabricatorProjectTransactionType::TYPE_MEMBERS: case PhabricatorProjectTransactionType::TYPE_MEMBERS:
$add = array_diff($new, $old); $add = array_diff($new, $old);

View file

@ -69,15 +69,13 @@ final class PhabricatorImageTransformer {
$top, $top,
$left, $left,
$width, $width,
$height $height);
);
return PhabricatorFile::newFromFileData( return PhabricatorFile::newFromFileData(
$image, $image,
array( array(
'name' => 'conpherence-'.$file->getName(), 'name' => 'conpherence-'.$file->getName(),
) ));
);
} }
private function crudelyCropTo(PhabricatorFile $file, $x, $min_y, $max_y) { private function crudelyCropTo(PhabricatorFile $file, $x, $min_y, $max_y) {
@ -126,8 +124,7 @@ final class PhabricatorImageTransformer {
0, 0, 0, 0,
$orig_x, $orig_y, $orig_x, $orig_y,
$w, $h, $w, $h,
$orig_w, $orig_h $orig_w, $orig_h);
);
return $this->saveImageDataInAnyFormat($dst, $file->getMimeType()); return $this->saveImageDataInAnyFormat($dst, $file->getMimeType());
} }
@ -409,8 +406,7 @@ final class PhabricatorImageTransformer {
list($err) = exec_manual( list($err) = exec_manual(
'convert %s -coalesce -resize %sX%s\! %s' 'convert %s -coalesce -resize %sX%s\! %s'
, $input, $sdx, $sdy, $resized , $input, $sdx, $sdy, $resized);
);
if (!$err) { if (!$err) {
$new_data = Filesystem::readFile($resized); $new_data = Filesystem::readFile($resized);

View file

@ -22,8 +22,7 @@ final class PhabricatorFilesManagementMetadataWorkflow
'name' => 'dry-run', 'name' => 'dry-run',
'help' => 'Show what would be updated.', 'help' => 'Show what would be updated.',
), ),
) ));
);
} }
public function execute(PhutilArgumentParser $args) { public function execute(PhutilArgumentParser $args) {

View file

@ -7,8 +7,7 @@ abstract class ConduitAPI_flag_Method extends ConduitAPIMethod {
protected function attachHandleToFlag($flag) { protected function attachHandleToFlag($flag) {
$flag->attachHandle( $flag->attachHandle(
PhabricatorObjectHandleData::loadOneHandle($flag->getObjectPHID()) PhabricatorObjectHandleData::loadOneHandle($flag->getObjectPHID()));
);
} }
protected function buildFlagInfoDictionary($flag) { protected function buildFlagInfoDictionary($flag) {

View file

@ -208,8 +208,7 @@ final class HeraldRuleController extends HeraldController {
$repetition_policy_param = $request->getStr('repetition_policy'); $repetition_policy_param = $request->getStr('repetition_policy');
$rule->setRepetitionPolicy( $rule->setRepetitionPolicy(
HeraldRepetitionPolicyConfig::toInt($repetition_policy_param) HeraldRepetitionPolicyConfig::toInt($repetition_policy_param));
);
$e_name = true; $e_name = true;
$errors = array(); $errors = array();

View file

@ -52,8 +52,7 @@ final class HeraldEngine {
->setRuleOwner($rule->getAuthorPHID()) ->setRuleOwner($rule->getAuthorPHID())
->setReason( ->setReason(
"This rule is only supposed to be repeated a single time, ". "This rule is only supposed to be repeated a single time, ".
"and it has already been applied." "and it has already been applied.");
);
$this->transcript->addRuleTranscript($xscript); $this->transcript->addRuleTranscript($xscript);
$rule_matches = false; $rule_matches = false;
} else { } else {

View file

@ -120,15 +120,13 @@ final class PhabricatorMailingListsEditController
$crumbs->addCrumb( $crumbs->addCrumb(
id(new PhabricatorCrumbView()) id(new PhabricatorCrumbView())
->setName(pht('Edit Mailing List')) ->setName(pht('Edit Mailing List'))
->setHref($this->getApplicationURI('/edit/'.$list->getID().'/')) ->setHref($this->getApplicationURI('/edit/'.$list->getID().'/')));
);
} else { } else {
$panel->setHeader(pht('Create Mailing List')); $panel->setHeader(pht('Create Mailing List'));
$crumbs->addCrumb( $crumbs->addCrumb(
id(new PhabricatorCrumbView()) id(new PhabricatorCrumbView())
->setName(pht('Create Mailing List')) ->setName(pht('Create Mailing List'))
->setHref($this->getApplicationURI('/edit/')) ->setHref($this->getApplicationURI('/edit/')));
);
} }
$panel->appendChild($form); $panel->appendChild($form);

View file

@ -61,8 +61,7 @@ final class PhabricatorMailingListsListController
$crumbs->addCrumb( $crumbs->addCrumb(
id(new PhabricatorCrumbView()) id(new PhabricatorCrumbView())
->setName(pht('All Lists')) ->setName(pht('All Lists'))
->setHref($this->getApplicationURI()) ->setHref($this->getApplicationURI()));
);
$nav->setCrumbs($crumbs); $nav->setCrumbs($crumbs);
$panel = new AphrontPanelView(); $panel = new AphrontPanelView();

View file

@ -249,8 +249,7 @@ abstract class ConduitAPI_maniphest_Method extends ConduitAPIMethod {
if (!empty($phid_groups)) { if (!empty($phid_groups)) {
throw id(new ConduitException('ERR-INVALID-PARAMETER')) throw id(new ConduitException('ERR-INVALID-PARAMETER'))
->setErrorDescription( ->setErrorDescription(
'One or more PHIDs were invalid for '.$field.'.' 'One or more PHIDs were invalid for '.$field.'.');
);
} }
return true; return true;

View file

@ -149,14 +149,12 @@ final class ManiphestTaskListController extends ManiphestController {
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setName('set_search') ->setName('set_search')
->setLabel('Search') ->setLabel('Search')
->setValue($search_text) ->setValue($search_text));
);
$form->appendChild( $form->appendChild(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setName('set_tasks') ->setName('set_tasks')
->setLabel('Task IDs') ->setLabel('Task IDs')
->setValue(join(',', $task_ids)) ->setValue(join(',', $task_ids)));
);
$tokens = array(); $tokens = array();
foreach ($owner_phids as $phid) { foreach ($owner_phids as $phid) {

View file

@ -27,8 +27,7 @@ final class ManiphestPeopleMenuEventListener extends PhutilEventListener {
->setIsExternal(true) ->setIsExternal(true)
->setHref($href) ->setHref($href)
->setName($name) ->setName($name)
->setKey($name) ->setKey($name));
);
$event->setValue('menu', $menu); $event->setValue('menu', $menu);
} }

View file

@ -72,8 +72,7 @@ final class PhabricatorApplicationDetailViewController
private function buildPropertyView(PhabricatorApplication $selected) { private function buildPropertyView(PhabricatorApplication $selected) {
$properties = id(new PhabricatorPropertyListView()) $properties = id(new PhabricatorPropertyListView())
->addProperty( ->addProperty(
pht('Description'), $selected->getShortDescription() pht('Description'), $selected->getShortDescription());
);
return $properties; return $properties;
} }
@ -92,8 +91,7 @@ final class PhabricatorApplicationDetailViewController
->setIcon('delete') ->setIcon('delete')
->setWorkflow(true) ->setWorkflow(true)
->setHref( ->setHref(
$this->getApplicationURI(get_class($selected).'/uninstall/')) $this->getApplicationURI(get_class($selected).'/uninstall/')));
);
} else { } else {
$view->addAction( $view->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
@ -101,8 +99,7 @@ final class PhabricatorApplicationDetailViewController
->setIcon('new') ->setIcon('new')
->setWorkflow(true) ->setWorkflow(true)
->setHref( ->setHref(
$this->getApplicationURI(get_class($selected).'/install/')) $this->getApplicationURI(get_class($selected).'/install/')));
);
} }
} else { } else {
$view->addAction( $view->addAction(
@ -112,8 +109,7 @@ final class PhabricatorApplicationDetailViewController
->setWorkflow(true) ->setWorkflow(true)
->setDisabled(true) ->setDisabled(true)
->setHref( ->setHref(
$this->getApplicationURI(get_class($selected).'/uninstall/')) $this->getApplicationURI(get_class($selected).'/uninstall/')));
);
} }
return $view; return $view;
} }

View file

@ -36,8 +36,7 @@ final class PhabricatorApplicationUninstallController
if ($selected->canUninstall()) { if ($selected->canUninstall()) {
$dialog->setTitle('Confirmation') $dialog->setTitle('Confirmation')
->appendChild( ->appendChild(
'Install '. $selected->getName(). ' application ?' 'Install '. $selected->getName(). ' application ?')
)
->addSubmitButton('Install'); ->addSubmitButton('Install');
} else { } else {
@ -48,15 +47,13 @@ final class PhabricatorApplicationUninstallController
if ($selected->canUninstall()) { if ($selected->canUninstall()) {
$dialog->setTitle('Confirmation') $dialog->setTitle('Confirmation')
->appendChild( ->appendChild(
'Really Uninstall '. $selected->getName(). ' application ?' 'Really Uninstall '. $selected->getName(). ' application ?')
)
->addSubmitButton('Uninstall'); ->addSubmitButton('Uninstall');
} else { } else {
$dialog->setTitle('Information') $dialog->setTitle('Information')
->appendChild( ->appendChild(
'This application cannot be uninstalled, 'This application cannot be uninstalled,
because it is required for Phabricator to work.' because it is required for Phabricator to work.');
);
} }
} }
return id(new AphrontDialogResponse())->setDialog($dialog); return id(new AphrontDialogResponse())->setDialog($dialog);

View file

@ -39,8 +39,7 @@ final class PhabricatorApplicationsListController
array( array(
'title' => $title, 'title' => $title,
'device' => true, 'device' => true,
) ));
);
} }

View file

@ -76,8 +76,7 @@ final class PhabricatorMailImplementationPHPMailerAdapter
$data, $data,
$filename, $filename,
'base64', 'base64',
$mimetype $mimetype);
);
return $this; return $this;
} }

View file

@ -55,8 +55,7 @@ class PhabricatorMailImplementationPHPMailerLiteAdapter
$data, $data,
$filename, $filename,
'base64', 'base64',
$mimetype $mimetype);
);
return $this; return $this;
} }

View file

@ -20,8 +20,7 @@ final class PhabricatorMetaMTAReceivedListController
$phids = array_merge( $phids = array_merge(
mpull($mails, 'getAuthorPHID'), mpull($mails, 'getAuthorPHID'),
mpull($mails, 'getRelatedPHID') mpull($mails, 'getRelatedPHID'));
);
$phids = array_unique(array_filter($phids)); $phids = array_unique(array_filter($phids));
$handles = $this->loadViewerHandles($phids); $handles = $this->loadViewerHandles($phids);

View file

@ -76,8 +76,10 @@ final class PhabricatorMetaMTASendController
'deliver outbound email. This completely disables outbound email! '. 'deliver outbound email. This completely disables outbound email! '.
'All outbound email will be thrown in a deep, dark hole until you '. 'All outbound email will be thrown in a deep, dark hole until you '.
'configure a real adapter.', 'configure a real adapter.',
phutil_tag('tt', array(), 'PhabricatorMailImplementationTestAdapter')) phutil_tag(
)); 'tt',
array(),
'PhabricatorMailImplementationTestAdapter'))));
} }
$phdlink_href = PhabricatorEnv::getDoclink( $phdlink_href = PhabricatorEnv::getDoclink(
@ -123,8 +125,10 @@ final class PhabricatorMetaMTASendController
->setName('mailtags') ->setName('mailtags')
->setCaption(pht( ->setCaption(pht(
'Example: %s', 'Example: %s',
phutil_tag('tt', array(), 'differential-cc, differential-comment')) phutil_tag(
)) 'tt',
array(),
'differential-cc, differential-comment'))))
->appendChild( ->appendChild(
id(new AphrontFormDragAndDropUploadControl()) id(new AphrontFormDragAndDropUploadControl())
->setLabel(pht('Attach Files')) ->setLabel(pht('Attach Files'))

View file

@ -39,8 +39,7 @@ abstract class PhabricatorMailReplyHandler {
PhabricatorObjectHandle $handle); PhabricatorObjectHandle $handle);
public function getReplyHandlerDomain() { public function getReplyHandlerDomain() {
return PhabricatorEnv::getEnvConfig( return PhabricatorEnv::getEnvConfig(
'metamta.reply-handler-domain' 'metamta.reply-handler-domain');
);
} }
abstract public function getReplyHandlerInstructions(); abstract public function getReplyHandlerInstructions();
abstract protected function receiveEmail( abstract protected function receiveEmail(

View file

@ -424,8 +424,7 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
$mailer->addAttachment( $mailer->addAttachment(
$attachment->getData(), $attachment->getData(),
$attachment->getFilename(), $attachment->getFilename(),
$attachment->getMimeType() $attachment->getMimeType());
);
} }
break; break;
case 'body': case 'body':

View file

@ -50,8 +50,7 @@ final class PhabricatorMetaMTAReceivedMail extends PhabricatorMetaMTADAO {
private function loadExcludeMailRecipientPHIDs() { private function loadExcludeMailRecipientPHIDs() {
$addresses = array_merge( $addresses = array_merge(
$this->getToAddresses(), $this->getToAddresses(),
$this->getCCAddresses() $this->getCCAddresses());
);
return $this->loadPHIDsFromAddresses($addresses); return $this->loadPHIDsFromAddresses($addresses);
} }
@ -173,8 +172,7 @@ final class PhabricatorMetaMTAReceivedMail extends PhabricatorMetaMTADAO {
if ($message_id_hash) { if ($message_id_hash) {
$messages = $this->loadAllWhere( $messages = $this->loadAllWhere(
'messageIDHash = %s', 'messageIDHash = %s',
$message_id_hash $message_id_hash);
);
$messages_count = count($messages); $messages_count = count($messages);
if ($messages_count > 1) { if ($messages_count > 1) {
$first_message = reset($messages); $first_message = reset($messages);
@ -183,8 +181,7 @@ final class PhabricatorMetaMTAReceivedMail extends PhabricatorMetaMTADAO {
'Ignoring email with message id hash "%s" that has been seen %d '. 'Ignoring email with message id hash "%s" that has been seen %d '.
'times, including this message.', 'times, including this message.',
$message_id_hash, $message_id_hash,
$messages_count $messages_count);
);
return $this->setMessage($message)->save(); return $this->setMessage($message)->save();
} }
} }

View file

@ -193,8 +193,7 @@ final class PhabricatorOAuthServer {
// check if the scope includes "offline_access", which makes the // check if the scope includes "offline_access", which makes the
// token valid despite being expired // token valid despite being expired
if (isset( if (isset(
$token_scope[PhabricatorOAuthServerScope::SCOPE_OFFLINE_ACCESS] $token_scope[PhabricatorOAuthServerScope::SCOPE_OFFLINE_ACCESS])) {
)) {
$valid = true; $valid = true;
} }
} }

View file

@ -29,8 +29,7 @@ final class PhabricatorOAuthServerScope {
$name = $scope, $name = $scope,
$value = 1, $value = 1,
$label = self::getCheckboxLabel($scope), $label = self::getCheckboxLabel($scope),
$checked = isset($current_scopes[$scope]) $checked = isset($current_scopes[$scope]));
);
} }
$checkboxes->setLabel('Scope'); $checkboxes->setLabel('Scope');

View file

@ -18,8 +18,7 @@ final class PhabricatorOAuthServerTestCase
$this->assertEqual( $this->assertEqual(
$expected, $expected,
$result, $result,
"Validation of redirect URI '{$input}'" "Validation of redirect URI '{$input}'");
);
} }
} }
@ -41,8 +40,7 @@ final class PhabricatorOAuthServerTestCase
$expected, $expected,
$server->validateSecondaryRedirectURI($uri, $primary_uri), $server->validateSecondaryRedirectURI($uri, $primary_uri),
"Validation of redirect URI '{$input}' ". "Validation of redirect URI '{$input}' ".
"relative to '{$primary_uri}'" "relative to '{$primary_uri}'");
);
} }
$primary_uri = new PhutilURI('http://www.google.com/?auth'); $primary_uri = new PhutilURI('http://www.google.com/?auth');
@ -60,8 +58,7 @@ final class PhabricatorOAuthServerTestCase
$expected, $expected,
$server->validateSecondaryRedirectURI($uri, $primary_uri), $server->validateSecondaryRedirectURI($uri, $primary_uri),
"Validation of secondary redirect URI '{$input}' ". "Validation of secondary redirect URI '{$input}' ".
"relative to '{$primary_uri}'" "relative to '{$primary_uri}'");
);
} }
} }

View file

@ -29,8 +29,7 @@ extends PhabricatorAuthController {
if (!$client_phid) { if (!$client_phid) {
$response->setError('invalid_request'); $response->setError('invalid_request');
$response->setErrorDescription( $response->setErrorDescription(
'Required parameter client_id not specified.' 'Required parameter client_id not specified.');
);
return $response; return $response;
} }
$server->setUser($current_user); $server->setUser($current_user);
@ -43,8 +42,7 @@ extends PhabricatorAuthController {
if (!$client) { if (!$client) {
$response->setError('invalid_request'); $response->setError('invalid_request');
$response->setErrorDescription( $response->setErrorDescription(
'Client with id '.$client_phid.' not found.' 'Client with id '.$client_phid.' not found.');
);
return $response; return $response;
} }
$server->setClient($client); $server->setClient($client);
@ -58,8 +56,7 @@ extends PhabricatorAuthController {
'The specified redirect URI is invalid. The redirect URI '. 'The specified redirect URI is invalid. The redirect URI '.
'must be a fully-qualified domain with no fragments and '. 'must be a fully-qualified domain with no fragments and '.
'must have the same domain and at least the same query '. 'must have the same domain and at least the same query '.
'parameters as the redirect URI the client registered.' 'parameters as the redirect URI the client registered.');
);
return $response; return $response;
} }
$uri = $redirect_uri; $uri = $redirect_uri;
@ -73,8 +70,7 @@ extends PhabricatorAuthController {
if (empty($response_type)) { if (empty($response_type)) {
$response->setError('invalid_request'); $response->setError('invalid_request');
$response->setErrorDescription( $response->setErrorDescription(
'Required parameter response_type not specified.' 'Required parameter response_type not specified.');
);
return $response; return $response;
} }
if ($response_type != 'code') { if ($response_type != 'code') {
@ -82,16 +78,14 @@ extends PhabricatorAuthController {
$response->setErrorDescription( $response->setErrorDescription(
'The authorization server does not support obtaining an '. 'The authorization server does not support obtaining an '.
'authorization code using the specified response_type. '. 'authorization code using the specified response_type. '.
'You must specify the response_type as "code".' 'You must specify the response_type as "code".');
);
return $response; return $response;
} }
if ($scope) { if ($scope) {
if (!PhabricatorOAuthServerScope::validateScopesList($scope)) { if (!PhabricatorOAuthServerScope::validateScopesList($scope)) {
$response->setError('invalid_scope'); $response->setError('invalid_scope');
$response->setErrorDescription( $response->setErrorDescription(
'The requested scope is invalid, unknown, or malformed.' 'The requested scope is invalid, unknown, or malformed.');
);
return $response; return $response;
} }
$scope = PhabricatorOAuthServerScope::scopesListToDict($scope); $scope = PhabricatorOAuthServerScope::scopesListToDict($scope);
@ -136,8 +130,7 @@ extends PhabricatorAuthController {
$response->setError('server_error'); $response->setError('server_error');
$response->setErrorDescription( $response->setErrorDescription(
'The authorization server encountered an unexpected condition '. 'The authorization server encountered an unexpected condition '.
'which prevented it from fulfilling the request. ' 'which prevented it from fulfilling the request. ');
);
return $response; return $response;
} }
@ -162,8 +155,7 @@ extends PhabricatorAuthController {
if (!PhabricatorOAuthServerScope::validateScopesDict($desired_scopes)) { if (!PhabricatorOAuthServerScope::validateScopesDict($desired_scopes)) {
$response->setError('invalid_scope'); $response->setError('invalid_scope');
$response->setErrorDescription( $response->setErrorDescription(
'The requested scope is invalid, unknown, or malformed.' 'The requested scope is invalid, unknown, or malformed.');
);
return $response; return $response;
} }
} else { } else {
@ -185,16 +177,13 @@ extends PhabricatorAuthController {
->setUser($current_user) ->setUser($current_user)
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setValue($description) ->setValue($description))
)
->appendChild( ->appendChild(
PhabricatorOAuthServerScope::getCheckboxControl($desired_scopes) PhabricatorOAuthServerScope::getCheckboxControl($desired_scopes))
)
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue('Authorize') ->setValue('Authorize')
->addCancelButton($cancel_uri) ->addCancelButton($cancel_uri));
);
$panel->appendChild($form); $panel->appendChild($form);

View file

@ -22,29 +22,25 @@ extends PhabricatorAuthController {
if ($grant_type != 'authorization_code') { if ($grant_type != 'authorization_code') {
$response->setError('unsupported_grant_type'); $response->setError('unsupported_grant_type');
$response->setErrorDescription( $response->setErrorDescription(
'Only grant_type authorization_code is supported.' 'Only grant_type authorization_code is supported.');
);
return $response; return $response;
} }
if (!$code) { if (!$code) {
$response->setError('invalid_request'); $response->setError('invalid_request');
$response->setErrorDescription( $response->setErrorDescription(
'Required parameter code missing.' 'Required parameter code missing.');
);
return $response; return $response;
} }
if (!$client_phid) { if (!$client_phid) {
$response->setError('invalid_request'); $response->setError('invalid_request');
$response->setErrorDescription( $response->setErrorDescription(
'Required parameter client_id missing.' 'Required parameter client_id missing.');
);
return $response; return $response;
} }
if (!$client_secret) { if (!$client_secret) {
$response->setError('invalid_request'); $response->setError('invalid_request');
$response->setErrorDescription( $response->setErrorDescription(
'Required parameter client_secret missing.' 'Required parameter client_secret missing.');
);
return $response; return $response;
} }
// one giant try / catch around all the exciting database stuff so we // one giant try / catch around all the exciting database stuff so we
@ -56,8 +52,7 @@ extends PhabricatorAuthController {
if (!$auth_code) { if (!$auth_code) {
$response->setError('invalid_grant'); $response->setError('invalid_grant');
$response->setErrorDescription( $response->setErrorDescription(
'Authorization code '.$code.' not found.' 'Authorization code '.$code.' not found.');
);
return $response; return $response;
} }
@ -72,16 +67,14 @@ extends PhabricatorAuthController {
$response->setError('invalid_grant'); $response->setError('invalid_grant');
$response->setErrorDescription( $response->setErrorDescription(
'Redirect uri in request must exactly match redirect uri '. 'Redirect uri in request must exactly match redirect uri '.
'from authorization code.' 'from authorization code.');
);
return $response; return $response;
} }
} else if ($redirect_uri) { } else if ($redirect_uri) {
$response->setError('invalid_grant'); $response->setError('invalid_grant');
$response->setErrorDescription( $response->setErrorDescription(
'Redirect uri in request and no redirect uri in authorization '. 'Redirect uri in request and no redirect uri in authorization '.
'code. The two must exactly match.' 'code. The two must exactly match.');
);
return $response; return $response;
} }
@ -91,8 +84,7 @@ extends PhabricatorAuthController {
if (!$client) { if (!$client) {
$response->setError('invalid_client'); $response->setError('invalid_client');
$response->setErrorDescription( $response->setErrorDescription(
'Client with client_id '.$client_phid.' not found.' 'Client with client_id '.$client_phid.' not found.');
);
return $response; return $response;
} }
$server->setClient($client); $server->setClient($client);
@ -103,8 +95,7 @@ extends PhabricatorAuthController {
if (!$user) { if (!$user) {
$response->setError('invalid_grant'); $response->setError('invalid_grant');
$response->setErrorDescription( $response->setErrorDescription(
'User with phid '.$user_phid.' not found.' 'User with phid '.$user_phid.' not found.');
);
return $response; return $response;
} }
$server->setUser($user); $server->setUser($user);
@ -117,8 +108,7 @@ extends PhabricatorAuthController {
if (!$is_good_code) { if (!$is_good_code) {
$response->setError('invalid_grant'); $response->setError('invalid_grant');
$response->setErrorDescription( $response->setErrorDescription(
'Invalid authorization code '.$code.'.' 'Invalid authorization code '.$code.'.');
);
return $response; return $response;
} }
@ -136,8 +126,7 @@ extends PhabricatorAuthController {
$response->setError('server_error'); $response->setError('server_error');
$response->setErrorDescription( $response->setErrorDescription(
'The authorization server encountered an unexpected condition '. 'The authorization server encountered an unexpected condition '.
'which prevented it from fulfilling the request.' 'which prevented it from fulfilling the request.');
);
return $response; return $response;
} }
} }

View file

@ -88,8 +88,7 @@ extends PhabricatorOAuthClientBaseController {
'Redirect URI must be a fully qualified domain name '. 'Redirect URI must be a fully qualified domain name '.
'with no fragments. See '. 'with no fragments. See '.
'http://tools.ietf.org/html/draft-ietf-oauth-v2-23#section-3.1.2 '. 'http://tools.ietf.org/html/draft-ietf-oauth-v2-23#section-3.1.2 '.
'for more information on the correct format.' 'for more information on the correct format.');
);
$bad_redirect = true; $bad_redirect = true;
} else { } else {
$client->save(); $client->save();
@ -124,20 +123,17 @@ extends PhabricatorOAuthClientBaseController {
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setLabel('Name') ->setLabel('Name')
->setName('name') ->setName('name')
->setValue($client->getName()) ->setValue($client->getName()));
);
if ($this->isClientEdit()) { if ($this->isClientEdit()) {
$form $form
->appendChild( ->appendChild(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setLabel('ID') ->setLabel('ID')
->setValue($phid) ->setValue($phid))
)
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Secret') ->setLabel('Secret')
->setValue($client->getSecret()) ->setValue($client->getSecret()));
);
} }
$form $form
->appendChild( ->appendChild(
@ -145,8 +141,7 @@ extends PhabricatorOAuthClientBaseController {
->setLabel('Redirect URI') ->setLabel('Redirect URI')
->setName('redirect_uri') ->setName('redirect_uri')
->setValue($client->getRedirectURI()) ->setValue($client->getRedirectURI())
->setError($bad_redirect) ->setError($bad_redirect));
);
if ($this->isClientEdit()) { if ($this->isClientEdit()) {
$created = phabricator_datetime($client->getDateCreated(), $created = phabricator_datetime($client->getDateCreated(),
$current_user); $current_user);
@ -156,27 +151,23 @@ extends PhabricatorOAuthClientBaseController {
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Created') ->setLabel('Created')
->setValue($created) ->setValue($created))
)
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Last Updated') ->setLabel('Last Updated')
->setValue($updated) ->setValue($updated));
);
} }
$form $form
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue($submit_button) ->setValue($submit_button));
);
$panel->appendChild($form); $panel->appendChild($form);
return $this->buildStandardPageResponse( return $this->buildStandardPageResponse(
array($error, array($error,
$panel $panel
), ),
array('title' => $title) array('title' => $title));
);
} }
} }

View file

@ -36,8 +36,7 @@ extends PhabricatorOAuthClientBaseController {
array( array(
'href' => $client->getViewURI(), 'href' => $client->getViewURI(),
), ),
$client->getName() $client->getName()),
),
$client->getPHID(), $client->getPHID(),
$client->getSecret(), $client->getSecret(),
phutil_tag( phutil_tag(
@ -45,16 +44,14 @@ extends PhabricatorOAuthClientBaseController {
array( array(
'href' => $client->getRedirectURI(), 'href' => $client->getRedirectURI(),
), ),
$client->getRedirectURI() $client->getRedirectURI()),
),
phutil_tag( phutil_tag(
'a', 'a',
array( array(
'class' => 'small button grey', 'class' => 'small button grey',
'href' => $client->getEditURI(), 'href' => $client->getEditURI(),
), ),
'Edit' 'Edit'),
),
); );
$rows[] = $row; $rows[] = $row;
@ -72,8 +69,7 @@ extends PhabricatorOAuthClientBaseController {
$this->getNoticeView(), $this->getNoticeView(),
$panel->appendChild($pager) $panel->appendChild($pager)
), ),
array('title' => $title) array('title' => $title));
);
} }
private function buildClientList($rows, $rowc, $title) { private function buildClientList($rows, $rowc, $title) {
@ -97,8 +93,7 @@ extends PhabricatorOAuthClientBaseController {
)); ));
if (empty($rows)) { if (empty($rows)) {
$table->setNoDataString( $table->setNoDataString(
'You have not created any clients for this OAuthServer.' 'You have not created any clients for this OAuthServer.');
);
} }
$panel = new AphrontPanelView(); $panel = new AphrontPanelView();

View file

@ -33,8 +33,7 @@ extends PhabricatorOAuthClientBaseController {
$message = 'No client found with id '.$phid.'.'; $message = 'No client found with id '.$phid.'.';
return $this->buildStandardPageResponse( return $this->buildStandardPageResponse(
$this->buildErrorView($message), $this->buildErrorView($message),
array('title' => $title) array('title' => $title));
);
} }
$panel = new AphrontPanelView(); $panel = new AphrontPanelView();
@ -45,27 +44,23 @@ extends PhabricatorOAuthClientBaseController {
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Name') ->setLabel('Name')
->setValue($client->getName()) ->setValue($client->getName()))
)
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('ID') ->setLabel('ID')
->setValue($phid) ->setValue($phid));
);
if ($current_user->getPHID() == $client->getCreatorPHID()) { if ($current_user->getPHID() == $client->getCreatorPHID()) {
$form $form
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Secret') ->setLabel('Secret')
->setValue($client->getSecret()) ->setValue($client->getSecret()));
);
} }
$form $form
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Redirect URI') ->setLabel('Redirect URI')
->setValue($client->getRedirectURI()) ->setValue($client->getRedirectURI()));
);
$created = phabricator_datetime($client->getDateCreated(), $created = phabricator_datetime($client->getDateCreated(),
$current_user); $current_user);
$updated = phabricator_datetime($client->getDateModified(), $updated = phabricator_datetime($client->getDateModified(),
@ -74,13 +69,11 @@ extends PhabricatorOAuthClientBaseController {
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Created') ->setLabel('Created')
->setValue($created) ->setValue($created))
)
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Last Updated') ->setLabel('Last Updated')
->setValue($updated) ->setValue($updated));
);
$panel->appendChild($form); $panel->appendChild($form);
$admin_panel = null; $admin_panel = null;
if ($client->getCreatorPHID() == $current_user->getPHID()) { if ($client->getCreatorPHID() == $current_user->getPHID()) {
@ -100,8 +93,7 @@ extends PhabricatorOAuthClientBaseController {
->setAction('/oauthserver/test/') ->setAction('/oauthserver/test/')
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue('Create Scopeless Test Authorization') ->setValue('Create Scopeless Test Authorization'));
);
$admin_panel = id(new AphrontPanelView()) $admin_panel = id(new AphrontPanelView())
->setHeader('Admin Tools') ->setHeader('Admin Tools')
->appendChild($create_authorization_form); ->appendChild($create_authorization_form);
@ -112,7 +104,6 @@ extends PhabricatorOAuthClientBaseController {
$panel, $panel,
$admin_panel $admin_panel
), ),
array('title' => $title) array('title' => $title));
);
} }
} }

View file

@ -66,33 +66,26 @@ extends PhabricatorOAuthClientAuthorizationBaseController {
array( array(
'href' => $client->getViewURI(), 'href' => $client->getViewURI(),
), ),
$client->getName())) $client->getName())))
)
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Created') ->setLabel('Created')
->setValue($created) ->setValue($created))
)
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Last Updated') ->setLabel('Last Updated')
->setValue($updated) ->setValue($updated))
)
->appendChild( ->appendChild(
PhabricatorOAuthServerScope::getCheckboxControl( PhabricatorOAuthServerScope::getCheckboxControl(
$authorization->getScope() $authorization->getScope()))
)
)
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue('Save OAuth Client Authorization') ->setValue('Save OAuth Client Authorization')
->addCancelButton('/oauthserver/clientauthorization/') ->addCancelButton('/oauthserver/clientauthorization/'));
);
$panel->appendChild($form); $panel->appendChild($form);
return $this->buildStandardPageResponse( return $this->buildStandardPageResponse(
$panel, $panel,
array('title' => $title) array('title' => $title));
);
} }
} }

View file

@ -47,39 +47,33 @@ extends PhabricatorOAuthClientAuthorizationBaseController {
$updated = phabricator_datetime($authorization->getDateModified(), $updated = phabricator_datetime($authorization->getDateModified(),
$current_user); $current_user);
$scope_doc_href = PhabricatorEnv::getDoclink( $scope_doc_href = PhabricatorEnv::getDoclink(
'article/Using_the_Phabricator_OAuth_Server.html#scopes' 'article/Using_the_Phabricator_OAuth_Server.html#scopes');
);
$row = array( $row = array(
phutil_tag( phutil_tag(
'a', 'a',
array( array(
'href' => $client->getViewURI(), 'href' => $client->getViewURI(),
), ),
$client->getName() $client->getName()),
),
phutil_tag( phutil_tag(
'a', 'a',
array( array(
'href' => $scope_doc_href, 'href' => $scope_doc_href,
), ),
$authorization->getScopeString() $authorization->getScopeString()),
),
phabricator_datetime( phabricator_datetime(
$authorization->getDateCreated(), $authorization->getDateCreated(),
$current_user $current_user),
),
phabricator_datetime( phabricator_datetime(
$authorization->getDateModified(), $authorization->getDateModified(),
$current_user $current_user),
),
phutil_tag( phutil_tag(
'a', 'a',
array( array(
'class' => 'small button grey', 'class' => 'small button grey',
'href' => $authorization->getEditURI(), 'href' => $authorization->getEditURI(),
), ),
'Edit' 'Edit'),
),
); );
$rows[] = $row; $rows[] = $row;
@ -97,8 +91,7 @@ extends PhabricatorOAuthClientAuthorizationBaseController {
$this->getNoticeView(), $this->getNoticeView(),
$panel->appendChild($pager), $panel->appendChild($pager),
), ),
array('title' => $title) array('title' => $title));
);
} }
private function buildClientAuthorizationList($rows, $rowc, $title) { private function buildClientAuthorizationList($rows, $rowc, $title) {
@ -122,8 +115,7 @@ extends PhabricatorOAuthClientAuthorizationBaseController {
)); ));
if (empty($rows)) { if (empty($rows)) {
$table->setNoDataString( $table->setNoDataString(
'You have not authorized any clients for this OAuthServer.' 'You have not authorized any clients for this OAuthServer.');
);
} }
$panel = new AphrontPanelView(); $panel = new AphrontPanelView();

View file

@ -158,8 +158,7 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController {
array( array(
'href' => $this->getApplicationURI('?parent='.$paste->getID()) 'href' => $this->getApplicationURI('?parent='.$paste->getID())
), ),
pht('Fork') pht('Fork'));
);
$form $form
->appendChild( ->appendChild(
id(new AphrontFormMarkupControl()) id(new AphrontFormMarkupControl())

View file

@ -66,8 +66,7 @@ final class PhabricatorPasteListController extends PhabricatorPasteController {
array( array(
'title' => $title, 'title' => $title,
'device' => true, 'device' => true,
) ));
);
} }
private function buildPasteList(array $pastes) { private function buildPasteList(array $pastes) {

View file

@ -94,8 +94,7 @@ final class PhabricatorPeopleProfileController
->setIsExternal(true) ->setIsExternal(true)
->setName($name) ->setName($name)
->setHref($href) ->setHref($href)
->setType(PhabricatorMenuItemView::TYPE_LINK) ->setType(PhabricatorMenuItemView::TYPE_LINK));
);
} }
} }
@ -149,16 +148,14 @@ final class PhabricatorPeopleProfileController
$nav->addFilter( $nav->addFilter(
null, null,
pht('Edit Profile...'), pht('Edit Profile...'),
'/settings/panel/profile/' '/settings/panel/profile/');
);
} }
if ($viewer->getIsAdmin()) { if ($viewer->getIsAdmin()) {
$nav->addFilter( $nav->addFilter(
null, null,
pht('Administrate User...'), pht('Administrate User...'),
'/people/edit/'.$user->getID().'/' '/people/edit/'.$user->getID().'/');
);
} }
return $this->buildApplicationPage( return $this->buildApplicationPage(
@ -172,8 +169,7 @@ final class PhabricatorPeopleProfileController
$blurb = nonempty( $blurb = nonempty(
$profile->getBlurb(), $profile->getBlurb(),
'//'.pht('Nothing is known about this rare specimen.').'//' '//'.pht('Nothing is known about this rare specimen.').'//');
);
$engine = PhabricatorMarkupEngine::newProfileMarkupEngine(); $engine = PhabricatorMarkupEngine::newProfileMarkupEngine();
$blurb = $engine->markupText($blurb); $blurb = $engine->markupText($blurb);

View file

@ -114,8 +114,7 @@ final class PhameBlogEditController
->setName('name') ->setName('name')
->setValue($blog->getName()) ->setValue($blog->getName())
->setID('blog-name') ->setID('blog-name')
->setError($e_name) ->setError($e_name))
)
->appendChild( ->appendChild(
id(new PhabricatorRemarkupControl()) id(new PhabricatorRemarkupControl())
->setLabel('Description') ->setLabel('Description')
@ -151,20 +150,17 @@ final class PhameBlogEditController
->setName('custom_domain') ->setName('custom_domain')
->setValue($blog->getDomain()) ->setValue($blog->getDomain())
->setCaption('Must include at least one dot (.), e.g. blog.example.com') ->setCaption('Must include at least one dot (.), e.g. blog.example.com')
->setError($e_custom_domain) ->setError($e_custom_domain))
)
->appendChild( ->appendChild(
id(new AphrontFormSelectControl()) id(new AphrontFormSelectControl())
->setLabel('Skin') ->setLabel('Skin')
->setName('skin') ->setName('skin')
->setValue($blog->getSkin()) ->setValue($blog->getSkin())
->setOptions($skins) ->setOptions($skins))
)
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->addCancelButton($cancel_uri) ->addCancelButton($cancel_uri)
->setValue($submit_button) ->setValue($submit_button));
);
if ($errors) { if ($errors) {
$error_view = id(new AphrontErrorView()) $error_view = id(new AphrontErrorView())

View file

@ -112,8 +112,7 @@ final class PhamePostEditController
->setName('title') ->setName('title')
->setValue($post->getTitle()) ->setValue($post->getTitle())
->setID('post-title') ->setID('post-title')
->setError($e_title) ->setError($e_title))
)
->appendChild( ->appendChild(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setLabel('Phame Title') ->setLabel('Phame Title')
@ -123,8 +122,7 @@ final class PhamePostEditController
->setCaption('Up to 64 alphanumeric characters '. ->setCaption('Up to 64 alphanumeric characters '.
'with underscores for spaces. '. 'with underscores for spaces. '.
'Formatting is enforced.') 'Formatting is enforced.')
->setError($e_phame_title) ->setError($e_phame_title))
)
->appendChild( ->appendChild(
id(new PhabricatorRemarkupControl()) id(new PhabricatorRemarkupControl())
->setLabel('Body') ->setLabel('Body')
@ -133,20 +131,17 @@ final class PhamePostEditController
->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL) ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL)
->setID('post-body') ->setID('post-body')
->setUser($user) ->setUser($user)
->setDisableMacros(true) ->setDisableMacros(true))
)
->appendChild( ->appendChild(
id(new AphrontFormSelectControl()) id(new AphrontFormSelectControl())
->setLabel('Comments Widget') ->setLabel('Comments Widget')
->setName('comments_widget') ->setName('comments_widget')
->setvalue($post->getCommentsWidget()) ->setvalue($post->getCommentsWidget())
->setOptions($post->getCommentsWidgetOptionsForSelect()) ->setOptions($post->getCommentsWidgetOptionsForSelect()))
)
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->addCancelButton($cancel_uri) ->addCancelButton($cancel_uri)
->setValue($submit_button) ->setValue($submit_button));
);
$preview_panel = hsprintf( $preview_panel = hsprintf(
'<div class="aphront-panel-preview"> '<div class="aphront-panel-preview">

View file

@ -93,8 +93,7 @@ final class PhameBasicTemplateBlogSkin extends PhameBasicBlogSkin {
protected function renderHeader() { protected function renderHeader() {
return $this->renderTemplate( return $this->renderTemplate(
'header.php', 'header.php',
array() array());
);
} }
protected function renderFooter() { protected function renderFooter() {

View file

@ -104,8 +104,7 @@ final class PhameBlog extends PhameDAO
$this->bloggerPHIDs = PhabricatorEdgeQuery::loadDestinationPHIDs( $this->bloggerPHIDs = PhabricatorEdgeQuery::loadDestinationPHIDs(
$this->getPHID(), $this->getPHID(),
PhabricatorEdgeConfig::TYPE_BLOG_HAS_BLOGGER PhabricatorEdgeConfig::TYPE_BLOG_HAS_BLOGGER);
);
return $this; return $this;
} }

View file

@ -208,8 +208,7 @@ final class PhamePostView extends AphrontView {
$disqus_thread = phutil_tag('div', $disqus_thread = phutil_tag('div',
array( array(
'id' => 'disqus_thread' 'id' => 'disqus_thread'
) ));
);
// protip - try some var disqus_developer = 1; action to test locally // protip - try some var disqus_developer = 1; action to test locally
$disqus_js = hsprintf( $disqus_js = hsprintf(

View file

@ -17,8 +17,7 @@ final class PholioInlineController extends PholioController {
$inline_comments = id(new PholioTransactionComment())->loadAllWhere( $inline_comments = id(new PholioTransactionComment())->loadAllWhere(
'imageid = %d AND transactionphid IS NOT NULL', 'imageid = %d AND transactionphid IS NOT NULL',
$this->id $this->id);
);
$inline_comments = array_merge( $inline_comments = array_merge(
$inline_comments, $inline_comments,
@ -31,8 +30,7 @@ final class PholioInlineController extends PholioController {
foreach ($inline_comments as $inline_comment) { foreach ($inline_comments as $inline_comment) {
$author = id(new PhabricatorUser())->loadOneWhere( $author = id(new PhabricatorUser())->loadOneWhere(
'phid = %s', 'phid = %s',
$inline_comment->getAuthorPHID() $inline_comment->getAuthorPHID());
);
$inlines[] = array( $inlines[] = array(
'phid' => $inline_comment->getPHID(), 'phid' => $inline_comment->getPHID(),
'userphid' => $author->getPHID(), 'userphid' => $author->getPHID(),

View file

@ -53,8 +53,7 @@ final class PholioMockCommentController extends PholioController {
$inlineComments = id(new PholioTransactionComment())->loadAllWhere( $inlineComments = id(new PholioTransactionComment())->loadAllWhere(
'authorphid = %s AND transactionphid IS NULL AND imageid IN (%Ld)', 'authorphid = %s AND transactionphid IS NULL AND imageid IN (%Ld)',
$user->getPHID(), $user->getPHID(),
mpull($mock->getImages(), 'getID') mpull($mock->getImages(), 'getID'));
);
foreach ($inlineComments as $inlineComment) { foreach ($inlineComments as $inlineComment) {
$xactions[] = id(new PholioTransaction()) $xactions[] = id(new PholioTransaction())

View file

@ -60,8 +60,7 @@ final class PholioMockListController extends PholioController {
$crumbs->addCrumb( $crumbs->addCrumb(
id(new PhabricatorCrumbView()) id(new PhabricatorCrumbView())
->setName($title) ->setName($title)
->setHref($this->getApplicationURI()) ->setHref($this->getApplicationURI()));
);
$nav->setCrumbs($crumbs); $nav->setCrumbs($crumbs);
return $this->buildApplicationPage( return $this->buildApplicationPage(

View file

@ -78,8 +78,7 @@ final class PholioMockViewController extends PholioController {
$crumbs->addCrumb( $crumbs->addCrumb(
id(new PhabricatorCrumbView()) id(new PhabricatorCrumbView())
->setName($title) ->setName($title)
->setHref($this->getApplicationURI().'M'.$this->id) ->setHref($this->getApplicationURI().'M'.$this->id));
);
$content = array( $content = array(
$crumbs, $crumbs,

View file

@ -44,8 +44,7 @@ final class PholioMockImagesView extends AphrontView {
'sigil' => 'mock-wrapper', 'sigil' => 'mock-wrapper',
'class' => 'pholio-mock-wrapper' 'class' => 'pholio-mock-wrapper'
), ),
$main_image_tag $main_image_tag);
);
$inline_comments_holder = javelin_tag( $inline_comments_holder = javelin_tag(

View file

@ -69,8 +69,7 @@ extends PhortuneStripeBaseController {
), ),
array( array(
'title' => $title, 'title' => $title,
) ));
);
} }
/** /**
@ -120,8 +119,7 @@ extends PhortuneStripeBaseController {
$error = sprintf( $error = sprintf(
'error_type: %s error_message: %s', 'error_type: %s error_message: %s',
$type, $type,
$msg $msg);
);
$this->logStripeError($error); $this->logStripeError($error);
break; break;
} }

View file

@ -61,30 +61,24 @@ final class PhortuneStripePaymentFormView extends AphrontView {
'Discover, JCB, and Diners Club.', 'Discover, JCB, and Diners Club.',
'size' => 440, 'size' => 440,
) )
) ))))
)
)
)
->appendChild( ->appendChild(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setLabel('Card Number') ->setLabel('Card Number')
->setDisableAutocomplete(true) ->setDisableAutocomplete(true)
->setSigil('number-input') ->setSigil('number-input')
->setError($this->getCardNumberError()) ->setError($this->getCardNumberError()))
)
->appendChild( ->appendChild(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setLabel('CVC') ->setLabel('CVC')
->setDisableAutocomplete(true) ->setDisableAutocomplete(true)
->setSigil('cvc-input') ->setSigil('cvc-input')
->setError($this->getCardCVCError()) ->setError($this->getCardCVCError()))
)
->appendChild( ->appendChild(
id(new PhortuneMonthYearExpiryControl()) id(new PhortuneMonthYearExpiryControl())
->setLabel('Expiration') ->setLabel('Expiration')
->setUser($this->getUser()) ->setUser($this->getUser())
->setError($this->getCardExpirationError()) ->setError($this->getCardExpirationError()))
)
->appendChild( ->appendChild(
javelin_tag( javelin_tag(
'input', 'input',
@ -92,9 +86,7 @@ final class PhortuneStripePaymentFormView extends AphrontView {
'hidden' => true, 'hidden' => true,
'name' => 'stripeToken', 'name' => 'stripeToken',
'sigil' => 'stripe-token-input', 'sigil' => 'stripe-token-input',
) )))
)
)
->appendChild( ->appendChild(
javelin_tag( javelin_tag(
'input', 'input',
@ -102,9 +94,7 @@ final class PhortuneStripePaymentFormView extends AphrontView {
'hidden' => true, 'hidden' => true,
'name' => 'cardErrors', 'name' => 'cardErrors',
'sigil' => 'card-errors-input' 'sigil' => 'card-errors-input'
) )))
)
)
->appendChild( ->appendChild(
phutil_tag( phutil_tag(
'input', 'input',
@ -112,21 +102,17 @@ final class PhortuneStripePaymentFormView extends AphrontView {
'hidden' => true, 'hidden' => true,
'name' => 'stripeKey', 'name' => 'stripeKey',
'value' => $this->getStripeKey(), 'value' => $this->getStripeKey(),
) )))
)
)
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue('Submit Payment') ->setValue('Submit Payment'));
);
Javelin::initBehavior( Javelin::initBehavior(
'stripe-payment-form', 'stripe-payment-form',
array( array(
'stripePublishKey' => $this->getStripeKey(), 'stripePublishKey' => $this->getStripeKey(),
'root' => $form_id, 'root' => $form_id,
) ));
);
return $form->render(); return $form->render();
} }

View file

@ -62,8 +62,7 @@ final class PonderFeedController extends PonderController {
$user, $user,
$user->getPHID(), $user->getPHID(),
$this->answerOffset, $this->answerOffset,
self::PROFILE_ANSWER_PAGE_SIZE + 1 self::PROFILE_ANSWER_PAGE_SIZE + 1);
);
$side_nav->appendChild( $side_nav->appendChild(
id(new PonderUserProfileView()) id(new PonderUserProfileView())
@ -71,8 +70,7 @@ final class PonderFeedController extends PonderController {
->setAnswers($answers) ->setAnswers($answers)
->setAnswerOffset($this->answerOffset) ->setAnswerOffset($this->answerOffset)
->setPageSize(self::PROFILE_ANSWER_PAGE_SIZE) ->setPageSize(self::PROFILE_ANSWER_PAGE_SIZE)
->setURI(new PhutilURI("/ponder/profile/"), "aoff") ->setURI(new PhutilURI("/ponder/profile/"), "aoff"));
);
break; break;
} }

View file

@ -107,8 +107,7 @@ final class PonderQuestionAskController extends PonderController {
array( array(
'device' => true, 'device' => true,
'title' => 'Ask a Question', 'title' => 'Ask a Question',
) ));
);
} }
} }

View file

@ -59,8 +59,7 @@ final class PonderAnswerEditor extends PhabricatorEditor {
$content = $answer->getContent(); $content = $answer->getContent();
$at_mention_phids = PhabricatorMarkupEngine::extractPHIDsFromMentions( $at_mention_phids = PhabricatorMarkupEngine::extractPHIDsFromMentions(
array($content) array($content));
);
$subeditor->subscribeImplicit($at_mention_phids); $subeditor->subscribeImplicit($at_mention_phids);
$subeditor->save(); $subeditor->save();
@ -83,8 +82,7 @@ final class PonderAnswerEditor extends PhabricatorEditor {
$other_subs = $other_subs =
array_diff( array_diff(
$subscribers, $subscribers,
$at_mention_phids $at_mention_phids);
);
// 'Answered' emails for subscribers who are not @mentiond (and excluding // 'Answered' emails for subscribers who are not @mentiond (and excluding
// author depending on their MetaMTA settings). // author depending on their MetaMTA settings).

View file

@ -51,8 +51,7 @@ final class PonderCommentEditor extends PhabricatorEditor {
$content = $comment->getContent(); $content = $comment->getContent();
$at_mention_phids = PhabricatorMarkupEngine::extractPHIDsFromMentions( $at_mention_phids = PhabricatorMarkupEngine::extractPHIDsFromMentions(
array($content) array($content));
);
$subeditor->subscribeImplicit($at_mention_phids); $subeditor->subscribeImplicit($at_mention_phids);
$subeditor->save(); $subeditor->save();
@ -86,8 +85,7 @@ final class PonderCommentEditor extends PhabricatorEditor {
$other_subs = $other_subs =
array_diff( array_diff(
array_intersect($thread, $subscribers), array_intersect($thread, $subscribers),
$at_mention_phids $at_mention_phids);
);
// 'Comment' emails for subscribers who are in the same comment thread, // 'Comment' emails for subscribers who are in the same comment thread,
// including the author of the parent question and/or answer, excluding // including the author of the parent question and/or answer, excluding

Some files were not shown because too many files have changed in this diff Show more