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)
->setName($name)
->setHref($href)
->setKey($name)
);
->setKey($name));
$event->setValue('menu', $menu);
}

View file

@ -269,13 +269,13 @@ final class PhabricatorLDAPProvider {
$rows = array();
for($i = 0; $i < $entries['count']; $i++) {
for ($i = 0; $i < $entries['count']; $i++) {
$row = array();
$entry = $entries[$i];
// Get username, email and realname
$username = $entry[$this->getSearchAttribute()][0];
if(empty($username)) {
if (empty($username)) {
continue;
}
$row[] = $username;

View file

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

View file

@ -28,8 +28,7 @@ final class PhabricatorCalendarDeleteStatusController
$uri->setQueryParams(
array(
'deleted' => true,
)
);
));
return id(new AphrontRedirectResponse())
->setURI($uri);
}
@ -40,12 +39,10 @@ final class PhabricatorCalendarDeleteStatusController
$dialog->appendChild(phutil_tag(
'p',
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->addCancelButton(
$this->getApplicationURI('status/edit/'.$status->getID().'/')
);
$this->getApplicationURI('status/edit/'.$status->getID().'/'));
return id(new AphrontDialogResponse())->setDialog($dialog);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -131,8 +131,7 @@ final class PhabricatorCoreConfigOptions
$this->newOption('phabricator.uninstalled-applications', 'set', array())
->setLocked(true)
->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
// on the current system.
$install_commands = hsprintf(
"\$ sudo apt-get install php5-<em>extname</em> # Debian / Ubuntu\n".
"\$ sudo yum install php-<em>extname</em> # Red Hat / Derivatives"
);
"\$ sudo apt-get install php5-<em>extname</em> ".
"# Debian / Ubuntu\n".
"\$ sudo yum install php-<em>extname</em> ".
"# Red Hat / Derivatives");
$fallback_info = pht(
"If those commands don't work, try Google. The process of installing ".

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -25,8 +25,7 @@ final class ConpherenceFormDragAndDropUploadControl extends AphrontFormControl {
'form_pane' => 'conpherence-form',
'upload_uri' => '/file/dropupload/',
'activated_class' => 'conpherence-dialogue-upload-photo',
)
);
));
require_celerity_resource('conpherence-update-css');
return phutil_tag(
@ -35,8 +34,7 @@ final class ConpherenceFormDragAndDropUploadControl extends AphrontFormControl {
'id' => $drop_id,
'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(
'class' => $content_class
),
$this->renderSingleView($content))
);
$this->renderSingleView($content)));
return $transaction_view->render();
}

View file

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

View file

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

View file

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

View file

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

View file

@ -157,16 +157,14 @@ final class DifferentialRevisionViewController extends DifferentialController {
'p',
array(),
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 {
$reviewer_warning->appendChild(
phutil_tag(
'p',
array(),
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)
->setHref($href)
->setName($name)
->setKey($name)
);
->setKey($name));
$event->setValue('menu', $menu);
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -14,7 +14,7 @@ final class DiffusionChangeController extends DiffusionController {
// TODO: Refine this.
return new Aphront404Response();
}
$repository = $drequest->getRepository();
$callsign = $repository->getCallsign();
$commit = $drequest->getRawCommit();

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -28,7 +28,7 @@ final class PhabricatorFeedStoryData extends PhabricatorFeedDAO {
// We're on a 32-bit machine.
if (function_exists('bcadd')) {
// Try to use the 'bc' extension.
return bcdiv($this->chronologicalKey, bcpow(2,32));
return bcdiv($this->chronologicalKey, bcpow(2, 32));
} else {
// Do the math in MySQL. TODO: If we formalize a bc dependency, get
// rid of this.

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -52,8 +52,7 @@ final class HeraldEngine {
->setRuleOwner($rule->getAuthorPHID())
->setReason(
"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);
$rule_matches = false;
} else {

View file

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

View file

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

View file

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

View file

@ -59,7 +59,7 @@ abstract class ManiphestController extends PhabricatorController {
$nav->addFilter('subscribed', 'Subscribed');
$nav->addFilter('triage', 'Need Triage');
$nav->addLabel('User Projects');
$nav->addFilter('projecttriage','Need Triage');
$nav->addFilter('projecttriage', 'Need Triage');
$nav->addFilter('projectall', 'All Tasks');
$nav->addLabel('All Tasks');
$nav->addFilter('alltriage', 'Need Triage');

View file

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

View file

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

View file

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

View file

@ -36,8 +36,7 @@ final class PhabricatorApplicationUninstallController
if ($selected->canUninstall()) {
$dialog->setTitle('Confirmation')
->appendChild(
'Install '. $selected->getName(). ' application ?'
)
'Install '. $selected->getName(). ' application ?')
->addSubmitButton('Install');
} else {
@ -48,15 +47,13 @@ final class PhabricatorApplicationUninstallController
if ($selected->canUninstall()) {
$dialog->setTitle('Confirmation')
->appendChild(
'Really Uninstall '. $selected->getName(). ' application ?'
)
'Really Uninstall '. $selected->getName(). ' application ?')
->addSubmitButton('Uninstall');
} else {
$dialog->setTitle('Information')
->appendChild(
'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);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -50,8 +50,7 @@ final class PhabricatorMetaMTAReceivedMail extends PhabricatorMetaMTADAO {
private function loadExcludeMailRecipientPHIDs() {
$addresses = array_merge(
$this->getToAddresses(),
$this->getCCAddresses()
);
$this->getCCAddresses());
return $this->loadPHIDsFromAddresses($addresses);
}
@ -173,8 +172,7 @@ final class PhabricatorMetaMTAReceivedMail extends PhabricatorMetaMTADAO {
if ($message_id_hash) {
$messages = $this->loadAllWhere(
'messageIDHash = %s',
$message_id_hash
);
$message_id_hash);
$messages_count = count($messages);
if ($messages_count > 1) {
$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 '.
'times, including this message.',
$message_id_hash,
$messages_count
);
$messages_count);
return $this->setMessage($message)->save();
}
}

View file

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

View file

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

View file

@ -18,8 +18,7 @@ final class PhabricatorOAuthServerTestCase
$this->assertEqual(
$expected,
$result,
"Validation of redirect URI '{$input}'"
);
"Validation of redirect URI '{$input}'");
}
}
@ -41,8 +40,7 @@ final class PhabricatorOAuthServerTestCase
$expected,
$server->validateSecondaryRedirectURI($uri, $primary_uri),
"Validation of redirect URI '{$input}' ".
"relative to '{$primary_uri}'"
);
"relative to '{$primary_uri}'");
}
$primary_uri = new PhutilURI('http://www.google.com/?auth');
@ -60,8 +58,7 @@ final class PhabricatorOAuthServerTestCase
$expected,
$server->validateSecondaryRedirectURI($uri, $primary_uri),
"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) {
$response->setError('invalid_request');
$response->setErrorDescription(
'Required parameter client_id not specified.'
);
'Required parameter client_id not specified.');
return $response;
}
$server->setUser($current_user);
@ -43,8 +42,7 @@ extends PhabricatorAuthController {
if (!$client) {
$response->setError('invalid_request');
$response->setErrorDescription(
'Client with id '.$client_phid.' not found.'
);
'Client with id '.$client_phid.' not found.');
return $response;
}
$server->setClient($client);
@ -58,8 +56,7 @@ extends PhabricatorAuthController {
'The specified redirect URI is invalid. The redirect URI '.
'must be a fully-qualified domain with no fragments and '.
'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;
}
$uri = $redirect_uri;
@ -73,8 +70,7 @@ extends PhabricatorAuthController {
if (empty($response_type)) {
$response->setError('invalid_request');
$response->setErrorDescription(
'Required parameter response_type not specified.'
);
'Required parameter response_type not specified.');
return $response;
}
if ($response_type != 'code') {
@ -82,16 +78,14 @@ extends PhabricatorAuthController {
$response->setErrorDescription(
'The authorization server does not support obtaining an '.
'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;
}
if ($scope) {
if (!PhabricatorOAuthServerScope::validateScopesList($scope)) {
$response->setError('invalid_scope');
$response->setErrorDescription(
'The requested scope is invalid, unknown, or malformed.'
);
'The requested scope is invalid, unknown, or malformed.');
return $response;
}
$scope = PhabricatorOAuthServerScope::scopesListToDict($scope);
@ -136,8 +130,7 @@ extends PhabricatorAuthController {
$response->setError('server_error');
$response->setErrorDescription(
'The authorization server encountered an unexpected condition '.
'which prevented it from fulfilling the request. '
);
'which prevented it from fulfilling the request. ');
return $response;
}
@ -162,8 +155,7 @@ extends PhabricatorAuthController {
if (!PhabricatorOAuthServerScope::validateScopesDict($desired_scopes)) {
$response->setError('invalid_scope');
$response->setErrorDescription(
'The requested scope is invalid, unknown, or malformed.'
);
'The requested scope is invalid, unknown, or malformed.');
return $response;
}
} else {
@ -185,16 +177,13 @@ extends PhabricatorAuthController {
->setUser($current_user)
->appendChild(
id(new AphrontFormStaticControl())
->setValue($description)
)
->setValue($description))
->appendChild(
PhabricatorOAuthServerScope::getCheckboxControl($desired_scopes)
)
PhabricatorOAuthServerScope::getCheckboxControl($desired_scopes))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue('Authorize')
->addCancelButton($cancel_uri)
);
->addCancelButton($cancel_uri));
$panel->appendChild($form);

View file

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

View file

@ -88,8 +88,7 @@ extends PhabricatorOAuthClientBaseController {
'Redirect URI must be a fully qualified domain name '.
'with no fragments. See '.
'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;
} else {
$client->save();
@ -124,20 +123,17 @@ extends PhabricatorOAuthClientBaseController {
id(new AphrontFormTextControl())
->setLabel('Name')
->setName('name')
->setValue($client->getName())
);
->setValue($client->getName()));
if ($this->isClientEdit()) {
$form
->appendChild(
id(new AphrontFormTextControl())
->setLabel('ID')
->setValue($phid)
)
->setValue($phid))
->appendChild(
id(new AphrontFormStaticControl())
->setLabel('Secret')
->setValue($client->getSecret())
);
->setValue($client->getSecret()));
}
$form
->appendChild(
@ -145,8 +141,7 @@ extends PhabricatorOAuthClientBaseController {
->setLabel('Redirect URI')
->setName('redirect_uri')
->setValue($client->getRedirectURI())
->setError($bad_redirect)
);
->setError($bad_redirect));
if ($this->isClientEdit()) {
$created = phabricator_datetime($client->getDateCreated(),
$current_user);
@ -156,27 +151,23 @@ extends PhabricatorOAuthClientBaseController {
->appendChild(
id(new AphrontFormStaticControl())
->setLabel('Created')
->setValue($created)
)
->setValue($created))
->appendChild(
id(new AphrontFormStaticControl())
->setLabel('Last Updated')
->setValue($updated)
);
->setValue($updated));
}
$form
->appendChild(
id(new AphrontFormSubmitControl())
->setValue($submit_button)
);
->setValue($submit_button));
$panel->appendChild($form);
return $this->buildStandardPageResponse(
array($error,
$panel
),
array('title' => $title)
);
array('title' => $title));
}
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -154,8 +154,8 @@ final class PhabricatorPeopleLogsController
$rows = array();
foreach ($logs as $log) {
$rows[] = array(
phabricator_date($log->getDateCreated(),$user),
phabricator_time($log->getDateCreated(),$user),
phabricator_date($log->getDateCreated(), $user),
phabricator_time($log->getDateCreated(), $user),
$log->getAction(),
$log->getActorPHID() ? $handles[$log->getActorPHID()]->getName() : null,
$handles[$log->getUserPHID()]->getName(),

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -33,7 +33,7 @@ final class ConduitAPI_phid_lookup_Method
$phids[$name] = $phid;
}
}
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$result = array();

View file

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

View file

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

View file

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

View file

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

View file

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

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