diff options
author | Chih-Hsuan Yen <[email protected]> | 2022-07-03 14:47:43 +0800 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-07-12 22:23:30 +0300 |
commit | d9861038bcc3cb2f38c7153bdca7d5ab89597afa (patch) | |
tree | 7b7b28f75714a24856106edce8dfdc0ec989057a /vendor/beberlei/assert/lib/Assert/InvalidArgumentException.php | |
parent | f8fe5e02f18ce3d61544865cc8eb22df18be6bf1 (diff) |
Update beberlei/assert for PHP 8 compatibility
Run `composer update beberlei/assert` using composer 2.3.8 on PHP 8.1.7
Updating other packages without updating this fails with:
```
Your requirements could not be resolved to an installable set of packages.
Problem 1
- beberlei/assert v3.2.2 requires php ^7 -> your php version (8.1.7) does not satisfy that requirement.
- spomky-labs/otphp v10.0.1 requires beberlei/assert ^3.0 -> satisfiable by beberlei/assert[v3.2.2].
- spomky-labs/otphp is locked to version v10.0.1 and an update of this package was not requested.
```
Diffstat (limited to 'vendor/beberlei/assert/lib/Assert/InvalidArgumentException.php')
-rw-r--r-- | vendor/beberlei/assert/lib/Assert/InvalidArgumentException.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/vendor/beberlei/assert/lib/Assert/InvalidArgumentException.php b/vendor/beberlei/assert/lib/Assert/InvalidArgumentException.php index 20c890992..9516e0774 100644 --- a/vendor/beberlei/assert/lib/Assert/InvalidArgumentException.php +++ b/vendor/beberlei/assert/lib/Assert/InvalidArgumentException.php @@ -16,11 +16,22 @@ namespace Assert; class InvalidArgumentException extends \InvalidArgumentException implements AssertionFailedException { + /** + * @var string|null + */ private $propertyPath; + + /** + * @var mixed + */ private $value; + + /** + * @var array + */ private $constraints; - public function __construct($message, $code, $propertyPath, $value, array $constraints = []) + public function __construct($message, $code, string $propertyPath = null, $value = null, array $constraints = []) { parent::__construct($message, $code); @@ -36,7 +47,7 @@ class InvalidArgumentException extends \InvalidArgumentException implements Asse * Useful to transport information about the nature of the error * back to higher layers. * - * @return string + * @return string|null */ public function getPropertyPath() { @@ -55,10 +66,8 @@ class InvalidArgumentException extends \InvalidArgumentException implements Asse /** * Get the constraints that applied to the failed assertion. - * - * @return array */ - public function getConstraints() + public function getConstraints(): array { return $this->constraints; } |