diff --git a/CHANGELOG.md b/CHANGELOG.md index edab644..431c678 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.2.0 (unreleased) - Changed `Distance` to enum +- Dropped support for PHP < 8.1 ## 0.1.4 (2023-11-14) diff --git a/composer.json b/composer.json index a451e88..13f315b 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ } }, "require": { - "php": ">= 7.4" + "php": ">= 8.1" }, "require-dev": { "phpunit/phpunit": "^10", diff --git a/src/Vector.php b/src/Vector.php index c7a17d5..7405dd7 100644 --- a/src/Vector.php +++ b/src/Vector.php @@ -20,8 +20,7 @@ public function __construct($value) } } - // TODO use array_is_list when PHP < 8.1 no longer supported - if (!is_array($value)) { + if (!is_array($value) || !array_is_list($value)) { throw new \InvalidArgumentException("Expected array"); }