mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 13:30:55 +01:00
Fix implicitly nullable parameter declarations for PHP 8.4
Summary: Followup to rPdb61eb20 and rPf3d49f74. This patch should cover all remaining issues now that PHPStan covers it (instead of the previous trial-and-error approach). Implicitly nullable parameter declarations are deprecated in PHP 8.4: https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated The proposed syntax was introduced in PHP 7.1 and Phorge requires PHP 7.2 now. Test Plan: Run static code analysis. Reviewers: O1 Blessed Committers, avivey Reviewed By: O1 Blessed Committers, avivey Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Differential Revision: https://we.phorge.it/D25832
This commit is contained in:
parent
f3d49f7407
commit
5f4587bb88
39 changed files with 56 additions and 56 deletions
|
@ -125,7 +125,7 @@ final class PhabricatorAuthInviteEngine extends Phobject {
|
|||
private function handleLoggedInInvite(
|
||||
PhabricatorAuthInvite $invite,
|
||||
PhabricatorUser $viewer,
|
||||
PhabricatorUserEmail $email = null) {
|
||||
?PhabricatorUserEmail $email = null) {
|
||||
|
||||
if ($email && ($email->getUserPHID() !== $viewer->getPHID())) {
|
||||
$other_user = $this->loadUserForEmail($email);
|
||||
|
|
|
@ -485,8 +485,8 @@ abstract class PhabricatorController extends AphrontController {
|
|||
|
||||
protected function buildTransactionTimeline(
|
||||
PhabricatorApplicationTransactionInterface $object,
|
||||
PhabricatorApplicationTransactionQuery $query = null,
|
||||
PhabricatorMarkupEngine $engine = null,
|
||||
?PhabricatorApplicationTransactionQuery $query = null,
|
||||
?PhabricatorMarkupEngine $engine = null,
|
||||
$view_data = array()) {
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
|
|
@ -55,7 +55,7 @@ abstract class PhabricatorCalendarImportEngine
|
|||
final protected function importEventDocument(
|
||||
PhabricatorUser $viewer,
|
||||
PhabricatorCalendarImport $import,
|
||||
PhutilCalendarRootNode $root = null) {
|
||||
?PhutilCalendarRootNode $root = null) {
|
||||
|
||||
$event_type = PhutilCalendarEventNode::NODETYPE;
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ final class PhutilCalendarRecurrenceSet
|
|||
}
|
||||
|
||||
public function getEventsBetween(
|
||||
PhutilCalendarDateTime $start = null,
|
||||
PhutilCalendarDateTime $end = null,
|
||||
?PhutilCalendarDateTime $start = null,
|
||||
?PhutilCalendarDateTime $end = null,
|
||||
$limit = null) {
|
||||
|
||||
if ($end === null && $limit === null) {
|
||||
|
|
|
@ -527,9 +527,9 @@ final class PhabricatorConduitAPIController
|
|||
|
||||
private function buildHumanReadableResponse(
|
||||
$method,
|
||||
ConduitAPIRequest $request = null,
|
||||
?ConduitAPIRequest $request = null,
|
||||
$result = null,
|
||||
ConduitAPIMethod $method_implementation = null) {
|
||||
?ConduitAPIMethod $method_implementation = null) {
|
||||
|
||||
$param_rows = array();
|
||||
$param_rows[] = array('Method', $this->renderAPIValue($method));
|
||||
|
|
|
@ -80,7 +80,7 @@ final class ConduitGetCertificateConduitAPIMethod extends ConduitAPIMethod {
|
|||
|
||||
private function logFailure(
|
||||
ConduitAPIRequest $request,
|
||||
PhabricatorConduitCertificateToken $info = null) {
|
||||
?PhabricatorConduitCertificateToken $info = null) {
|
||||
|
||||
$log = PhabricatorUserLog::initializeNewLog(
|
||||
$request->getUser(),
|
||||
|
|
|
@ -75,7 +75,7 @@ final class PhabricatorConfigSettingsListController
|
|||
|
||||
private function newConfigOptionView(
|
||||
PhabricatorConfigOption $option,
|
||||
PhabricatorConfigEntry $stored_value = null) {
|
||||
?PhabricatorConfigEntry $stored_value = null) {
|
||||
|
||||
$summary = $option->getSummary();
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ final class ConpherenceDurableColumnView extends AphrontTagView {
|
|||
}
|
||||
|
||||
public function setSelectedConpherence(
|
||||
ConpherenceThread $conpherence = null) {
|
||||
?ConpherenceThread $conpherence = null) {
|
||||
$this->selectedConpherence = $conpherence;
|
||||
return $this;
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ final class PhabricatorDashboardAdjustController
|
|||
private function handleMoveRequest(
|
||||
PhabricatorDashboard $dashboard,
|
||||
PhabricatorDashboardPanelRef $panel_ref,
|
||||
PhabricatorDashboardPanelRef $after_ref = null) {
|
||||
?PhabricatorDashboardPanelRef $after_ref = null) {
|
||||
|
||||
$request = $this->getRequest();
|
||||
$request->validateCSRF();
|
||||
|
|
|
@ -121,7 +121,7 @@ final class PhabricatorDashboardPanelRefList
|
|||
public function movePanelRef(
|
||||
PhabricatorDashboardPanelRef $target,
|
||||
$column_key,
|
||||
PhabricatorDashboardPanelRef $after = null) {
|
||||
?PhabricatorDashboardPanelRef $after = null) {
|
||||
|
||||
$target->setColumnKey($column_key);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ abstract class DifferentialConduitAPIMethod extends ConduitAPIMethod {
|
|||
|
||||
protected function buildInlineInfoDictionary(
|
||||
DifferentialInlineComment $inline,
|
||||
DifferentialChangeset $changeset = null) {
|
||||
?DifferentialChangeset $changeset = null) {
|
||||
|
||||
$file_path = null;
|
||||
$diff_id = null;
|
||||
|
|
|
@ -863,8 +863,8 @@ final class DifferentialRevisionViewController
|
|||
|
||||
private function loadChangesetsAndVsMap(
|
||||
DifferentialDiff $target,
|
||||
DifferentialDiff $diff_vs = null,
|
||||
PhabricatorRepository $repository = null) {
|
||||
?DifferentialDiff $diff_vs = null,
|
||||
?PhabricatorRepository $repository = null) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$load_diffs = array($target);
|
||||
|
@ -1049,7 +1049,7 @@ final class DifferentialRevisionViewController
|
|||
array $changesets,
|
||||
array $vs_changesets,
|
||||
array $vs_map,
|
||||
PhabricatorRepository $repository = null) {
|
||||
?PhabricatorRepository $repository = null) {
|
||||
|
||||
assert_instances_of($changesets, 'DifferentialChangeset');
|
||||
assert_instances_of($vs_changesets, 'DifferentialChangeset');
|
||||
|
|
|
@ -105,7 +105,7 @@ abstract class DifferentialChangesetRenderer extends Phobject {
|
|||
return $this->depthOnlyLines;
|
||||
}
|
||||
|
||||
public function attachOldFile(PhabricatorFile $old = null) {
|
||||
public function attachOldFile(?PhabricatorFile $old = null) {
|
||||
$this->oldFile = $old;
|
||||
return $this;
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ abstract class DifferentialChangesetRenderer extends Phobject {
|
|||
return (bool)$this->oldFile;
|
||||
}
|
||||
|
||||
public function attachNewFile(PhabricatorFile $new = null) {
|
||||
public function attachNewFile(?PhabricatorFile $new = null) {
|
||||
$this->newFile = $new;
|
||||
return $this;
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ final class DiffusionLastModifiedController extends DiffusionController {
|
|||
|
||||
private function renderColumns(
|
||||
DiffusionRequest $drequest,
|
||||
PhabricatorRepositoryCommit $commit = null,
|
||||
?PhabricatorRepositoryCommit $commit = null,
|
||||
$lint = null) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ final class DiffusionLocalRepositoryFilter extends Phobject {
|
|||
return $this->viewer;
|
||||
}
|
||||
|
||||
public function setDevice(AlmanacDevice $device = null) {
|
||||
public function setDevice(?AlmanacDevice $device = null) {
|
||||
$this->device = $device;
|
||||
return $this;
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ final class DiffusionDocumentRenderingEngine
|
|||
|
||||
protected function addApplicationCrumbs(
|
||||
PHUICrumbsView $crumbs,
|
||||
PhabricatorDocumentRef $ref = null) {
|
||||
?PhabricatorDocumentRef $ref = null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ final class DiffusionCommitRevisionQuery
|
|||
PhabricatorUser $viewer,
|
||||
$source_object,
|
||||
array $object_names,
|
||||
PhabricatorRepository $repository_scope = null) {
|
||||
?PhabricatorRepository $repository_scope = null) {
|
||||
|
||||
// Fetch commits first, since we need to load data on commits in order
|
||||
// to identify associated revisions later on.
|
||||
|
|
|
@ -39,7 +39,7 @@ final class PhabricatorDocumentEngineBlocks
|
|||
}
|
||||
|
||||
public function addBlockList(
|
||||
PhabricatorDocumentRef $ref = null,
|
||||
?PhabricatorDocumentRef $ref = null,
|
||||
array $blocks = array()) {
|
||||
|
||||
assert_instances_of($blocks, 'PhabricatorDocumentEngineBlock');
|
||||
|
|
|
@ -32,8 +32,8 @@ abstract class PhabricatorDocumentEngine
|
|||
}
|
||||
|
||||
public function canDiffDocuments(
|
||||
PhabricatorDocumentRef $uref = null,
|
||||
PhabricatorDocumentRef $vref = null) {
|
||||
?PhabricatorDocumentRef $uref = null,
|
||||
?PhabricatorDocumentRef $vref = null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ final class PhabricatorImageDocumentEngine
|
|||
}
|
||||
|
||||
public function canDiffDocuments(
|
||||
PhabricatorDocumentRef $uref = null,
|
||||
PhabricatorDocumentRef $vref = null) {
|
||||
?PhabricatorDocumentRef $uref = null,
|
||||
?PhabricatorDocumentRef $vref = null) {
|
||||
|
||||
// For now, we can only render a rich image diff if the documents have
|
||||
// their data stored in Files already.
|
||||
|
@ -36,8 +36,8 @@ final class PhabricatorImageDocumentEngine
|
|||
}
|
||||
|
||||
public function newEngineBlocks(
|
||||
PhabricatorDocumentRef $uref = null,
|
||||
PhabricatorDocumentRef $vref = null) {
|
||||
?PhabricatorDocumentRef $uref = null,
|
||||
?PhabricatorDocumentRef $vref = null) {
|
||||
|
||||
if ($uref) {
|
||||
$u_blocks = $this->newDiffBlocks($uref);
|
||||
|
|
|
@ -36,14 +36,14 @@ final class PhabricatorJupyterDocumentEngine
|
|||
}
|
||||
|
||||
public function canDiffDocuments(
|
||||
PhabricatorDocumentRef $uref = null,
|
||||
PhabricatorDocumentRef $vref = null) {
|
||||
?PhabricatorDocumentRef $uref = null,
|
||||
?PhabricatorDocumentRef $vref = null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function newEngineBlocks(
|
||||
PhabricatorDocumentRef $uref = null,
|
||||
PhabricatorDocumentRef $vref = null) {
|
||||
?PhabricatorDocumentRef $uref = null,
|
||||
?PhabricatorDocumentRef $vref = null) {
|
||||
|
||||
$blocks = new PhabricatorDocumentEngineBlocks();
|
||||
|
||||
|
|
|
@ -329,7 +329,7 @@ abstract class PhabricatorDocumentRenderingEngine
|
|||
|
||||
protected function addApplicationCrumbs(
|
||||
PHUICrumbsView $crumbs,
|
||||
PhabricatorDocumentRef $ref = null) {
|
||||
?PhabricatorDocumentRef $ref = null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ final class PhabricatorFileDocumentRenderingEngine
|
|||
|
||||
protected function addApplicationCrumbs(
|
||||
PHUICrumbsView $crumbs,
|
||||
PhabricatorDocumentRef $ref = null) {
|
||||
?PhabricatorDocumentRef $ref = null) {
|
||||
|
||||
if ($ref) {
|
||||
$file = $ref->getFile();
|
||||
|
|
|
@ -1534,7 +1534,7 @@ final class PhabricatorProjectCoreTestCase extends PhabricatorTestCase {
|
|||
|
||||
private function createProject(
|
||||
PhabricatorUser $user,
|
||||
PhabricatorProject $parent = null,
|
||||
?PhabricatorProject $parent = null,
|
||||
$is_milestone = false) {
|
||||
|
||||
$project = PhabricatorProject::initializeNewProject($user, $parent);
|
||||
|
|
|
@ -54,7 +54,7 @@ final class ProjectBoardTaskCard extends Phobject {
|
|||
return $this->task;
|
||||
}
|
||||
|
||||
public function setOwner(PhabricatorObjectHandle $owner = null) {
|
||||
public function setOwner(?PhabricatorObjectHandle $owner = null) {
|
||||
$this->owner = $owner;
|
||||
return $this;
|
||||
}
|
||||
|
|
|
@ -405,7 +405,7 @@ final class PhabricatorRepositoryPullLocalDaemon
|
|||
private function loadPullableRepositories(
|
||||
array $include,
|
||||
array $exclude,
|
||||
AlmanacDevice $device = null) {
|
||||
?AlmanacDevice $device = null) {
|
||||
|
||||
$query = id(new PhabricatorRepositoryQuery())
|
||||
->setViewer($this->getViewer());
|
||||
|
|
|
@ -172,7 +172,7 @@ final class PhabricatorRepositoryPullEngine
|
|||
$this->donePull();
|
||||
}
|
||||
|
||||
private function abortPull($message, Exception $ex = null) {
|
||||
private function abortPull($message, ?Exception $ex = null) {
|
||||
$code_error = PhabricatorRepositoryStatusMessage::CODE_ERROR;
|
||||
$this->updateRepositoryInitStatus($code_error, $message);
|
||||
if ($ex) {
|
||||
|
|
|
@ -437,7 +437,7 @@ final class PhutilSearchQueryCompiler
|
|||
|
||||
private function renderToken(
|
||||
PhutilSearchQueryToken $token,
|
||||
PhutilSearchStemmer $stemmer = null) {
|
||||
?PhutilSearchStemmer $stemmer = null) {
|
||||
$value = $token->getValue();
|
||||
|
||||
if ($stemmer) {
|
||||
|
|
|
@ -227,7 +227,7 @@ final class PhutilSearchQueryCompilerTestCase
|
|||
private function assertCompileQueries(
|
||||
array $tests,
|
||||
$operators = null,
|
||||
PhutilSearchStemmer $stemmer = null) {
|
||||
?PhutilSearchStemmer $stemmer = null) {
|
||||
foreach ($tests as $input => $expect) {
|
||||
$caught = null;
|
||||
|
||||
|
|
|
@ -263,7 +263,7 @@ class PhabricatorElasticFulltextStorageEngine
|
|||
$exceptions);
|
||||
}
|
||||
|
||||
public function indexExists(PhabricatorElasticsearchHost $host = null) {
|
||||
public function indexExists(?PhabricatorElasticsearchHost $host = null) {
|
||||
if (!$host) {
|
||||
$host = $this->getHostForRead();
|
||||
}
|
||||
|
@ -397,7 +397,7 @@ class PhabricatorElasticFulltextStorageEngine
|
|||
return $data;
|
||||
}
|
||||
|
||||
public function indexIsSane(PhabricatorElasticsearchHost $host = null) {
|
||||
public function indexIsSane(?PhabricatorElasticsearchHost $host = null) {
|
||||
if (!$host) {
|
||||
$host = $this->getHostForRead();
|
||||
}
|
||||
|
@ -476,7 +476,7 @@ class PhabricatorElasticFulltextStorageEngine
|
|||
$this->executeRequest($host, '/', $data, 'PUT');
|
||||
}
|
||||
|
||||
public function getIndexStats(PhabricatorElasticsearchHost $host = null) {
|
||||
public function getIndexStats(?PhabricatorElasticsearchHost $host = null) {
|
||||
if ($this->version < 2) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ final class PhabricatorDashboardProfileMenuItem
|
|||
return true;
|
||||
}
|
||||
|
||||
private function attachDashboard(PhabricatorDashboard $dashboard = null) {
|
||||
private function attachDashboard(?PhabricatorDashboard $dashboard = null) {
|
||||
$this->dashboard = $dashboard;
|
||||
return $this;
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ final class PhabricatorSearchApplicationSearchEngine
|
|||
}
|
||||
|
||||
public static function getIndexableDocumentTypes(
|
||||
PhabricatorUser $viewer = null) {
|
||||
?PhabricatorUser $viewer = null) {
|
||||
|
||||
// TODO: This is inelegant and not very efficient, but gets us reasonable
|
||||
// results. It would be nice to do this more elegantly.
|
||||
|
|
|
@ -146,7 +146,7 @@ final class PhabricatorEmailPreferencesSettingsPanel
|
|||
return $form_box;
|
||||
}
|
||||
|
||||
private function getAllEditorsWithTags(PhabricatorUser $user = null) {
|
||||
private function getAllEditorsWithTags(?PhabricatorUser $user = null) {
|
||||
$editors = id(new PhutilClassMapQuery())
|
||||
->setAncestorClass('PhabricatorApplicationTransactionEditor')
|
||||
->setFilterMethod('getMailTagsMap')
|
||||
|
@ -165,7 +165,7 @@ final class PhabricatorEmailPreferencesSettingsPanel
|
|||
return $editors;
|
||||
}
|
||||
|
||||
private function getAllTags(PhabricatorUser $user = null) {
|
||||
private function getAllTags(?PhabricatorUser $user = null) {
|
||||
$tags = array();
|
||||
foreach ($this->getAllEditorsWithTags($user) as $editor) {
|
||||
$tags += $editor->getMailTagsMap();
|
||||
|
|
|
@ -4,7 +4,7 @@ abstract class PhabricatorSetting extends Phobject {
|
|||
|
||||
private $viewer = false;
|
||||
|
||||
public function setViewer(PhabricatorUser $viewer = null) {
|
||||
public function setViewer(?PhabricatorUser $viewer = null) {
|
||||
$this->viewer = $viewer;
|
||||
return $this;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ abstract class PhabricatorDraftEngine
|
|||
}
|
||||
|
||||
final public function setVersionedDraft(
|
||||
PhabricatorVersionedDraft $draft = null) {
|
||||
?PhabricatorVersionedDraft $draft = null) {
|
||||
$this->hasVersionedDraft = true;
|
||||
$this->versionedDraft = $draft;
|
||||
return $this;
|
||||
|
|
|
@ -288,7 +288,7 @@ abstract class PhabricatorInlineComment
|
|||
|
||||
public function attachVersionedDraftForViewer(
|
||||
PhabricatorUser $viewer,
|
||||
PhabricatorVersionedDraft $draft = null) {
|
||||
?PhabricatorVersionedDraft $draft = null) {
|
||||
|
||||
$key = $viewer->getCacheFragment();
|
||||
$this->versionedDrafts[$key] = $draft;
|
||||
|
@ -415,7 +415,7 @@ abstract class PhabricatorInlineComment
|
|||
|
||||
private function getWireContentStateMap(
|
||||
$is_edit,
|
||||
PhabricatorUser $viewer = null) {
|
||||
?PhabricatorUser $viewer = null) {
|
||||
|
||||
$initial_state = $this->getInitialContentState();
|
||||
$committed_state = $this->getCommittedContentState();
|
||||
|
|
|
@ -205,7 +205,7 @@ final class PhabricatorGlobalLockTestCase
|
|||
|
||||
private function tryHeldLock(
|
||||
$lock_name,
|
||||
AphrontDatabaseConnection $conn = null) {
|
||||
?AphrontDatabaseConnection $conn = null) {
|
||||
|
||||
$lock = PhabricatorGlobalLock::newLock($lock_name);
|
||||
|
||||
|
|
|
@ -273,7 +273,7 @@ final class AphrontDialogView
|
|||
}
|
||||
|
||||
public function setValidationException(
|
||||
PhabricatorApplicationTransactionValidationException $ex = null) {
|
||||
?PhabricatorApplicationTransactionValidationException $ex = null) {
|
||||
$this->validationException = $ex;
|
||||
return $this;
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ final class PHUIObjectBoxView extends AphrontTagView {
|
|||
}
|
||||
|
||||
public function setValidationException(
|
||||
PhabricatorApplicationTransactionValidationException $ex = null) {
|
||||
?PhabricatorApplicationTransactionValidationException $ex = null) {
|
||||
$this->validationException = $ex;
|
||||
return $this;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue