Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/qtism/common/ResolutionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ResolutionException extends RuntimeException
* @param string $message A human-readable description of the exception.
* @param Exception $previous An optional previous Exception that caused the exception to be thrown.
*/
public function __construct($message, Exception $previous = null)
public function __construct($message, ?Exception $previous = null)
{
parent::__construct($message, 0, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/qtism/common/beans/BeanException.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class BeanException extends Exception
* @param int $code An error code from the BeanException class constants.
* @param Exception $previous An optional previous exception.
*/
public function __construct($message, $code = 0, Exception $previous = null)
public function __construct($message, $code = 0, ?Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/qtism/common/datatypes/files/FileManagerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class FileManagerException extends Exception
* @param int $code A machine understandable error code (see class constants).
* @param Exception $previous A possible previous Exception object.
*/
public function __construct($message, $code = 0, Exception $previous = null)
public function __construct($message, $code = 0, ?Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/qtism/common/storage/MemoryStreamException.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MemoryStreamException extends StreamException
* @param int $code A code describing the error.
* @param Exception $previous An optional previous exception.
*/
public function __construct($message, IStream $source, $code = 0, Exception $previous = null)
public function __construct($message, IStream $source, $code = 0, ?Exception $previous = null)
{
parent::__construct($message, $source, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/qtism/common/storage/StreamAccessException.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class StreamAccessException extends Exception
* @param int $code An exception code. See class constants.
* @param Exception $previous An optional previously thrown exception.
*/
public function __construct($message, AbstractStreamAccess $source, $code = 0, Exception $previous = null)
public function __construct($message, AbstractStreamAccess $source, $code = 0, ?Exception $previous = null)
{
parent::__construct($message, $code, $previous);
$this->setSource($source);
Expand Down
2 changes: 1 addition & 1 deletion src/qtism/common/storage/StreamException.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ abstract class StreamException extends Exception
* @param int $code A code describing the error.
* @param Exception $previous An optional previous exception.
*/
public function __construct($message, IStream $source, $code = 0, Exception $previous = null)
public function __construct($message, IStream $source, $code = 0, ?Exception $previous = null)
{
parent::__construct($message, $code, $previous);
$this->setSource($source);
Expand Down
6 changes: 3 additions & 3 deletions src/qtism/data/AssessmentItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ public function getTemplateDeclarations(): TemplateDeclarationCollection
*
* @param TemplateProcessing $templateProcessing A TemplateProcessing object or null.
*/
public function setTemplateProcessing(TemplateProcessing $templateProcessing = null): void
public function setTemplateProcessing(?TemplateProcessing $templateProcessing = null): void
{
$this->templateProcessing = $templateProcessing;
}
Expand Down Expand Up @@ -589,7 +589,7 @@ public function getStylesheets(): StylesheetCollection
*
* @param ItemBody $itemBody An ItemBody object or the NULL value to state that the item has no content.
*/
public function setItemBody(ItemBody $itemBody = null): void
public function setItemBody(?ItemBody $itemBody = null): void
{
$this->itemBody = $itemBody;
}
Expand Down Expand Up @@ -629,7 +629,7 @@ public function getResponseProcessing(): ?ResponseProcessing
*
* @param ResponseProcessing $responseProcessing A ResponseProcessing object or null if no associated response processing.
*/
public function setResponseProcessing(ResponseProcessing $responseProcessing = null): void
public function setResponseProcessing(?ResponseProcessing $responseProcessing = null): void
{
$this->responseProcessing = $responseProcessing;
}
Expand Down
2 changes: 1 addition & 1 deletion src/qtism/data/AssessmentItemRef.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class AssessmentItemRef extends SectionPart
* @param IdentifierCollection $categories The categories to which the item belongs to.
* @throws InvalidArgumentException If $href is not a string.
*/
public function __construct($identifier, $href, IdentifierCollection $categories = null)
public function __construct($identifier, $href, ?IdentifierCollection $categories = null)
{
parent::__construct($identifier);

Expand Down
4 changes: 2 additions & 2 deletions src/qtism/data/AssessmentSection.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public function getSelection(): ?Selection
*
* @param Selection $selection A selection rule.
*/
public function setSelection(Selection $selection = null): void
public function setSelection(?Selection $selection = null): void
{
$this->selection = $selection;
}
Expand Down Expand Up @@ -234,7 +234,7 @@ public function getOrdering(): ?Ordering
*
* @param Ordering $ordering An Ordering object.
*/
public function setOrdering(Ordering $ordering = null): void
public function setOrdering(?Ordering $ordering = null): void
{
$this->ordering = $ordering;
}
Expand Down
6 changes: 3 additions & 3 deletions src/qtism/data/AssessmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class AssessmentTest extends QtiComponent implements QtiIdentifiable
* @param $title
* @param TestPartCollection|null $testParts
*/
public function __construct($identifier, $title, TestPartCollection $testParts = null)
public function __construct($identifier, $title, ?TestPartCollection $testParts = null)
{
$this->setObservers(new SplObjectStorage());

Expand Down Expand Up @@ -303,7 +303,7 @@ public function getTimeLimits(): ?TimeLimits
*
* @param TimeLimits $timeLimits A TimeLimits object.
*/
public function setTimeLimits(TimeLimits $timeLimits = null): void
public function setTimeLimits(?TimeLimits $timeLimits = null): void
{
$this->timeLimits = $timeLimits;
}
Expand Down Expand Up @@ -344,7 +344,7 @@ public function getOutcomeProcessing(): ?OutcomeProcessing
*
* @param OutcomeProcessing $outcomeProcessing An OutcomeProcessing object.
*/
public function setOutcomeProcessing(OutcomeProcessing $outcomeProcessing = null): void
public function setOutcomeProcessing(?OutcomeProcessing $outcomeProcessing = null): void
{
$this->outcomeProcessing = $outcomeProcessing;
}
Expand Down
2 changes: 1 addition & 1 deletion src/qtism/data/BranchRuleTargetException.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class BranchRuleTargetException extends Exception implements QtiSdkPackageConten
* @param QtiComponent A QtiComponent from where the Exception comes from.
* @param Exception $previous An eventual previous Exception object.
*/
public function __construct($message, $code = 0, $source = null, Exception $previous = null)
public function __construct($message, $code = 0, $source = null, ?Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/qtism/data/ExtendedAssessmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ExtendedAssessmentTest extends AssessmentTest
* @param string $title A title.
* @param TestPartCollection $testParts A collection of ExtendedTestPart objects.
*/
public function __construct($identifier, $title, TestPartCollection $testParts = null)
public function __construct($identifier, $title, ?TestPartCollection $testParts = null)
{
parent::__construct($identifier, $title, $testParts);
$this->setTestFeedbackRefs(new TestFeedbackRefCollection());
Expand Down
4 changes: 2 additions & 2 deletions src/qtism/data/QtiComponentIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ protected function setRootComponent(QtiComponent $rootComponent): void
/**
* @param QtiComponent|null $currentContainer
*/
protected function setCurrentContainer(QtiComponent $currentContainer = null): void
protected function setCurrentContainer(?QtiComponent $currentContainer = null): void
{
$this->currentContainer = $currentContainer;
}
Expand Down Expand Up @@ -173,7 +173,7 @@ public function getRootComponent(): QtiComponent
*
* @param QtiComponent $currentComponent
*/
protected function setCurrentComponent(QtiComponent $currentComponent = null): void
protected function setCurrentComponent(?QtiComponent $currentComponent = null): void
{
$this->currentComponent = $currentComponent;
}
Expand Down
4 changes: 2 additions & 2 deletions src/qtism/data/QtiDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ abstract class QtiDocument
* @param string $versionNumber
* @param QtiComponent|null $documentComponent
*/
public function __construct($versionNumber = '2.1.0', QtiComponent $documentComponent = null)
public function __construct($versionNumber = '2.1.0', ?QtiComponent $documentComponent = null)
{
$this->setVersion($versionNumber);
$this->setDocumentComponent($documentComponent);
Expand Down Expand Up @@ -89,7 +89,7 @@ public function getVersion(): string
*
* @param QtiComponent $documentComponent A QTI Component object.
*/
public function setDocumentComponent(QtiComponent $documentComponent = null): void
public function setDocumentComponent(?QtiComponent $documentComponent = null): void
{
$this->documentComponent = $documentComponent;
}
Expand Down
4 changes: 2 additions & 2 deletions src/qtism/data/SectionPart.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public function getItemSessionControl(): ?ItemSessionControl
*
* @param ItemSessionControl $itemSessionControl An ItemSessionControl object.
*/
public function setItemSessionControl(ItemSessionControl $itemSessionControl = null): void
public function setItemSessionControl(?ItemSessionControl $itemSessionControl = null): void
{
$this->itemSessionControl = $itemSessionControl;
}
Expand Down Expand Up @@ -317,7 +317,7 @@ public function hasTimeLimits(): bool
*
* @param TimeLimits $timeLimits A TimeLimits object.
*/
public function setTimeLimits(TimeLimits $timeLimits = null): void
public function setTimeLimits(?TimeLimits $timeLimits = null): void
{
$this->timeLimits = $timeLimits;
}
Expand Down
4 changes: 2 additions & 2 deletions src/qtism/data/TestPart.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public function getItemSessionControl(): ?ItemSessionControl
*
* @param ItemSessionControl $itemSessionControl An ItemSessionControl object.
*/
public function setItemSessionControl(ItemSessionControl $itemSessionControl = null): void
public function setItemSessionControl(?ItemSessionControl $itemSessionControl = null): void
{
$this->itemSessionControl = $itemSessionControl;
}
Expand Down Expand Up @@ -315,7 +315,7 @@ public function getTimeLimits(): ?TimeLimits
*
* @param TimeLimits $timeLimits A TimeLimits object.
*/
public function setTimeLimits(TimeLimits $timeLimits = null): void
public function setTimeLimits(?TimeLimits $timeLimits = null): void
{
$this->timeLimits = $timeLimits;
}
Expand Down
4 changes: 2 additions & 2 deletions src/qtism/data/TimeLimits.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function hasMinTime(): bool
*
* @param QtiDuration $minTime A Duration object or null if unlimited.
*/
public function setMinTime(QtiDuration $minTime = null): void
public function setMinTime(?QtiDuration $minTime = null): void
{
// Prevent to get 0s durations stored.
if ($minTime !== null && $minTime->getSeconds(true) === 0) {
Expand Down Expand Up @@ -149,7 +149,7 @@ public function hasMaxTime(): bool
*
* @param QtiDuration $maxTime A duration object or null if unlimited.
*/
public function setMaxTime(QtiDuration $maxTime = null): void
public function setMaxTime(?QtiDuration $maxTime = null): void
{
// Prevent to get 0s durations stored.
if ($maxTime !== null && $maxTime->getSeconds(true) === 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/qtism/data/content/ModalFeedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class ModalFeedback extends QtiComponent
* @param string $title The title of the modal feedback.
* @throws InvalidArgumentException If any of the arguments is invalid.
*/
public function __construct($outcomeIdentifier, $identifier, FlowStaticCollection $content = null, $title = '')
public function __construct($outcomeIdentifier, $identifier, ?FlowStaticCollection $content = null, $title = '')
{
$this->setOutcomeIdentifier($outcomeIdentifier);
$this->setIdentifier($identifier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function __construct($responseIdentifier, ObjectElement $object, $id = ''
*
* @param QtiPoint $centerPoint A Point object or null.
*/
public function setCenterPoint(QtiPoint $centerPoint = null): void
public function setCenterPoint(?QtiPoint $centerPoint = null): void
{
$this->centerPoint = $centerPoint;
}
Expand Down
2 changes: 1 addition & 1 deletion src/qtism/data/content/interactions/SimpleMatchSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SimpleMatchSet extends QtiComponent
*
* @param SimpleAssociableChoiceCollection $simpleAssociableChoices The ordered set of choices for the set.
*/
public function __construct(SimpleAssociableChoiceCollection $simpleAssociableChoices = null)
public function __construct(?SimpleAssociableChoiceCollection $simpleAssociableChoices = null)
{
$this->setSimpleAssociableChoices($simpleAssociableChoices ?? new SimpleAssociableChoiceCollection());
}
Expand Down
4 changes: 2 additions & 2 deletions src/qtism/data/content/xhtml/html5/Html5Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function acceptBooleanOrNull($value, string $argumentName, ?bool $default
return $value ?? $default;
}

protected function acceptNormalizedStringOrNull($value, string $argumentName, string $default = null): string
protected function acceptNormalizedStringOrNull($value, string $argumentName, ?string $default = null): string
{
if ($value === null) {
return $default;
Expand Down Expand Up @@ -309,7 +309,7 @@ protected function acceptMimeTypeOrNull(?string $value, string $argumentName, st
* @return int
* @throws InvalidArgumentException If $value is not null, 0 or a positive integer.
*/
public function acceptNonNegativeIntegerOrNull($value, string $argumentName, int $default = null): int
public function acceptNonNegativeIntegerOrNull($value, string $argumentName, ?int $default = null): int
{
if ($value !== null && (!is_int($value) || $value < 0)) {
$given = is_int($value)
Expand Down
4 changes: 2 additions & 2 deletions src/qtism/data/content/xhtml/tables/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function hasSummary(): bool
*
* @param Caption $caption A Caption object or null.
*/
public function setCaption(Caption $caption = null): void
public function setCaption(?Caption $caption = null): void
{
$this->caption = $caption;
}
Expand Down Expand Up @@ -231,7 +231,7 @@ public function getColgroups(): ColgroupCollection
*
* @param Thead $thead A Thead object or null.
*/
public function setThead(Thead $thead = null): void
public function setThead(?Thead $thead = null): void
{
$this->thead = $thead;
}
Expand Down
2 changes: 1 addition & 1 deletion src/qtism/data/processing/OutcomeProcessing.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class OutcomeProcessing extends QtiComponent
*
* @param OutcomeRuleCollection $outcomeRules A collection of OutcomeRule objects.
*/
public function __construct(OutcomeRuleCollection $outcomeRules = null)
public function __construct(?OutcomeRuleCollection $outcomeRules = null)
{
if (empty($outcomeRules)) {
$outcomeRules = new OutcomeRuleCollection();
Expand Down
2 changes: 1 addition & 1 deletion src/qtism/data/processing/ResponseProcessing.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ResponseProcessing extends QtiComponent
*
* @param ResponseRuleCollection $responseRules A collection of ResponseRule objects.
*/
public function __construct(ResponseRuleCollection $responseRules = null)
public function __construct(?ResponseRuleCollection $responseRules = null)
{
if (empty($responseRules)) {
$responseRules = new ResponseRuleCollection();
Expand Down
6 changes: 3 additions & 3 deletions src/qtism/data/results/AssessmentResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class AssessmentResult extends QtiComponent
* @param TestResult|null $testResult
* @param ItemResultCollection|null $itemResults
*/
public function __construct(Context $context, TestResult $testResult = null, ItemResultCollection $itemResults = null)
public function __construct(Context $context, ?TestResult $testResult = null, ?ItemResultCollection $itemResults = null)
{
$this->setContext($context);
$this->setTestResult($testResult);
Expand Down Expand Up @@ -154,7 +154,7 @@ public function getTestResult(): ?TestResult
* @param TestResult $testResult
* @return $this
*/
public function setTestResult(TestResult $testResult = null)
public function setTestResult(?TestResult $testResult = null)
{
$this->testResult = $testResult;
return $this;
Expand Down Expand Up @@ -186,7 +186,7 @@ public function getItemResults(): ?ItemResultCollection
* @param ItemResultCollection|null $itemResults
* @return $this
*/
public function setItemResults(ItemResultCollection $itemResults = null)
public function setItemResults(?ItemResultCollection $itemResults = null)
{
$this->itemResults = $itemResults;
return $this;
Expand Down
4 changes: 2 additions & 2 deletions src/qtism/data/results/CandidateResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CandidateResponse extends QtiComponent
*
* @param ValueCollection|null $values
*/
public function __construct(ValueCollection $values = null)
public function __construct(?ValueCollection $values = null)
{
$this->setValues($values);
}
Expand Down Expand Up @@ -94,7 +94,7 @@ public function getValues(): ?ValueCollection
* @param ValueCollection|null $values
* @return $this
*/
public function setValues(ValueCollection $values = null)
public function setValues(?ValueCollection $values = null)
{
$this->values = $values;
return $this;
Expand Down
6 changes: 3 additions & 3 deletions src/qtism/data/results/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Context extends QtiComponent
* @param QtiIdentifier|null $sourcedId
* @param SessionIdentifierCollection|null $sessionIdentifiers
*/
public function __construct(QtiIdentifier $sourcedId = null, SessionIdentifierCollection $sessionIdentifiers = null)
public function __construct(?QtiIdentifier $sourcedId = null, ?SessionIdentifierCollection $sessionIdentifiers = null)
{
$this->setSourcedId($sourcedId);
if ($sessionIdentifiers === null) {
Expand Down Expand Up @@ -113,7 +113,7 @@ public function getSourcedId(): ?QtiIdentifier
* @param QtiIdentifier $sourcedId
* @return $this
*/
public function setSourcedId(QtiIdentifier $sourcedId = null)
public function setSourcedId(?QtiIdentifier $sourcedId = null)
{
$this->sourcedId = $sourcedId;
return $this;
Expand Down Expand Up @@ -145,7 +145,7 @@ public function getSessionIdentifiers(): SessionIdentifierCollection
* @param SessionIdentifierCollection $sessionIdentifiers
* @return $this
*/
public function setSessionIdentifiers(SessionIdentifierCollection $sessionIdentifiers = null)
public function setSessionIdentifiers(?SessionIdentifierCollection $sessionIdentifiers = null)
{
$this->sessionIdentifiers = $sessionIdentifiers;
return $this;
Expand Down
Loading
Loading