Skip to content

Commit

Permalink
Document missing possible types
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed Jun 4, 2022
1 parent 67d82cd commit d9c6f86
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
10 changes: 5 additions & 5 deletions lib/Doctrine/ORM/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ public function addCustomStringFunction($name, $className)
*
* @param string $name
*
* @return string|null
* @return string|callable|null
* @psalm-return class-string|callable|null
*/
public function getCustomStringFunction($name)
Expand Down Expand Up @@ -658,8 +658,8 @@ public function addCustomNumericFunction($name, $className)
*
* @param string $name
*
* @return string|null
* @psalm-return ?class-string
* @return string|callable|null
* @psalm-return class-string|callable|null
*/
public function getCustomNumericFunction($name)
{
Expand Down Expand Up @@ -711,8 +711,8 @@ public function addCustomDatetimeFunction($name, $className)
*
* @param string $name
*
* @return string|null
* @psalm-return ?class-string $name
* @return string|callable|null
* @psalm-return class-string|callable|null $name
*/
public function getCustomDatetimeFunction($name)
{
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,6 @@ parameters:
count: 1
path: lib/Doctrine/ORM/Query/Expr/Select.php

-
message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#"
count: 2
path: lib/Doctrine/ORM/Query/Parser.php

-
message: "#^Method Doctrine\\\\ORM\\\\Query\\\\Parser\\:\\:ArithmeticFactor\\(\\) should return Doctrine\\\\ORM\\\\Query\\\\AST\\\\ArithmeticFactor but returns Doctrine\\\\ORM\\\\Query\\\\AST\\\\Node\\|string\\.$#"
count: 1
Expand Down
18 changes: 7 additions & 11 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -517,16 +517,16 @@
<InvalidArrayOffset occurrences="1">
<code>$subClass-&gt;table[$indexType][$indexName]</code>
</InvalidArrayOffset>
<InvalidPropertyAssignmentValue occurrences="1">
<code>$subClass-&gt;table</code>
</InvalidPropertyAssignmentValue>
<MissingConstructor occurrences="2">
<code>$driver</code>
<code>$evm</code>
</MissingConstructor>
<PossiblyInvalidArrayAssignment occurrences="1">
<code>$subClass-&gt;table[$indexType][$indexName]</code>
</PossiblyInvalidArrayAssignment>
<InvalidPropertyAssignmentValue occurrences="1">
<code>$subClass-&gt;table</code>
</InvalidPropertyAssignmentValue>
<PossiblyInvalidIterator occurrences="1">
<code>$parentClass-&gt;table[$indexType]</code>
</PossiblyInvalidIterator>
Expand Down Expand Up @@ -2050,10 +2050,6 @@
<ArgumentTypeCoercion occurrences="1">
<code>$stringPattern</code>
</ArgumentTypeCoercion>
<DocblockTypeContradiction occurrences="2">
<code>call_user_func($functionClass, $functionName)</code>
<code>call_user_func($functionClass, $functionName)</code>
</DocblockTypeContradiction>
<InvalidArgument occurrences="1">
<code>$lookaheadType</code>
</InvalidArgument>
Expand Down Expand Up @@ -2105,7 +2101,9 @@
<code>$this-&gt;lexer-&gt;token['value']</code>
<code>$this-&gt;lexer-&gt;token['value']</code>
</InvalidScalarArgument>
<InvalidStringClass occurrences="1">
<InvalidStringClass occurrences="3">
<code>new $functionClass($functionName)</code>
<code>new $functionClass($functionName)</code>
<code>new $functionClass($functionName)</code>
</InvalidStringClass>
<LessSpecificReturnStatement occurrences="4">
Expand Down Expand Up @@ -2241,10 +2239,8 @@
<PossiblyUndefinedVariable occurrences="1">
<code>$args</code>
</PossiblyUndefinedVariable>
<RedundantConditionGivenDocblockType occurrences="3">
<RedundantConditionGivenDocblockType occurrences="1">
<code>$AST instanceof AST\SelectStatement</code>
<code>is_string($functionClass)</code>
<code>is_string($functionClass)</code>
</RedundantConditionGivenDocblockType>
<UnsafeInstantiation occurrences="3">
<code>new $funcClass($funcNameLower)</code>
Expand Down

0 comments on commit d9c6f86

Please sign in to comment.