diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..940f91d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +insert_final_newline = true diff --git a/.gitattributes b/.gitattributes index 3076a58..1762b37 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ +/.editorconfig export-ignore /.github export-ignore /.gitattributes export-ignore /.gitignore export-ignore diff --git a/.github/actions/ci-env/action.yml b/.github/actions/ci-env/action.yml deleted file mode 100644 index da7069c..0000000 --- a/.github/actions/ci-env/action.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: ci-env -description: Load CI env -runs: - using: composite - steps: - - - name: Composer cache - uses: actions/cache@v2 - with: - path: vendor - key: composer-${{ hashFiles('composer.json') }} - restore-keys: composer-${{ hashFiles('composer.json') }} - - - shell: bash - run: bin/ci/env diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c78b12..d07b1d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,72 +1,18 @@ name: CI on: [push] jobs: - phpcs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: bin/ci/phpcs - - phpstan: - runs-on: ubuntu-latest - strategy: - matrix: - php: [--php=8.1, --php=8.2, --php=8.3] - steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/ci-env - - run: bin/ci/phpstan ${{ matrix.php }} - - phpdd: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/ci-env - - run: bin/ci/phpdd - - composer-require-checker: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/ci-env - - run: bin/ci/composer-require-checker - - composer-validate: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: bin/ci/composer-validate - - shellcheck: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: bin/ci/shellcheck - - unused-scanner: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: bin/ci/unused-scanner - - phpunit-symfony-6: - runs-on: ubuntu-latest - strategy: - matrix: - php: [--php=8.1, --php=8.2, --php=8.3] - symfony: [--symfony=6.1, --symfony=6.2, --symfony=6.3, --symfony=6.4] - steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/ci-env - - run: bin/ci/phpunit ${{ matrix.php }} ${{ matrix.symfony }} - - phpunit-symfony-7: - runs-on: ubuntu-latest - strategy: - matrix: - php: [--php=8.2, --php=8.3] - symfony: [--symfony=7.0, --symfony=7.1] - steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/ci-env - - run: bin/ci/phpunit ${{ matrix.php }} ${{ matrix.symfony }} + validate: + runs-on: ubuntu-latest + steps: + - + name: Checkout repository + uses: actions/checkout@v4 + - + name: Composer cache + uses: actions/cache@v3 + with: + path: vendor + key: composer-${{ hashFiles('composer.json') }} + restore-keys: composer-${{ hashFiles('composer.json') }} + - run: bin/ci/env + - run: bin/ci/validate --theme=summary diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 715d818..a10c7d1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,10 +12,12 @@ jobs: name: Release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - + name: Checkout repository + uses: actions/checkout@v4 - name: Composer cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: vendor key: composer-${{ hashFiles('composer.json') }} diff --git a/bin/ci/docker b/bin/ci/docker index 4491ba3..06786f8 100755 --- a/bin/ci/docker +++ b/bin/ci/docker @@ -6,5 +6,5 @@ readonly ROOT_PATH="$(realpath "$(dirname "$(realpath "$0")")/../..")" source "${ROOT_PATH}"/bin/common.inc.sh DOCKER_IMAGE_NAME="${CI_DOCKER_IMAGE_NAME}" \ - DOCKER_FILE_PATH="${ROOT_PATH}"/docker/ci/Dockerfile \ + DOCKERFILE_PATH="${ROOT_PATH}"/docker/ci \ source "${ROOT_PATH}"/bin/docker-build.inc.bash diff --git a/bin/ci/env b/bin/ci/env index bc97bca..0eb64c5 100755 --- a/bin/ci/env +++ b/bin/ci/env @@ -6,4 +6,4 @@ readonly ROOT_PATH="$(realpath "$(dirname "$(realpath "$0")")/../..")" . "${ROOT_PATH}"/bin/common.inc.sh . "${ROOT_PATH}"/bin/dockerise.inc.bash -"${ROOT_PATH}"/bin/composer install +"${ROOT_PATH}"/bin/composer install --ansi diff --git a/bin/ci/phpcs b/bin/ci/phpcs index 2ac8ae8..c8f26c6 100755 --- a/bin/ci/phpcs +++ b/bin/ci/phpcs @@ -10,13 +10,4 @@ if [ ! -d "${ROOT_PATH}"/var/ci/phpcs ]; then mkdir -p "${ROOT_PATH}"/var/ci/phpcs fi -phpcs \ - -p \ - --warning-severity=0 \ - --ignore=/vendor/,/var/,*Enum.php \ - --bootstrap=config/ci/phpcs.php \ - --standard="${COMPOSER_HOME}"/vendor/steevanb/php-code-sniffs/src/Steevanb/ruleset.xml \ - --report=steevanb\\PhpCodeSniffs\\Reports\\Steevanb \ - --cache="${ROOT_PATH}"/var/ci/phpcs/cache \ - . \ - "${@}" +phpcs --standard="${ROOT_PATH}"/config/ci/phpcs.xml "${@}" diff --git a/bin/ci/phpstan.php b/bin/ci/phpstan.php index 1366a5a..1cca52e 100644 --- a/bin/ci/phpstan.php +++ b/bin/ci/phpstan.php @@ -14,7 +14,7 @@ function createPhpstanProcesses(): ProcessInterfaceCollection { - $phpVersions = new StringCollection(['8.1', '8.2', '8.3']); + $phpVersions = new StringCollection(['8.1', '8.2', '8.3', '8.4']); $return = new ProcessInterfaceCollection(); foreach ($phpVersions->toArray() as $loopPhpVersion) { diff --git a/bin/ci/phpunit.inc.php b/bin/ci/phpunit.inc.php index 8f6d902..a26407b 100644 --- a/bin/ci/phpunit.inc.php +++ b/bin/ci/phpunit.inc.php @@ -10,17 +10,17 @@ function createPhpunitProcesses(string $phpVersion = null, string $symfonyVersion = null): ProcessInterfaceCollection { - $phpVersions = new StringCollection(is_string($phpVersion) ? [$phpVersion] : ['8.1', '8.2', '8.3']); + $phpVersions = new StringCollection(is_string($phpVersion) ? [$phpVersion] : ['8.1', '8.2', '8.3', '8.4']); $symfonyVersions = new StringCollection( - is_string($symfonyVersion) ? [$symfonyVersion] : ['6.1', '6.2', '6.3', '6.4', '7.0', '7.1'] + is_string($symfonyVersion) ? [$symfonyVersion] : ['6.1', '6.2', '6.3', '6.4', '7.0', '7.1', '7.2'] ); $return = new ProcessInterfaceCollection(); foreach ($phpVersions->toArray() as $loopPhpVersion) { foreach ($symfonyVersions->toArray() as $loopSymfonyVersion) { if ( - in_array($loopSymfonyVersion, ['7.0', '7.1']) - && in_array($loopPhpVersion, ['8.2', '8.3'], true) === false + in_array($loopSymfonyVersion, ['7.0', '7.1', '7.2']) + && in_array($loopPhpVersion, ['8.2', '8.3', '8.4'], true) === false ) { continue; } diff --git a/bin/ci/validate.php b/bin/ci/validate.php index f21c9f7..28e37bb 100644 --- a/bin/ci/validate.php +++ b/bin/ci/validate.php @@ -19,4 +19,5 @@ ->addProcess(new Process([__DIR__ . '/phpunit'])) ->addProcess(new Process([__DIR__ . '/shellcheck'])) ->addProcess(new Process([__DIR__ . '/unused-scanner'])) + ->setRefreshInterval(100000) ->run(new ArgvInput($argv)); diff --git a/bin/common.inc.sh b/bin/common.inc.sh index 6ad4e5f..65c6d75 100644 --- a/bin/common.inc.sh +++ b/bin/common.inc.sh @@ -2,5 +2,5 @@ set -eu -readonly CI_DOCKER_IMAGE_NAME="steevanb/php-collection:ci" -readonly RELEASE_DOCKER_IMAGE_NAME="steevanb/php-collection:release" +readonly CI_DOCKER_IMAGE_NAME=ghcr.io/steevanb/php-collection:ci +readonly RELEASE_DOCKER_IMAGE_NAME=ghcr.io/steevanb/php-collection:release diff --git a/bin/dev/generate-php-collections b/bin/dev/generate-php-collections index a0c2d76..34a51e9 100755 --- a/bin/dev/generate-php-collections +++ b/bin/dev/generate-php-collections @@ -6,4 +6,4 @@ readonly ROOT_PATH="$(realpath "$(dirname "$(realpath "$0")")/../..")" source "${ROOT_PATH}"/bin/common.inc.sh BIN_DIR=bin/dev COMPOSER_HOME=/app/var/composer source "${ROOT_PATH}"/bin/dockerise.inc.bash -php /app/bin/dev/generate-php-collections.php +php8.4 /app/bin/dev/generate-php-collections.php diff --git a/bin/docker-build.inc.bash b/bin/docker-build.inc.bash index bd9443a..eed9860 100644 --- a/bin/docker-build.inc.bash +++ b/bin/docker-build.inc.bash @@ -15,12 +15,9 @@ function buildDockerImage() { DOCKER_BUILDKIT=1 \ docker \ build \ - --file "${dockerFilePath}" \ - --tag="${dockerImageName}" \ - --build-arg DOCKER_UID="$(id -u)" \ - --build-arg DOCKER_GID="$(id -g)" \ + --tag "${dockerImageName}" \ ${refreshArguments} \ - "${ROOT_PATH}" + "${dockerFilePath}" } function pushDockerImage() { @@ -40,7 +37,7 @@ for param in "${@}"; do fi done -buildDockerImage "${DOCKER_IMAGE_NAME}" "${DOCKER_FILE_PATH}" +buildDockerImage "${DOCKER_IMAGE_NAME}" "${DOCKERFILE_PATH}" if [ "${push}" == true ]; then pushDockerImage "${DOCKER_IMAGE_NAME}" diff --git a/bin/release/docker b/bin/release/docker index 8d070e4..8aae7be 100755 --- a/bin/release/docker +++ b/bin/release/docker @@ -6,5 +6,5 @@ readonly ROOT_PATH="$(realpath "$(dirname "$(realpath "$0")")/../..")" source "${ROOT_PATH}"/bin/common.inc.sh DOCKER_IMAGE_NAME="${RELEASE_DOCKER_IMAGE_NAME}" \ - DOCKER_FILE_PATH="${ROOT_PATH}"/docker/release/Dockerfile \ + DOCKERFILE_PATH="${ROOT_PATH}"/docker/release \ source "${ROOT_PATH}"/bin/docker-build.inc.bash diff --git a/bridge/Symfony/Normalizer/ObjectCollectionDenormalizer.php b/bridge/Symfony/Normalizer/ObjectCollectionDenormalizer.php index c99b63f..81c3241 100644 --- a/bridge/Symfony/Normalizer/ObjectCollectionDenormalizer.php +++ b/bridge/Symfony/Normalizer/ObjectCollectionDenormalizer.php @@ -20,8 +20,12 @@ class ObjectCollectionDenormalizer implements DenormalizerInterface, Denormalize use DenormalizerAwareTrait; /** @param array $context */ - public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool - { + public function supportsDenormalization( + mixed $data, + string $type, + ?string $format = null, + array $context = [] + ): bool { return is_subclass_of($type, AbstractObjectCollection::class) || is_subclass_of($type, AbstractObjectNullableCollection::class); @@ -43,7 +47,7 @@ public function getSupportedTypes(?string $format): array public function denormalize( mixed $data, string $type, - string $format = null, + ?string $format = null, array $context = [] ): AbstractObjectCollection|AbstractObjectNullableCollection { /** @var class-string|AbstractObjectNullableCollection> $type */ diff --git a/bridge/Symfony/Normalizer/ScalarCollectionDenormalizer.php b/bridge/Symfony/Normalizer/ScalarCollectionDenormalizer.php index d0d88e6..4ad099d 100644 --- a/bridge/Symfony/Normalizer/ScalarCollectionDenormalizer.php +++ b/bridge/Symfony/Normalizer/ScalarCollectionDenormalizer.php @@ -18,8 +18,12 @@ class ScalarCollectionDenormalizer implements DenormalizerInterface { /** @param array $context */ - public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool - { + public function supportsDenormalization( + mixed $data, + string $type, + ?string $format = null, + array $context = [] + ): bool { return in_array( $type, [ @@ -54,7 +58,7 @@ public function getSupportedTypes(?string $format): array public function denormalize( mixed $data, string $type, - string $format = null, + ?string $format = null, array $context = [] ): CollectionInterface { /** diff --git a/config/ci/phpcs.php b/config/ci/phpcs.php deleted file mode 100644 index c45e0b1..0000000 --- a/config/ci/phpcs.php +++ /dev/null @@ -1,7 +0,0 @@ - + + + + /var + /vendor + + + + ../../ + **/*Enum.php + + + + + + + + diff --git a/config/ci/phpstan.neon b/config/ci/phpstan.neon index 741eef5..6489d6e 100644 --- a/config/ci/phpstan.neon +++ b/config/ci/phpstan.neon @@ -7,6 +7,9 @@ parameters: - ../../tests excludePaths: - ../../tests/Unit/ArrayTest.php + ignoreErrors: + # str_replace() accepts string|int|null + - "#Parameter \\#2 \\$replace of function str_replace expects array\\|string, array given#" includes: - /composer/common/vendor/phpstan/phpstan-deprecation-rules/rules.neon - /composer/common/vendor/phpstan/phpstan-phpunit/extension.neon diff --git a/config/ci/phpstan.php-8.4.neon b/config/ci/phpstan.php-8.4.neon new file mode 100644 index 0000000..b89d6ef --- /dev/null +++ b/config/ci/phpstan.php-8.4.neon @@ -0,0 +1,4 @@ +includes: + - phpstan.neon +parameters: + tmpDir: ../../var/ci/phpstan/php-8-4 diff --git a/config/ci/phpunit.php-8.4.xml b/config/ci/phpunit.php-8.4.xml new file mode 100644 index 0000000..e9f6e12 --- /dev/null +++ b/config/ci/phpunit.php-8.4.xml @@ -0,0 +1,10 @@ + + + + ../../tests + + + diff --git a/docker/ci/Dockerfile b/docker/ci/Dockerfile index 6689d43..d9ebc0e 100644 --- a/docker/ci/Dockerfile +++ b/docker/ci/Dockerfile @@ -1,63 +1,63 @@ -FROM ubuntu:24.04 - -COPY --from=composer:2.7.6 /usr/bin/composer /usr/local/bin/composer - -ENV COMPOSER_HOME=/composer/common -ENV COMPOSER_HOME_SYMFONY_6_1=/composer/symfony-6-1 -ENV COMPOSER_HOME_SYMFONY_6_2=/composer/symfony-6-2 -ENV COMPOSER_HOME_SYMFONY_6_3=/composer/symfony-6-3 -ENV COMPOSER_HOME_SYMFONY_6_4=/composer/symfony-6-4 -ENV COMPOSER_HOME_SYMFONY_7_0=/composer/symfony-7-0 -ENV COMPOSER_HOME_SYMFONY_7_1=/composer/symfony-7-1 -ENV PHPSTAN_BIN_PATH=/usr/local/bin/phpstan - -COPY docker/ci/composer.json ${COMPOSER_HOME}/composer.json - -RUN \ - apt-get update \ - # To add add-apt-repository - && apt-get install -y software-properties-common \ - && LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php \ - && apt-get install -y \ - bash \ - shellcheck \ - php8.1-cli \ - php8.1-simplexml \ - php8.2-cli \ - php8.2-simplexml \ - php8.3-cli \ - php8.3-simplexml \ - # For Composer - curl zip php8.1-curl php8.1-zip php8.2-curl php8.2-zip \ - # For unused-scanner and phpunit - php8.1-mbstring php8.2-mbstring php8.3-mbstring \ - # For coverage - php8.2-xdebug \ - && update-alternatives --set php /usr/bin/php8.1 \ - - # Install CI tools - && composer global up \ - && ln -s ${COMPOSER_HOME}/vendor/bin/composer-require-checker /usr/local/bin/composer-require-checker \ - && ln -s ${COMPOSER_HOME}/vendor/bin/phpdd /usr/local/bin/phpdd \ - && ln -s ${COMPOSER_HOME}/vendor/bin/phpcs /usr/local/bin/phpcs \ - && ln -s ${COMPOSER_HOME}/vendor/bin/phpstan /usr/local/bin/phpstan \ - && ln -s ${COMPOSER_HOME}/vendor/bin/unused_scanner /usr/local/bin/unused-scanner \ - - # Install Symfony components - && COMPOSER_HOME=${COMPOSER_HOME_SYMFONY_6_1} composer global require symfony/serializer:6.1.* \ - && COMPOSER_HOME=${COMPOSER_HOME_SYMFONY_6_2} composer global require symfony/serializer:6.2.* \ - && COMPOSER_HOME=${COMPOSER_HOME_SYMFONY_6_3} composer global require symfony/serializer:6.3.* \ - && COMPOSER_HOME=${COMPOSER_HOME_SYMFONY_6_4} composer global require symfony/serializer:6.4.* \ - - && update-alternatives --set php /usr/bin/php8.2 \ - && COMPOSER_HOME=${COMPOSER_HOME_SYMFONY_7_0} composer global require symfony/serializer:7.0.* \ - && COMPOSER_HOME=${COMPOSER_HOME_SYMFONY_7_1} composer global require symfony/serializer:7.1.* \ - - # Purge - && apt-get purge -y software-properties-common \ - && apt-get autoremove -y \ - && apt-get clean \ - && apt-get autoclean \ - && rm -rf /tmp/* - -WORKDIR /app +FROM ubuntu:24.04 + +COPY --from=composer:2.8.9 /usr/bin/composer /usr/local/bin/composer + +ENV COMPOSER_HOME=/composer/common +ENV COMPOSER_HOME_SYMFONY_6_1=/composer/symfony-6-1 +ENV COMPOSER_HOME_SYMFONY_6_2=/composer/symfony-6-2 +ENV COMPOSER_HOME_SYMFONY_6_3=/composer/symfony-6-3 +ENV COMPOSER_HOME_SYMFONY_6_4=/composer/symfony-6-4 +ENV COMPOSER_HOME_SYMFONY_7_0=/composer/symfony-7-0 +ENV COMPOSER_HOME_SYMFONY_7_1=/composer/symfony-7-1 +ENV COMPOSER_HOME_SYMFONY_7_2=/composer/symfony-7-2 +ENV PHPSTAN_BIN_PATH=/usr/local/bin/phpstan + +COPY composer.json ${COMPOSER_HOME}/composer.json + +RUN \ + apt-get update \ + # To add add-apt-repository + && apt-get install -y software-properties-common \ + && LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php \ + && apt-get install -y \ + bash \ + shellcheck \ + php8.1-cli \ + php8.1-simplexml \ + php8.2-cli \ + php8.2-simplexml \ + php8.3-cli \ + php8.3-simplexml \ + php8.4-cli \ + php8.4-simplexml \ + # For Composer + curl zip php8.1-curl php8.1-zip php8.2-curl php8.2-zip \ + # For unused-scanner and phpunit + php8.1-mbstring php8.2-mbstring php8.3-mbstring php8.4-mbstring \ + # For coverage + php8.2-xdebug \ + && update-alternatives --set php /usr/bin/php8.1 \ + # Install CI tools + && composer global up \ + && ln -s ${COMPOSER_HOME}/vendor/bin/composer-require-checker /usr/local/bin/composer-require-checker \ + && ln -s ${COMPOSER_HOME}/vendor/bin/phpdd /usr/local/bin/phpdd \ + && ln -s ${COMPOSER_HOME}/vendor/bin/phpcs /usr/local/bin/phpcs \ + && ln -s ${COMPOSER_HOME}/vendor/bin/phpstan /usr/local/bin/phpstan \ + && ln -s ${COMPOSER_HOME}/vendor/bin/unused_scanner /usr/local/bin/unused-scanner \ + # Install Symfony components + && COMPOSER_HOME=${COMPOSER_HOME_SYMFONY_6_1} composer global require symfony/serializer:6.1.* \ + && COMPOSER_HOME=${COMPOSER_HOME_SYMFONY_6_2} composer global require symfony/serializer:6.2.* \ + && COMPOSER_HOME=${COMPOSER_HOME_SYMFONY_6_3} composer global require symfony/serializer:6.3.* \ + && COMPOSER_HOME=${COMPOSER_HOME_SYMFONY_6_4} composer global require symfony/serializer:6.4.* \ + && update-alternatives --set php /usr/bin/php8.2 \ + && COMPOSER_HOME=${COMPOSER_HOME_SYMFONY_7_0} composer global require symfony/serializer:7.0.* \ + && COMPOSER_HOME=${COMPOSER_HOME_SYMFONY_7_1} composer global require symfony/serializer:7.1.* \ + && COMPOSER_HOME=${COMPOSER_HOME_SYMFONY_7_2} composer global require symfony/serializer:7.2.* \ + # Purge + && apt-get purge -y software-properties-common \ + && apt-get autoremove -y \ + && apt-get clean \ + && apt-get autoclean \ + && rm -rf /tmp/* + +WORKDIR /app diff --git a/docker/ci/composer.json b/docker/ci/composer.json index 4491cec..47b662f 100644 --- a/docker/ci/composer.json +++ b/docker/ci/composer.json @@ -1,13 +1,23 @@ { "require": { - "steevanb/php-parallel-processes": "0.13.0", - "phpstan/phpstan": "1.11.0", - "phpstan/phpstan-deprecation-rules": "1.2.0", - "phpstan/phpstan-strict-rules": "1.6.0", - "phpstan/phpstan-phpunit": "1.4.0", + "insolita/unused-scanner": "2.4.0", "maglnet/composer-require-checker": "4.7.1", - "wapmorgan/php-deprecation-detector": "2.0.*", - "steevanb/php-code-sniffs": "4.5.1", - "insolita/unused-scanner": "2.4.0" + "phpstan/phpstan": "2.1.16", + "phpstan/phpstan-deprecation-rules": "2.0.3", + "phpstan/phpstan-phpunit": "2.0.6", + "phpstan/phpstan-strict-rules": "2.0.4", + "steevanb/php-code-sniffs": "5.0.0", + "steevanb/php-parallel-processes": "0.13.0", + "wapmorgan/php-deprecation-detector": "2.0.33" + }, + "config": { + "allow-plugins": { + "ergebnis/composer-normalize": true + }, + "optimize-autoloader": true, + "preferred-install": { + "*": "dist" + }, + "sort-packages": true } } diff --git a/docker/release/Dockerfile b/docker/release/Dockerfile index 405f71d..8994802 100644 --- a/docker/release/Dockerfile +++ b/docker/release/Dockerfile @@ -1,6 +1,6 @@ -FROM php:8.1.13-cli-alpine3.17 +FROM php:8.1.32-cli-alpine3.21 -COPY --from=composer:2.4.4 /usr/bin/composer /usr/local/bin/composer +COPY --from=composer:2.8.9 /usr/bin/composer /usr/local/bin/composer ENV COMPOSER_HOME=/composer/common ENV COMPOSER_HOME_SYMFONY_6_1=/composer/symfony-6-1 @@ -12,16 +12,13 @@ RUN \ jq \ git \ linux-headers \ - # Install xdebug && apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \ && pecl install xdebug \ && docker-php-ext-enable xdebug \ && apk del .build-deps \ - # Install symfony component for coverage && COMPOSER_HOME=${COMPOSER_HOME_SYMFONY_6_1} composer global require symfony/serializer:6.1.* \ - # Purge && rm -rf /tmp/* diff --git a/src/Maker/AbstractCollectionMaker.php b/src/Maker/AbstractCollectionMaker.php index ba45a92..d9ffdca 100644 --- a/src/Maker/AbstractCollectionMaker.php +++ b/src/Maker/AbstractCollectionMaker.php @@ -60,7 +60,7 @@ protected function createDirectory(string $directory): static return $this; } - /** @param array $parameters */ + /** @param array $parameters */ protected function render(string $templatePathname, array $parameters): string { $content = file_get_contents($templatePathname); @@ -73,7 +73,7 @@ protected function render(string $templatePathname, array $parameters): string return $this->removeMultipleEmptyLines($content); } - /** @param array $templateParameters */ + /** @param array $templateParameters */ protected function writeCollection( string $collectionPath, string $collectionClassName, diff --git a/src/ObjectCollection/DatePeriodCollection.php b/src/ObjectCollection/DatePeriodCollection.php index 9e05fc8..5c8b9c0 100644 --- a/src/ObjectCollection/DatePeriodCollection.php +++ b/src/ObjectCollection/DatePeriodCollection.php @@ -4,7 +4,7 @@ namespace Steevanb\PhpCollection\ObjectCollection; -/** @extends AbstractObjectCollection<\DatePeriod> */ +/** @extends AbstractObjectCollection<\DatePeriod<\DateTimeInterface, \DateTimeInterface, int|null>> */ class DatePeriodCollection extends AbstractObjectCollection { public static function getValueFqcn(): string diff --git a/src/ObjectCollection/ReflectionAttributeNullableCollection.php b/src/ObjectCollection/ReflectionAttributeNullableCollection.php index 388b9fd..1393b6e 100644 --- a/src/ObjectCollection/ReflectionAttributeNullableCollection.php +++ b/src/ObjectCollection/ReflectionAttributeNullableCollection.php @@ -4,7 +4,7 @@ namespace Steevanb\PhpCollection\ObjectCollection; -/** @extends AbstractObjectNullableCollection<\ReflectionAttribute|null> */ +/** @extends AbstractObjectNullableCollection<\ReflectionAttribute|null> */ class ReflectionAttributeNullableCollection extends AbstractObjectNullableCollection { public static function getValueFqcn(): string diff --git a/src/ObjectCollection/ReflectionClassNullableCollection.php b/src/ObjectCollection/ReflectionClassNullableCollection.php index 798fb52..2f5e3bc 100644 --- a/src/ObjectCollection/ReflectionClassNullableCollection.php +++ b/src/ObjectCollection/ReflectionClassNullableCollection.php @@ -4,7 +4,7 @@ namespace Steevanb\PhpCollection\ObjectCollection; -/** @extends AbstractObjectNullableCollection<\ReflectionClass|null> */ +/** @extends AbstractObjectNullableCollection<\ReflectionClass|null> */ class ReflectionClassNullableCollection extends AbstractObjectNullableCollection { public static function getValueFqcn(): string diff --git a/src/ObjectCollection/ReflectionEnumCollection.php b/src/ObjectCollection/ReflectionEnumCollection.php index 1f2ae12..575e589 100644 --- a/src/ObjectCollection/ReflectionEnumCollection.php +++ b/src/ObjectCollection/ReflectionEnumCollection.php @@ -4,7 +4,7 @@ namespace Steevanb\PhpCollection\ObjectCollection; -/** @extends AbstractObjectCollection<\ReflectionEnum> */ +/** @extends AbstractObjectCollection<\ReflectionEnum<\UnitEnum>> */ class ReflectionEnumCollection extends AbstractObjectCollection { public static function getValueFqcn(): string