Skip to content

Commit f06caa7

Browse files
authored
Merge pull request #416 from oat-sa/feat/TR-6514/php-84
fix: correct php 8.4 notices
2 parents 68bc9e2 + 32a8870 commit f06caa7

File tree

120 files changed

+186
-186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+186
-186
lines changed

src/qtism/common/ResolutionException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class ResolutionException extends RuntimeException
3838
* @param string $message A human-readable description of the exception.
3939
* @param Exception $previous An optional previous Exception that caused the exception to be thrown.
4040
*/
41-
public function __construct($message, Exception $previous = null)
41+
public function __construct($message, ?Exception $previous = null)
4242
{
4343
parent::__construct($message, 0, $previous);
4444
}

src/qtism/common/beans/BeanException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class BeanException extends Exception
8787
* @param int $code An error code from the BeanException class constants.
8888
* @param Exception $previous An optional previous exception.
8989
*/
90-
public function __construct($message, $code = 0, Exception $previous = null)
90+
public function __construct($message, $code = 0, ?Exception $previous = null)
9191
{
9292
parent::__construct($message, $code, $previous);
9393
}

src/qtism/common/datatypes/files/FileManagerException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class FileManagerException extends Exception
4646
* @param int $code A machine understandable error code (see class constants).
4747
* @param Exception $previous A possible previous Exception object.
4848
*/
49-
public function __construct($message, $code = 0, Exception $previous = null)
49+
public function __construct($message, $code = 0, ?Exception $previous = null)
5050
{
5151
parent::__construct($message, $code, $previous);
5252
}

src/qtism/common/storage/MemoryStreamException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class MemoryStreamException extends StreamException
3939
* @param int $code A code describing the error.
4040
* @param Exception $previous An optional previous exception.
4141
*/
42-
public function __construct($message, IStream $source, $code = 0, Exception $previous = null)
42+
public function __construct($message, IStream $source, $code = 0, ?Exception $previous = null)
4343
{
4444
parent::__construct($message, $source, $code, $previous);
4545
}

src/qtism/common/storage/StreamAccessException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class StreamAccessException extends Exception
6161
* @param int $code An exception code. See class constants.
6262
* @param Exception $previous An optional previously thrown exception.
6363
*/
64-
public function __construct($message, AbstractStreamAccess $source, $code = 0, Exception $previous = null)
64+
public function __construct($message, AbstractStreamAccess $source, $code = 0, ?Exception $previous = null)
6565
{
6666
parent::__construct($message, $code, $previous);
6767
$this->setSource($source);

src/qtism/common/storage/StreamException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ abstract class StreamException extends Exception
101101
* @param int $code A code describing the error.
102102
* @param Exception $previous An optional previous exception.
103103
*/
104-
public function __construct($message, IStream $source, $code = 0, Exception $previous = null)
104+
public function __construct($message, IStream $source, $code = 0, ?Exception $previous = null)
105105
{
106106
parent::__construct($message, $code, $previous);
107107
$this->setSource($source);

src/qtism/data/AssessmentItem.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ public function getTemplateDeclarations(): TemplateDeclarationCollection
538538
*
539539
* @param TemplateProcessing $templateProcessing A TemplateProcessing object or null.
540540
*/
541-
public function setTemplateProcessing(TemplateProcessing $templateProcessing = null): void
541+
public function setTemplateProcessing(?TemplateProcessing $templateProcessing = null): void
542542
{
543543
$this->templateProcessing = $templateProcessing;
544544
}
@@ -589,7 +589,7 @@ public function getStylesheets(): StylesheetCollection
589589
*
590590
* @param ItemBody $itemBody An ItemBody object or the NULL value to state that the item has no content.
591591
*/
592-
public function setItemBody(ItemBody $itemBody = null): void
592+
public function setItemBody(?ItemBody $itemBody = null): void
593593
{
594594
$this->itemBody = $itemBody;
595595
}
@@ -629,7 +629,7 @@ public function getResponseProcessing(): ?ResponseProcessing
629629
*
630630
* @param ResponseProcessing $responseProcessing A ResponseProcessing object or null if no associated response processing.
631631
*/
632-
public function setResponseProcessing(ResponseProcessing $responseProcessing = null): void
632+
public function setResponseProcessing(?ResponseProcessing $responseProcessing = null): void
633633
{
634634
$this->responseProcessing = $responseProcessing;
635635
}

src/qtism/data/AssessmentItemRef.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class AssessmentItemRef extends SectionPart
8989
* @param IdentifierCollection $categories The categories to which the item belongs to.
9090
* @throws InvalidArgumentException If $href is not a string.
9191
*/
92-
public function __construct($identifier, $href, IdentifierCollection $categories = null)
92+
public function __construct($identifier, $href, ?IdentifierCollection $categories = null)
9393
{
9494
parent::__construct($identifier);
9595

src/qtism/data/AssessmentSection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public function getSelection(): ?Selection
203203
*
204204
* @param Selection $selection A selection rule.
205205
*/
206-
public function setSelection(Selection $selection = null): void
206+
public function setSelection(?Selection $selection = null): void
207207
{
208208
$this->selection = $selection;
209209
}
@@ -234,7 +234,7 @@ public function getOrdering(): ?Ordering
234234
*
235235
* @param Ordering $ordering An Ordering object.
236236
*/
237-
public function setOrdering(Ordering $ordering = null): void
237+
public function setOrdering(?Ordering $ordering = null): void
238238
{
239239
$this->ordering = $ordering;
240240
}

src/qtism/data/AssessmentTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class AssessmentTest extends QtiComponent implements QtiIdentifiable
149149
* @param $title
150150
* @param TestPartCollection|null $testParts
151151
*/
152-
public function __construct($identifier, $title, TestPartCollection $testParts = null)
152+
public function __construct($identifier, $title, ?TestPartCollection $testParts = null)
153153
{
154154
$this->setObservers(new SplObjectStorage());
155155

@@ -303,7 +303,7 @@ public function getTimeLimits(): ?TimeLimits
303303
*
304304
* @param TimeLimits $timeLimits A TimeLimits object.
305305
*/
306-
public function setTimeLimits(TimeLimits $timeLimits = null): void
306+
public function setTimeLimits(?TimeLimits $timeLimits = null): void
307307
{
308308
$this->timeLimits = $timeLimits;
309309
}
@@ -344,7 +344,7 @@ public function getOutcomeProcessing(): ?OutcomeProcessing
344344
*
345345
* @param OutcomeProcessing $outcomeProcessing An OutcomeProcessing object.
346346
*/
347-
public function setOutcomeProcessing(OutcomeProcessing $outcomeProcessing = null): void
347+
public function setOutcomeProcessing(?OutcomeProcessing $outcomeProcessing = null): void
348348
{
349349
$this->outcomeProcessing = $outcomeProcessing;
350350
}

0 commit comments

Comments
 (0)