Skip to content

Commit

Permalink
Psalm 4.22 and PHPStan 1.4.8 (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Mar 7, 2022
1 parent fd4ac72 commit c1ec982
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 44 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Expand Up @@ -5,3 +5,5 @@
.scrutinizer.yml export-ignore
phpunit.xml.dist export-ignore
/phpcs.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/psalm.xml.dist export-ignore
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -23,8 +23,8 @@
"require-dev": {
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.1.5",
"doctrine/coding-standard": "^9.0",
"phpstan/phpstan": "^1",
"vimeo/psalm": "^4.2.1"
"phpstan/phpstan": "^1.4.8",
"vimeo/psalm": "^4.22"
},
"autoload": {
"psr-4": { "Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections" }
Expand Down
9 changes: 5 additions & 4 deletions lib/Doctrine/Common/Collections/AbstractLazyCollection.php
Expand Up @@ -292,7 +292,7 @@ public function getIterator()
}

/**
* {@inheritDoc}
* @param TKey $offset
*
* @return bool
*/
Expand All @@ -305,7 +305,7 @@ public function offsetExists($offset)
}

/**
* {@inheritDoc}
* @param TKey $offset
*
* @return mixed
*/
Expand All @@ -318,7 +318,8 @@ public function offsetGet($offset)
}

/**
* {@inheritDoc}
* @param TKey|null $offset
* @param T $value
*
* @return void
*/
Expand All @@ -330,7 +331,7 @@ public function offsetSet($offset, $value)
}

/**
* {@inheritDoc}
* @param TKey $offset
*
* @return void
*/
Expand Down
9 changes: 5 additions & 4 deletions lib/Doctrine/Common/Collections/ArrayCollection.php
Expand Up @@ -165,7 +165,7 @@ public function removeElement($element)
/**
* Required by interface ArrayAccess.
*
* {@inheritDoc}
* @param TKey $offset
*
* @return bool
*/
Expand All @@ -178,7 +178,7 @@ public function offsetExists($offset)
/**
* Required by interface ArrayAccess.
*
* {@inheritDoc}
* @param TKey $offset
*
* @return mixed
*/
Expand All @@ -191,7 +191,8 @@ public function offsetGet($offset)
/**
* Required by interface ArrayAccess.
*
* {@inheritDoc}
* @param TKey|null $offset
* @param T $value
*
* @return void
*/
Expand All @@ -210,7 +211,7 @@ public function offsetSet($offset, $value)
/**
* Required by interface ArrayAccess.
*
* {@inheritDoc}
* @param TKey $offset
*
* @return void
*/
Expand Down
44 changes: 10 additions & 34 deletions psalm.xml.dist
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<psalm
totallyTyped="false"
errorLevel="1"
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"
Expand All @@ -14,41 +14,17 @@
</projectFiles>

<issueHandlers>
<LessSpecificReturnType errorLevel="info" />
<MixedArgument errorLevel="info" />
<MixedArgumentTypeCoercion errorLevel="info" />
<MixedAssignment errorLevel="info" />

<!-- level 3 issues - slightly lazy code writing, but provably low false-negatives -->

<DeprecatedMethod errorLevel="info" />
<DeprecatedProperty errorLevel="info" />
<DeprecatedClass errorLevel="info" />
<DeprecatedConstant errorLevel="info" />
<DeprecatedInterface errorLevel="info" />
<DeprecatedTrait errorLevel="info" />

<InternalMethod errorLevel="info" />
<InternalProperty errorLevel="info" />
<InternalClass errorLevel="info" />

<MissingClosureReturnType errorLevel="info" />
<MissingReturnType errorLevel="info" />
<MissingPropertyType errorLevel="info" />
<InvalidDocblock errorLevel="info" />

<PropertyNotSetInConstructor errorLevel="info" />
<MissingConstructor errorLevel="info" />
<MissingClosureParamType errorLevel="info" />
<MissingParamType errorLevel="info" />

<RedundantCondition errorLevel="info" />

<DocblockTypeContradiction errorLevel="info" />
<RedundantConditionGivenDocblockType errorLevel="info" />

<UnresolvableInclude errorLevel="info" />

<RawObjectIteration errorLevel="info" />
<PossiblyNullArgument>
<errorLevel type="suppress">
<!-- Remove when https://github.com/vimeo/psalm/pull/7759 is released -->
<referencedFunction name="Doctrine\Common\Collections\Collection::offsetSet" />
</errorLevel>
</PossiblyNullArgument>

<InvalidStringClass errorLevel="info" />
<UnsafeGenericInstantiation>
<errorLevel type="suppress">
<file name="lib/Doctrine/Common/Collections/ArrayCollection.php"/>
Expand Down

0 comments on commit c1ec982

Please sign in to comment.