Skip to content

Commit

Permalink
chore: rename props, return null
Browse files Browse the repository at this point in the history
  • Loading branch information
shpran committed Aug 7, 2024
1 parent 8f6a918 commit 3d5d769
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions actions/class.RestQtiTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,20 +319,20 @@ private function getUploadedPackageData()
}

/**
* @return string
* @return string|null
* @throws common_exception_RestApi
*/
private function getSubclassLabel(): string
private function getSubclassLabel(): ?string
{
$packageLocale = $this->getPostParameter(self::SUBCLASS_LABEL, '');
$subclassLabel = $this->getPostParameter(self::SUBCLASS_LABEL);

if (!is_string($packageLocale)) {
if ($subclassLabel !== null && !is_string($subclassLabel)) {
throw new common_exception_RestApi(
sprintf('%s parameter should be string', self::SUBCLASS_LABEL)
);
}

return $packageLocale;
return $subclassLabel;
}

/**
Expand All @@ -343,7 +343,7 @@ private function getOverwriteTestUri(): ?string
{
$overwriteTestUri = $this->getPostParameter(self::OVERWRITE_TEST_URI);

if (!is_null($overwriteTestUri) && !is_string($overwriteTestUri)) {
if ($overwriteTestUri !== null && !is_string($overwriteTestUri)) {
throw new common_exception_RestApi(
sprintf('%s parameter should be string', self::OVERWRITE_TEST_URI)
);
Expand Down

0 comments on commit 3d5d769

Please sign in to comment.