Skip to content

Commit

Permalink
Merge branch '2.1.x' into 3.0.x
Browse files Browse the repository at this point in the history
* 2.1.x:
  Added the documentation.yml to the workflows
  Applying latest coding standards
  Remove override of template type: causing psalm errors
  Upgrade to Psalm 5 (#370)
  • Loading branch information
derrabus committed Jul 24, 2023
2 parents 0a62b39 + 3023e15 commit a0ff1e5
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 11 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
14 changes: 14 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
<projectFiles>
<directory name="src" />
Expand All @@ -18,6 +20,18 @@
<MixedArgumentTypeCoercion errorLevel="info" />
<MixedAssignment errorLevel="info" />

<MixedInferredReturnType>
<errorLevel type="suppress">
<file name="src/AbstractLazyCollection.php"/>
</errorLevel>
</MixedInferredReturnType>

<MixedReturnStatement>
<errorLevel type="suppress">
<file name="src/AbstractLazyCollection.php"/>
</errorLevel>
</MixedReturnStatement>

<PossiblyNullArgument>
<errorLevel type="suppress">
<!-- Remove when https://github.com/vimeo/psalm/pull/7759 is released -->
Expand Down
5 changes: 0 additions & 5 deletions src/AbstractLazyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ public function clear(): void
$this->collection->clear();
}

/**
* {@inheritDoc}
*
* @template TMaybeContained
*/
public function contains(mixed $element): bool
{
$this->initialize();
Expand Down
5 changes: 0 additions & 5 deletions src/ArrayCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,6 @@ public function containsKey(string|int $key): bool
return isset($this->elements[$key]) || array_key_exists($key, $this->elements);
}

/**
* {@inheritDoc}
*
* @template TMaybeContained
*/
public function contains(mixed $element): bool
{
return in_array($element, $this->elements, true);
Expand Down

0 comments on commit a0ff1e5

Please sign in to comment.