diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 1f104e39..c650ce8d 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -7,28 +7,28 @@ on: jobs: phpstan_src: name: PHPStan Source - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.2 tools: composer:v2 coverage: none - name: Install Dependencies - uses: nick-invision/retry@v1 + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 5 command: composer update --no-interaction --no-progress - name: Install PHPStan - uses: nick-invision/retry@v1 + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 5 @@ -39,28 +39,28 @@ jobs: phpstan_tests: name: PHPStan Tests - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.2 tools: composer:v2 coverage: none - name: Install Dependencies - uses: nick-invision/retry@v1 + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 5 command: composer update --no-interaction --no-progress - name: Install PHPStan - uses: nick-invision/retry@v1 + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 5 @@ -71,28 +71,28 @@ jobs: psalm: name: Psalm - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.2 tools: composer:v2 coverage: none - name: Install Dependencies - uses: nick-invision/retry@v1 + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 5 command: composer update --no-interaction --no-progress - name: Install Psalm - uses: nick-invision/retry@v1 + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 5 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 12ac9787..9444b20e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,15 +7,15 @@ on: jobs: tests: name: PHP ${{ matrix.php }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: - php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] steps: - name: Checkout Code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -28,7 +28,7 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Install Dependencies - uses: nick-invision/retry@v1 + uses: nick-invision/retry@v2 with: timeout_minutes: 5 max_attempts: 5 diff --git a/Makefile b/Makefile index 37fffd63..c5b83976 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,21 @@ install: - @docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:7.4-base update - @docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:7.4-base bin all update + @docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:8.2-base update + @docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:8.2-base bin all update phpunit: - @rm -f bootstrap/cache/*.php && docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit --rm registry.gitlab.com/grahamcampbell/php:7.4-cli + @rm -f bootstrap/cache/*.php && docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit --rm registry.gitlab.com/grahamcampbell/php:8.2-cli phpstan-analyze-src: - @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:7.4-cli analyze src -c phpstan.src.neon.dist + @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:8.2-cli analyze src -c phpstan.src.neon.dist phpstan-analyze-tests: - @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:7.4-cli analyze tests -c phpstan.tests.neon.dist + @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:8.2-cli analyze tests -c phpstan.tests.neon.dist psalm-analyze: - @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:7.4-cli + @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:8.2-cli psalm-show-info: - @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:7.4-cli --show-info=true + @docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:8.2-cli --show-info=true test: phpunit phpstan-analyze-src phpstan-analyze-tests psalm-analyze diff --git a/composer.json b/composer.json index d15edc72..10bc27a1 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "ext-filter": "*", "ext-pcre": "*", "bamarni/composer-bin-plugin": "^1.4.1", - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.21" + "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.30" }, "autoload": { "psr-4": { diff --git a/phpstan.src.neon.dist b/phpstan.src.neon.dist index b24cd57e..8a3e0da8 100644 --- a/phpstan.src.neon.dist +++ b/phpstan.src.neon.dist @@ -3,7 +3,6 @@ parameters: ignoreErrors: - '#Call to function is_string\(\) with string will always evaluate to true.#' - '#Variable \$defaults might not be defined.#' - - '#Method Dotenv\\Regex\\Regex::split\(\) should return Dotenv\\Result\\Result\, string\> but returns Dotenv\\Result\\Result\, string\>.#' - '/^Parameter \#1 \$readers of class Dotenv\\Repository\\[a-zA-Z]*Repository[a-zA-Z]* constructor expects/' - '/^Parameter \#2 \$writers of class Dotenv\\Repository\\[a-zA-Z]*Repository[a-zA-Z]* constructor expects/' - '#Parameter \#1 \$name of method Dotenv\\Repository\\AbstractRepository::set\(\) expects string, string\|null given.#' diff --git a/src/Regex/Regex.php b/src/Regex/Regex.php index 2b322ab0..5cf0e28d 100644 --- a/src/Regex/Regex.php +++ b/src/Regex/Regex.php @@ -88,9 +88,11 @@ private static function pregAndWrap(callable $operation, $subject) $result = $operation($subject); if (($e = preg_last_error()) !== PREG_NO_ERROR) { + /** @var Result */ return Error::create(self::lookupError($e)); } + /** @var Result */ return Success::create($result); } diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json index b358769c..047d9c80 100644 --- a/vendor-bin/phpstan/composer.json +++ b/vendor-bin/phpstan/composer.json @@ -1,9 +1,10 @@ { "require": { - "phpstan/phpstan": "1.2.0", + "php": "^8.2", + "phpstan/phpstan": "1.8.9", "phpstan/extension-installer": "1.1.0", "phpstan/phpstan-deprecation-rules": "1.0.0", - "phpstan/phpstan-strict-rules": "1.1.0", + "phpstan/phpstan-strict-rules": "1.4.4", "thecodingmachine/phpstan-strict-rules": "1.0.0" }, "config": { diff --git a/vendor-bin/psalm/composer.json b/vendor-bin/psalm/composer.json index 47ba3dea..24ea34a9 100644 --- a/vendor-bin/psalm/composer.json +++ b/vendor-bin/psalm/composer.json @@ -1,6 +1,7 @@ { "require": { - "psalm/phar": "4.19.0" + "php": "^8.2", + "psalm/phar": "4.29.0" }, "config": { "preferred-install": "dist"