Clean up signatures of ref group accessors

No need to hedge on null.

Change-Id: I2afb7619a113d784741bd7d29eccf4d8368fe56f
This commit is contained in:
Arlo Breault 2020-11-05 10:38:16 -05:00 committed by jenkins-bot
parent 0254f138ab
commit 049735ba0e

View file

@ -41,9 +41,11 @@ class ReferencesData {
/**
* @param string $groupName
* @param bool $allocIfMissing
* @return RefGroup|null
* @return ?RefGroup
*/
public function getRefGroup( string $groupName = '', bool $allocIfMissing = false ): ?RefGroup {
public function getRefGroup(
string $groupName, bool $allocIfMissing = false
): ?RefGroup {
if ( !isset( $this->refGroups[$groupName] ) && $allocIfMissing ) {
$this->refGroups[$groupName] = new RefGroup( $groupName );
}
@ -51,13 +53,11 @@ class ReferencesData {
}
/**
* @param ?string $groupName
* @param string $groupName
*/
public function removeRefGroup( ?string $groupName = null ): void {
if ( $groupName !== null ) {
// '' is a valid group (the default group)
unset( $this->refGroups[$groupName] );
}
public function removeRefGroup( string $groupName ): void {
// '' is a valid group (the default group)
unset( $this->refGroups[$groupName] );
}
/**