diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cef5eb0..759101d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,7 @@ jobs: --network host --no-cache . tests: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 defaults: run: working-directory: console @@ -138,7 +138,7 @@ jobs: cs-stan: name: Coding Standards & Static Analysis - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 defaults: run: working-directory: console @@ -162,8 +162,5 @@ jobs: - name: Run psalm run: composer psalm -- --output-format=github - - name: Run phpstan (src) - run: composer phpstan-src -- --error-format=github - - - name: Run phpstan (tests) - run: composer phpstan-tests -- --error-format=github + - name: Run phpstan + run: composer phpstan -- --error-format=github diff --git a/Dockerfile b/Dockerfile index 5a02571..8aaf8a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # This image provides the ability to build docs for CakePHP plugins # Plugins should use a multi-stage Dockerfile so that they only deploy # nginx without python and other build tooling. -FROM python:3.8-alpine +FROM python:3.11-alpine LABEL Description="Create an image to deploy the CakePHP plugin docs" diff --git a/console/composer.json b/console/composer.json index 900b08b..d3ed3bf 100644 --- a/console/composer.json +++ b/console/composer.json @@ -42,18 +42,14 @@ "cs-fix": "phpcbf --parallel=16 -p ./src ./tests", "test": "phpunit", "test-coverage": "phpunit --coverage-clover=coverage.xml", - "stan-setup": "cp composer.json composer.backup && composer require --dev \"phpstan/phpstan:^1.0\" \"psalm/phar:^4.0\" && mv composer.backup composer.json", + "stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^1.10 psalm/phar:^5.13 && mv composer.backup composer.json", "stan": [ - "@phpstan-src", - "@phpstan-tests", + "@phpstan", "@psalm" ], - "phpstan": [ - "@phpstan-src", - "@phpstan-tests" - ], - "phpstan-src": "php ./vendor/phpstan/phpstan/phpstan.phar analyse -l 8 -c ./phpstan.src.neon ./src", - "phpstan-tests": "php ./vendor/phpstan/phpstan/phpstan.phar analyse -l 8 -c ./phpstan.tests.neon ./tests", + "phpstan": "php ./vendor/phpstan/phpstan/phpstan.phar analyse", + "stan-baseline": "php ./vendor/phpstan/phpstan/phpstan.phar --generate-baseline", + "psalm-baseline": "php ./vendor/psalm/phar/psalm.phar --set-baseline=psalm-baseline.xml", "psalm": "php ./vendor/psalm/phar/psalm.phar" } } diff --git a/console/phpstan.neon b/console/phpstan.neon new file mode 100644 index 0000000..d6303f2 --- /dev/null +++ b/console/phpstan.neon @@ -0,0 +1,10 @@ +parameters: + level: 6 + checkMissingIterableValueType: false + checkGenericClassInNonGenericObjectType: false + treatPhpDocTypesAsCertain: false + bootstrapFiles: + - tests/bootstrap.php + paths: + - src/ + - tests/ \ No newline at end of file diff --git a/console/phpstan.src.neon b/console/phpstan.src.neon deleted file mode 100644 index 6b2e8dc..0000000 --- a/console/phpstan.src.neon +++ /dev/null @@ -1,3 +0,0 @@ -parameters: - bootstrapFiles: - - tests/phpstan.php diff --git a/console/phpstan.tests.neon b/console/phpstan.tests.neon deleted file mode 100644 index 90c6ae9..0000000 --- a/console/phpstan.tests.neon +++ /dev/null @@ -1,4 +0,0 @@ -parameters: - bootstrapFiles: - - tests/phpstan.php - - tests/bootstrap.php diff --git a/console/psalm-baseline.xml b/console/psalm-baseline.xml index 89f1026..71ea704 100644 --- a/console/psalm-baseline.xml +++ b/console/psalm-baseline.xml @@ -1,9 +1,16 @@ - + - - !$node->attributes - !$node->attributes - + + $anchor + + + attributes->getNamedItem('id')->nodeValue]]> + + + + + end($aliases) + diff --git a/console/psalm.xml.dist b/console/psalm.xml.dist index 59b7f1a..aa3b339 100644 --- a/console/psalm.xml.dist +++ b/console/psalm.xml.dist @@ -5,6 +5,9 @@ xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" errorBaseline="psalm-baseline.xml" + findUnusedPsalmSuppress="true" + findUnusedBaselineEntry="true" + findUnusedCode="false" > diff --git a/console/src/Command/PopulateIndexCommand.php b/console/src/Command/PopulateIndexCommand.php index 370e762..2d7ba07 100644 --- a/console/src/Command/PopulateIndexCommand.php +++ b/console/src/Command/PopulateIndexCommand.php @@ -199,9 +199,9 @@ protected function createBuildIndex(ConsoleIo $io, Manager $indexManager, string ]; $properties = [ 'type' => ['type' => 'keyword', 'index' => false], - 'priority' => ['type' => 'keyword', 'fielddata' => true], + 'priority' => ['type' => 'keyword'], 'url' => ['type' => 'keyword', 'index' => false], - 'page_url' => ['type' => 'keyword', 'fielddata' => true], + 'page_url' => ['type' => 'keyword'], 'level' => ['type' => 'short'], 'max_level' => ['type' => 'short'], 'position' => ['type' => 'short'], diff --git a/console/tests/phpstan.php b/console/tests/phpstan.php deleted file mode 100644 index 1c08c8f..0000000 --- a/console/tests/phpstan.php +++ /dev/null @@ -1,14 +0,0 @@ -=0.1.55,<1.0 diff --git a/runtime.Dockerfile b/runtime.Dockerfile index 8c091f5..27f507a 100644 --- a/runtime.Dockerfile +++ b/runtime.Dockerfile @@ -1,5 +1,5 @@ # Build a small nginx container with just the static site in it. -FROM nginx:1.15-alpine +FROM nginx:1.25-alpine # We also need PHP to update elastic search. RUN apk add --update bash curl composer \