diff --git a/src/qtism/data/ExtendedAssessmentItemRef.php b/src/qtism/data/ExtendedAssessmentItemRef.php index 41f89d34c..beb9416bf 100644 --- a/src/qtism/data/ExtendedAssessmentItemRef.php +++ b/src/qtism/data/ExtendedAssessmentItemRef.php @@ -163,7 +163,7 @@ class ExtendedAssessmentItemRef extends AssessmentItemRef implements IAssessment * @param IdentifierCollection $categories Optional categories. * @throws InvalidArgumentException if $identifier is not a valid QTI Identifier or $href is not a valid URI. */ - public function __construct($identifier, $href, IdentifierCollection $categories = null) + public function __construct($identifier, $href, ?IdentifierCollection $categories = null) { parent::__construct($identifier, $href, $categories); @@ -201,7 +201,7 @@ public function getOutcomeDeclarations(): OutcomeDeclarationCollection * * @param ResponseProcessing $responseProcessing A ResponseProcessing object or null if no response processing described. */ - public function setResponseProcessing(ResponseProcessing $responseProcessing = null): void + public function setResponseProcessing(?ResponseProcessing $responseProcessing = null): void { $this->responseProcessing = $responseProcessing; } @@ -231,7 +231,7 @@ public function hasResponseProcessing(): bool * * @param TemplateProcessing $templateProcessing */ - public function setTemplateProcessing(TemplateProcessing $templateProcessing = null): void + public function setTemplateProcessing(?TemplateProcessing $templateProcessing = null): void { $this->templateProcessing = $templateProcessing; } diff --git a/src/qtism/data/IAssessmentItem.php b/src/qtism/data/IAssessmentItem.php index 985be7e51..50301a2a6 100644 --- a/src/qtism/data/IAssessmentItem.php +++ b/src/qtism/data/IAssessmentItem.php @@ -130,7 +130,7 @@ public function getResponseProcessing(): ?ResponseProcessing; * * @param ResponseProcessing $responseProcessing A ResponseProcessing object or null if no associated response processing. */ - public function setResponseProcessing(ResponseProcessing $responseProcessing = null); + public function setResponseProcessing(?ResponseProcessing $responseProcessing = null); /** * Get the associated TemplateProcessing object. @@ -144,7 +144,7 @@ public function getTemplateProcessing(): ?TemplateProcessing; * * @param TemplateProcessing $templateProcessing A TemplateProcessing object or null if no associated template processing. */ - public function setTemplateProcessing(TemplateProcessing $templateProcessing = null); + public function setTemplateProcessing(?TemplateProcessing $templateProcessing = null); /** * Get the response variable identifiers related to endAttemptInteractions in the item content. diff --git a/src/qtism/data/rules/TemplateCondition.php b/src/qtism/data/rules/TemplateCondition.php index dcdb28711..7dfecd0f4 100644 --- a/src/qtism/data/rules/TemplateCondition.php +++ b/src/qtism/data/rules/TemplateCondition.php @@ -70,8 +70,11 @@ class TemplateCondition extends QtiComponent implements TemplateRule * @param TemplateElseIfCollection $templateElseIfs The collection of TemplateElseIf objects composing the template condition. * @param TemplateElse $templateElse An optional TemplateElse object composing the template condition. */ - public function __construct(TemplateIf $templateIf, TemplateElseIfCollection $templateElseIfs = null, TemplateElse $templateElse = null) - { + public function __construct( + TemplateIf $templateIf, + ?TemplateElseIfCollection $templateElseIfs = null, + ?TemplateElse $templateElse = null + ) { $this->setTemplateIf($templateIf); $this->setTemplateElseIfs($templateElseIfs ?? new TemplateElseIfCollection()); $this->setTemplateElse($templateElse); diff --git a/src/qtism/runtime/expressions/ExpressionEngine.php b/src/qtism/runtime/expressions/ExpressionEngine.php index b147d3ad6..23e77028a 100644 --- a/src/qtism/runtime/expressions/ExpressionEngine.php +++ b/src/qtism/runtime/expressions/ExpressionEngine.php @@ -84,7 +84,7 @@ class ExpressionEngine extends AbstractEngine * @param QtiComponent $expression The Expression object to be processed. * @param State $context (optional) The execution context. If no execution context is given, a virgin one will be set up. */ - public function __construct(QtiComponent $expression, State $context = null) + public function __construct(QtiComponent $expression, ?State $context = null) { parent::__construct($expression, $context); diff --git a/src/qtism/runtime/pci/json/MarshallingException.php b/src/qtism/runtime/pci/json/MarshallingException.php index 13839ea91..43cccded9 100644 --- a/src/qtism/runtime/pci/json/MarshallingException.php +++ b/src/qtism/runtime/pci/json/MarshallingException.php @@ -43,7 +43,7 @@ class MarshallingException extends Exception implements QtiSdkPackageContentExce * @param int $code A machine-understandable (see class constants) error code. * @param Exception $previous An eventual 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); } diff --git a/src/qtism/runtime/pci/json/UnmarshallingException.php b/src/qtism/runtime/pci/json/UnmarshallingException.php index aeea98c92..cf69ae4bd 100644 --- a/src/qtism/runtime/pci/json/UnmarshallingException.php +++ b/src/qtism/runtime/pci/json/UnmarshallingException.php @@ -46,7 +46,7 @@ class UnmarshallingException extends Exception * @param int $code A machine-understandable (see class constants) error code. * @param Exception $previous An eventual 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); } diff --git a/src/qtism/runtime/rendering/markup/AbstractMarkupRenderer.php b/src/qtism/runtime/rendering/markup/AbstractMarkupRenderer.php index 4746513ad..6cc661906 100644 --- a/src/qtism/runtime/rendering/markup/AbstractMarkupRenderer.php +++ b/src/qtism/runtime/rendering/markup/AbstractMarkupRenderer.php @@ -44,7 +44,7 @@ abstract class AbstractMarkupRenderer implements Renderable * * @param AbstractMarkupRenderingEngine|null $renderingEngine */ - public function __construct(AbstractMarkupRenderingEngine $renderingEngine = null) + public function __construct(?AbstractMarkupRenderingEngine $renderingEngine = null) { $this->setRenderingEngine($renderingEngine); } @@ -52,7 +52,7 @@ public function __construct(AbstractMarkupRenderingEngine $renderingEngine = nul /** * @param AbstractMarkupRenderingEngine|null $renderingEngine */ - public function setRenderingEngine(AbstractMarkupRenderingEngine $renderingEngine = null): void + public function setRenderingEngine(?AbstractMarkupRenderingEngine $renderingEngine = null): void { $this->renderingEngine = $renderingEngine; } diff --git a/src/qtism/runtime/rendering/markup/AbstractMarkupRenderingEngine.php b/src/qtism/runtime/rendering/markup/AbstractMarkupRenderingEngine.php index 4f9fe4c6c..6ad55b8b0 100644 --- a/src/qtism/runtime/rendering/markup/AbstractMarkupRenderingEngine.php +++ b/src/qtism/runtime/rendering/markup/AbstractMarkupRenderingEngine.php @@ -378,7 +378,7 @@ protected function getExploredComponent(): QtiComponent * * @param QtiComponent $component */ - protected function setExploredComponent(QtiComponent $component = null): void + protected function setExploredComponent(?QtiComponent $component = null): void { $this->exploredComponent = $component; } @@ -409,7 +409,7 @@ protected function getLastRendering() * * @param Interaction $interaction */ - protected function setCurrentInteraction(Interaction $interaction = null): void + protected function setCurrentInteraction(?Interaction $interaction = null): void { $this->currentInteraction = $interaction; } diff --git a/src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php b/src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php index 320b62b65..1072150f0 100644 --- a/src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php +++ b/src/qtism/runtime/rendering/markup/xhtml/AbstractXhtmlRenderer.php @@ -64,7 +64,7 @@ abstract class AbstractXhtmlRenderer extends AbstractMarkupRenderer * * @param AbstractMarkupRenderingEngine $renderingEngine */ - public function __construct(AbstractMarkupRenderingEngine $renderingEngine = null) + public function __construct(?AbstractMarkupRenderingEngine $renderingEngine = null) { parent::__construct($renderingEngine); } diff --git a/src/qtism/runtime/rendering/markup/xhtml/BodyElementRenderer.php b/src/qtism/runtime/rendering/markup/xhtml/BodyElementRenderer.php index 6e165cf18..2baf62185 100644 --- a/src/qtism/runtime/rendering/markup/xhtml/BodyElementRenderer.php +++ b/src/qtism/runtime/rendering/markup/xhtml/BodyElementRenderer.php @@ -43,7 +43,7 @@ class BodyElementRenderer extends AbstractXhtmlRenderer * * @param AbstractMarkupRenderingEngine $renderingEngine */ - public function __construct(AbstractMarkupRenderingEngine $renderingEngine = null) + public function __construct(?AbstractMarkupRenderingEngine $renderingEngine = null) { parent::__construct($renderingEngine); $this->additionalClass('qti-bodyElement'); diff --git a/src/qtism/runtime/rendering/markup/xhtml/FeedbackBlockRenderer.php b/src/qtism/runtime/rendering/markup/xhtml/FeedbackBlockRenderer.php index 71157edc6..a6673ce7e 100644 --- a/src/qtism/runtime/rendering/markup/xhtml/FeedbackBlockRenderer.php +++ b/src/qtism/runtime/rendering/markup/xhtml/FeedbackBlockRenderer.php @@ -45,7 +45,7 @@ class FeedbackBlockRenderer extends FeedbackElementRenderer * * @param AbstractMarkupRenderingEngine $renderingEngine */ - public function __construct(AbstractMarkupRenderingEngine $renderingEngine = null) + public function __construct(?AbstractMarkupRenderingEngine $renderingEngine = null) { parent::__construct($renderingEngine); $this->transform('div');