diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7432a5..600c390 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,7 @@ jobs: - "8.2" - "8.3" - "8.4" + - "8.5" dependencies: - lowest - highest @@ -72,6 +73,11 @@ jobs: if: ${{ matrix.dependencies == 'highest' && matrix.platform-reqs == 'ignore-platform-reqs' }} run: composer update --no-interaction --ignore-platform-reqs + # PHP 8.4 deprecates implicit nullable parameters, and psalm depends on many packages needing a higher version that fixes this. + - name: Install highest dependencies for psalm + working-directory: vendor-bin/psalm + run: composer update --no-interaction + - name: Run tests run: composer test diff --git a/composer.json b/composer.json index 0066bc8..a8d368d 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", "ext-json": "*", "ext-intl": "*" }, diff --git a/docker-compose.yml b/docker-compose.yml index 506fd06..c124689 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,4 +28,11 @@ services: dockerfile: php-8.4.Dockerfile volumes: - .:/app - working_dir: /app \ No newline at end of file + working_dir: /app + php8.5: + build: + context: . + dockerfile: php-8.5.Dockerfile + volumes: + - .:/app + working_dir: /app diff --git a/php-8.5.Dockerfile b/php-8.5.Dockerfile new file mode 100644 index 0000000..a206617 --- /dev/null +++ b/php-8.5.Dockerfile @@ -0,0 +1,27 @@ +FROM php:8.5-cli + +RUN apt-get update && apt-get install -y \ + zip \ + git \ + wget \ + gpg \ + libicu-dev && \ + pecl install xdebug && \ + docker-php-ext-enable xdebug && \ + docker-php-ext-configure intl --enable-intl && \ + docker-php-ext-install intl pcntl && \ + echo "xdebug.mode = develop,coverage,debug" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" + +ENV COMPOSER_ALLOW_SUPERUSER=1 \ + COMPOSER_PROCESS_TIMEOUT=1200 + +RUN curl --silent --show-error https://getcomposer.org/installer | php -- \ + --install-dir=/usr/bin --filename=composer && \ + git config --global --add safe.directory "*" + +RUN wget -O phive.phar https://phar.io/releases/phive.phar && \ + wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc && \ + gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79 && \ + gpg --verify phive.phar.asc phive.phar && \ + chmod +x phive.phar && \ + mv phive.phar /usr/local/bin/phive \ diff --git a/src/Comparator/EqualValueComparator.php b/src/Comparator/EqualValueComparator.php index 19795cd..7aa498a 100644 --- a/src/Comparator/EqualValueComparator.php +++ b/src/Comparator/EqualValueComparator.php @@ -111,10 +111,10 @@ private function getPropertiesWithoutDuplicates(Iterator $valueIterator): array| $valuesByProperty = []; while ($valueIterator->valid()) { $property = $valueIterator->key(); - if (isset($valuesByProperty[$property])) { + if ($property === null) { return null; } - if ($property === null) { + if (isset($valuesByProperty[$property])) { return null; } $valuesByProperty[$property] = $valueIterator->current(); diff --git a/vendor-bin/cs/composer.json b/vendor-bin/cs/composer.json index 31bfe6e..d963d69 100644 --- a/vendor-bin/cs/composer.json +++ b/vendor-bin/cs/composer.json @@ -1,5 +1,5 @@ { "require-dev": { - "squizlabs/php_codesniffer": "^3.8" + "squizlabs/php_codesniffer": "^4.0.1" } } diff --git a/vendor-bin/psalm/composer.json b/vendor-bin/psalm/composer.json index 7c112e0..22ae594 100644 --- a/vendor-bin/psalm/composer.json +++ b/vendor-bin/psalm/composer.json @@ -1,6 +1,6 @@ { "require-dev": { - "vimeo/psalm": "^6.5.1", + "vimeo/psalm": "^6.16.1", "psalm/plugin-phpunit": "^0.19.5" }, "conflict": {