Skip to content

Commit 903b243

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Prevent parsing invalid octal digits as octal numbers [DI] fix ContainerBuilder on PHP8 [Console] Make sure $maxAttempts is an int or null. [VarDumper] Fix caster for invalid SplFileInfo objects on php 8. [Intl] Skip test cases that produce a TypeError on php 8. [PhpUnitBridge] Adjust output parsing for PHPUnit 9.3. [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x add bosnian (bs) translation [Debug] Parse "x not found" errors correctly on php 8.
2 parents 4044c64 + 5e2200b commit 903b243

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Question/Question.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,11 @@ public function getValidator()
220220
*/
221221
public function setMaxAttempts($attempts)
222222
{
223-
if (null !== $attempts && $attempts < 1) {
224-
throw new InvalidArgumentException('Maximum number of attempts must be a positive value.');
223+
if (null !== $attempts) {
224+
$attempts = (int) $attempts;
225+
if ($attempts < 1) {
226+
throw new InvalidArgumentException('Maximum number of attempts must be a positive value.');
227+
}
225228
}
226229

227230
$this->attempts = $attempts;

0 commit comments

Comments
 (0)