Skip to content

Commit 856b368

Browse files
committed
fix: deprecations issues
1 parent c9c1db6 commit 856b368

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/Exception/InvalidArgumentException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class InvalidArgumentException extends \Exception
88

99
{
1010

11-
public function __construct($ruleName, $parameterCount, $code = 0, Exception $previous = null)
11+
public function __construct($ruleName, $parameterCount, $code = 0, ?Exception $previous = null)
1212
{
1313
parent::__construct(sprintf("Validation rule %s requires at least %d parameters", $ruleName, $parameterCount), $code, $previous);
1414
}

src/Exception/MethodNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class MethodNotFoundException extends \Exception
88

99
{
10-
public function __construct($sanitizationMethod, $code = 0, Exception $previous = null)
10+
public function __construct($sanitizationMethod, $code = 0, ?Exception $previous = null)
1111
{
1212
parent::__construct(sprintf("Unsupported sanitization method: %s.", $sanitizationMethod), $code, $previous);
1313
}

src/Exception/RuleErrorException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class RuleErrorException extends \Exception
88

99
{
10-
public function __construct($ruleName, $code = 0, Exception $previous = null)
10+
public function __construct($ruleName, $code = 0, ?Exception $previous = null)
1111
{
1212
parent::__construct(sprintf("Unsupported validation rule: %s.", $ruleName), $code, $previous);
1313
}

src/InputDataContainer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function getAttributeKey()
2828

2929
public function getAttributeValue($key = null)
3030
{
31-
$keys = explode('.', trim($this->attributeKey, '[]'));
31+
$keys = explode('.', trim($this->attributeKey ?? '', '[]'));
3232

3333
$data = $this->data;
3434

@@ -63,7 +63,7 @@ public function getData()
6363

6464
public function setAttributeValue($value): void
6565
{
66-
$keys = explode('.', trim($this->attributeKey, '[]'));
66+
$keys = explode('.', trim($this->attributeKey ?? '', '[]'));
6767

6868
if (\count($keys) > 1) {
6969
$this->setNestedElement($this->data, $keys, $value);

0 commit comments

Comments
 (0)