diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 00000000..37d3ae3d --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,47 @@ +name: "Documentation" + +on: + pull_request: + branches: + - "*.x" + paths: + - .github/workflows/documentation.yml + - docs/** + push: + branches: + - "*.x" + paths: + - .github/workflows/documentation.yml + - docs/** + +jobs: + validate-with-guides: + name: "Validate documentation with phpDocumentor/guides" + runs-on: "ubuntu-22.04" + + steps: + - name: "Checkout code" + uses: "actions/checkout@v3" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "8.2" + + - name: "Remove existing composer file" + run: "rm composer.json" + + - name: "Require phpdocumentor/guides-cli" + run: "composer require --dev phpdocumentor/guides-cli dev-main@dev --no-update" + + - name: "Configure minimum stability" + run: "composer config minimum-stability dev" + + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v2" + with: + dependency-versions: "highest" + + - name: "Run guides-cli" + run: "vendor/bin/guides -vvv --no-progress --fail-on-log docs/en /tmp/test" diff --git a/composer.json b/composer.json index 99ec24b0..36ad7f1a 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "phpstan/phpstan": "^1.8", "phpstan/phpstan-phpunit": "^1.0", "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^4.22" + "vimeo/psalm": "^5.11" }, "autoload": { "psr-4": { diff --git a/psalm.xml.dist b/psalm.xml.dist index 27ddd2f6..bf24a173 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -4,6 +4,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" + findUnusedBaselineEntry="true" + findUnusedCode="false" > @@ -18,6 +20,18 @@ + + + + + + + + + + + + diff --git a/src/AbstractLazyCollection.php b/src/AbstractLazyCollection.php index 5fdc4adc..4ff3a466 100644 --- a/src/AbstractLazyCollection.php +++ b/src/AbstractLazyCollection.php @@ -49,8 +49,6 @@ public function clear(): void /** * {@inheritDoc} - * - * @template TMaybeContained */ public function contains(mixed $element): bool { diff --git a/src/ArrayCollection.php b/src/ArrayCollection.php index e9fd2b47..836215d5 100644 --- a/src/ArrayCollection.php +++ b/src/ArrayCollection.php @@ -197,8 +197,6 @@ public function containsKey(string|int $key): bool /** * {@inheritDoc} - * - * @template TMaybeContained */ public function contains(mixed $element): bool {