Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: deprecation errors #414

Merged
merged 2 commits into from
Feb 25, 2025
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
6 changes: 3 additions & 3 deletions src/qtism/data/ExtendedAssessmentItemRef.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/qtism/data/IAssessmentItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
7 changes: 5 additions & 2 deletions src/qtism/data/rules/TemplateCondition.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/qtism/runtime/expressions/ExpressionEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/qtism/runtime/pci/json/MarshallingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/qtism/runtime/pci/json/UnmarshallingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/qtism/runtime/rendering/markup/AbstractMarkupRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ abstract class AbstractMarkupRenderer implements Renderable
*
* @param AbstractMarkupRenderingEngine|null $renderingEngine
*/
public function __construct(AbstractMarkupRenderingEngine $renderingEngine = null)
public function __construct(?AbstractMarkupRenderingEngine $renderingEngine = null)
{
$this->setRenderingEngine($renderingEngine);
}

/**
* @param AbstractMarkupRenderingEngine|null $renderingEngine
*/
public function setRenderingEngine(AbstractMarkupRenderingEngine $renderingEngine = null): void
public function setRenderingEngine(?AbstractMarkupRenderingEngine $renderingEngine = null): void
{
$this->renderingEngine = $renderingEngine;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Loading