diff --git a/src/applications/config/engine/PhabricatorSetupEngine.php b/src/applications/config/engine/PhabricatorSetupEngine.php index 3a3e6f0419..a4b5c01171 100644 --- a/src/applications/config/engine/PhabricatorSetupEngine.php +++ b/src/applications/config/engine/PhabricatorSetupEngine.php @@ -47,7 +47,7 @@ final class PhabricatorSetupEngine // because data may be at risk. PhabricatorSetupCheck::resetSetupState(); - return PhabricatorSetupCheck::newIssueResponse($issue); + return PhabricatorSetupCheck::newIssueResponse($fatal_issue); } $issue_keys = PhabricatorSetupCheck::getUnignoredIssueKeys($issues); diff --git a/src/applications/diffusion/DiffusionLintSaveRunner.php b/src/applications/diffusion/DiffusionLintSaveRunner.php index a1a2fe7d32..8f5e51d3b8 100644 --- a/src/applications/diffusion/DiffusionLintSaveRunner.php +++ b/src/applications/diffusion/DiffusionLintSaveRunner.php @@ -91,6 +91,7 @@ final class DiffusionLintSaveRunner extends Phobject { $this->lintCommit = $this->branch->getLintCommit(); } + $all_files = array(); if ($this->lintCommit) { try { $commit = $this->lintCommit; diff --git a/src/applications/diffusion/management/DiffusionRepositoryStorageManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryStorageManagementPanel.php index 2b92c73c97..7bd536495e 100644 --- a/src/applications/diffusion/management/DiffusionRepositoryStorageManagementPanel.php +++ b/src/applications/diffusion/management/DiffusionRepositoryStorageManagementPanel.php @@ -292,6 +292,8 @@ final class DiffusionRepositoryStorageManagementPanel $viewer = $this->getViewer(); $caught = null; + $refs = array(); + try { $refs = $repository->getAlmanacServiceRefs($viewer, $options); } catch (Exception $ex) { @@ -302,7 +304,6 @@ final class DiffusionRepositoryStorageManagementPanel $info_view = null; if ($caught) { - $refs = array(); $info_view = id(new PHUIInfoView()) ->setErrors( array( diff --git a/src/applications/files/engine/PhabricatorFileStorageEngine.php b/src/applications/files/engine/PhabricatorFileStorageEngine.php index 32c8ed13f8..06f53588f3 100644 --- a/src/applications/files/engine/PhabricatorFileStorageEngine.php +++ b/src/applications/files/engine/PhabricatorFileStorageEngine.php @@ -320,7 +320,7 @@ abstract class PhabricatorFileStorageEngine extends Phobject { } } - if (!$min) { + if (!$min || !isset($engine)) { return null; } diff --git a/src/applications/maniphest/conduit/ManiphestConduitAPIMethod.php b/src/applications/maniphest/conduit/ManiphestConduitAPIMethod.php index 640e30fee5..855769472a 100644 --- a/src/applications/maniphest/conduit/ManiphestConduitAPIMethod.php +++ b/src/applications/maniphest/conduit/ManiphestConduitAPIMethod.php @@ -157,7 +157,8 @@ abstract class ManiphestConduitAPIMethod extends ConduitAPIMethod { foreach ($changes as $type => $value) { $transaction = clone $template; $transaction->setTransactionType($type); - if ($type == PhabricatorTransactions::TYPE_COMMENT) { + if ($type == PhabricatorTransactions::TYPE_COMMENT && + isset($comments)) { $transaction->attachComment( id(new ManiphestTransactionComment()) ->setContent($comments)); diff --git a/src/applications/people/controller/PhabricatorPeopleInviteSendController.php b/src/applications/people/controller/PhabricatorPeopleInviteSendController.php index 78ab7573ed..d860eb17b6 100644 --- a/src/applications/people/controller/PhabricatorPeopleInviteSendController.php +++ b/src/applications/people/controller/PhabricatorPeopleInviteSendController.php @@ -17,6 +17,11 @@ final class PhabricatorPeopleInviteSendController $message = $request->getStr('message'); $emails = $request->getStr('emails'); $severity = PHUIInfoView::SEVERITY_ERROR; + + $any_valid = false; + $all_valid = true; + $actions = null; + if ($request->isFormPost()) { // NOTE: We aren't using spaces as a delimiter here because email // addresses with names often include spaces. @@ -42,8 +47,6 @@ final class PhabricatorPeopleInviteSendController $viewer, $email_list); - $any_valid = false; - $all_valid = true; foreach ($actions as $action) { if ($action->willSend()) { $any_valid = true; diff --git a/src/applications/people/typeahead/PhabricatorPeopleDatasource.php b/src/applications/people/typeahead/PhabricatorPeopleDatasource.php index c06ba5b458..4a2533a47c 100644 --- a/src/applications/people/typeahead/PhabricatorPeopleDatasource.php +++ b/src/applications/people/typeahead/PhabricatorPeopleDatasource.php @@ -35,6 +35,7 @@ final class PhabricatorPeopleDatasource $users = $this->executeQuery($query); $is_browse = $this->getIsBrowse(); + $handles = array(); if ($is_browse && $users) { $phids = mpull($users, 'getPHID'); diff --git a/src/applications/phid/query/PhabricatorObjectListQuery.php b/src/applications/phid/query/PhabricatorObjectListQuery.php index 78cdbbb9a4..cb679a6c9e 100644 --- a/src/applications/phid/query/PhabricatorObjectListQuery.php +++ b/src/applications/phid/query/PhabricatorObjectListQuery.php @@ -100,9 +100,9 @@ final class PhabricatorObjectListQuery extends Phobject { // If we're parsing with suffixes, strip them off any tokens and keep // track of them for later. $suffixes = $this->getSuffixes(); + $suffix_map = array(); if ($suffixes) { $suffixes = array_fuse($suffixes); - $suffix_map = array(); $stripped_map = array(); foreach ($name_map as $key => $name) { $found_suffixes = array(); diff --git a/src/applications/search/engine/PhabricatorProfileMenuEngine.php b/src/applications/search/engine/PhabricatorProfileMenuEngine.php index 7fbfe1c2da..dbd95f2fe8 100644 --- a/src/applications/search/engine/PhabricatorProfileMenuEngine.php +++ b/src/applications/search/engine/PhabricatorProfileMenuEngine.php @@ -392,6 +392,7 @@ abstract class PhabricatorProfileMenuEngine extends Phobject { private function loadBuiltinProfileItems($mode) { $object = $this->getProfileObject(); + $builtins = array(); switch ($mode) { case self::MODE_GLOBAL: @@ -403,7 +404,6 @@ abstract class PhabricatorProfileMenuEngine extends Phobject { $this->getCustomPHID()); break; case self::MODE_COMBINED: - $builtins = array(); $builtins[] = $this->getBuiltinCustomProfileItems( $object, $this->getCustomPHID()); diff --git a/src/applications/settings/controller/PhabricatorSettingsMainController.php b/src/applications/settings/controller/PhabricatorSettingsMainController.php index ded20a8e96..65fb40942b 100644 --- a/src/applications/settings/controller/PhabricatorSettingsMainController.php +++ b/src/applications/settings/controller/PhabricatorSettingsMainController.php @@ -114,7 +114,7 @@ final class PhabricatorSettingsMainController $crumbs->addTextCrumb($panel->getPanelName()); $crumbs->setBorder(true); - if ($this->user) { + if (isset($user)) { $header_text = pht('Edit Settings: %s', $user->getUserName()); } else { $header_text = pht('Edit Global Settings'); diff --git a/src/infrastructure/cache/PhutilAPCKeyValueCache.php b/src/infrastructure/cache/PhutilAPCKeyValueCache.php index 9af92ab914..08894204b4 100644 --- a/src/infrastructure/cache/PhutilAPCKeyValueCache.php +++ b/src/infrastructure/cache/PhutilAPCKeyValueCache.php @@ -25,10 +25,10 @@ final class PhutilAPCKeyValueCache extends PhutilKeyValueCache { $results = array(); $fetched = false; foreach ($keys as $key) { - if ($is_apcu) { - $result = apcu_fetch($key, $fetched); + if (!$is_apcu) { + continue; } - + $result = apcu_fetch($key, $fetched); if ($fetched) { $results[$key] = $result; } diff --git a/src/view/phui/PHUICurtainObjectRefView.php b/src/view/phui/PHUICurtainObjectRefView.php index 855aa855c6..6100f46e04 100644 --- a/src/view/phui/PHUICurtainObjectRefView.php +++ b/src/view/phui/PHUICurtainObjectRefView.php @@ -227,6 +227,7 @@ final class PHUICurtainObjectRefView } private function newIconView() { + $icon_view = null; $handle = $this->handle; if ($handle) { diff --git a/src/view/phui/PHUIInfoView.php b/src/view/phui/PHUIInfoView.php index fa08f0e9dd..2ab16ce105 100644 --- a/src/view/phui/PHUIInfoView.php +++ b/src/view/phui/PHUIInfoView.php @@ -84,6 +84,7 @@ final class PHUIInfoView extends AphrontTagView { return $this->icon; } + $icon = null; switch ($this->getSeverity()) { case self::SEVERITY_ERROR: $icon = 'fa-exclamation-circle'; diff --git a/src/view/phui/PHUIRemarkupPreviewPanel.php b/src/view/phui/PHUIRemarkupPreviewPanel.php index 46c0f5cd53..7429b8af8f 100644 --- a/src/view/phui/PHUIRemarkupPreviewPanel.php +++ b/src/view/phui/PHUIRemarkupPreviewPanel.php @@ -89,6 +89,7 @@ final class PHUIRemarkupPreviewPanel extends AphrontTagView { ), $loading); + $content = null; if (!$this->previewType) { $header = null; if ($this->header) { diff --git a/support/startup/PhabricatorClientLimit.php b/support/startup/PhabricatorClientLimit.php index 63a50a3c91..ef528083f0 100644 --- a/support/startup/PhabricatorClientLimit.php +++ b/support/startup/PhabricatorClientLimit.php @@ -201,7 +201,7 @@ abstract class PhabricatorClientLimit { $bucket = apcu_fetch($bucket_key); } - if (!is_array($bucket)) { + if (!isset($bucket) || !is_array($bucket)) { $bucket = array(); } @@ -238,7 +238,7 @@ abstract class PhabricatorClientLimit { // If we don't have any buckets stored yet, store the current bucket as // the oldest bucket. $cur = $this->getCurrentBucketID(); - if (!$min) { + if (!isset($min) || !$min) { if ($is_apcu) { @apcu_store($min_key, $cur); }