Skip to content

Commit

Permalink
test: update psalm and stan baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Jul 4, 2024
1 parent 4ed5536 commit 5111f0c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
15 changes: 15 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ parameters:
count: 1
path: src/ActiveRecord.php

-
message: "#^Template type TEntity is declared as covariant, but occurs in contravariant position in parameter role of method Cycle\\\\ActiveRecord\\\\Repository\\\\ActiveRepository\\:\\:initSelect\\(\\)\\.$#"
count: 1
path: src/Repository/ActiveRepository.php

-
message: "#^Template type TEntity is declared as covariant, but occurs in contravariant position in parameter select of method Cycle\\\\ActiveRecord\\\\Repository\\\\ActiveRepository\\:\\:with\\(\\)\\.$#"
count: 1
path: src/Repository/ActiveRepository.php

-
message: "#^Return type \\(Cycle\\\\App\\\\Query\\\\UserQuery\\) of method Cycle\\\\App\\\\Entity\\\\User\\:\\:query\\(\\) should be covariant with return type \\(Cycle\\\\ActiveRecord\\\\Query\\\\ActiveQuery\\<static\\(Cycle\\\\ActiveRecord\\\\ActiveRecord\\)\\>\\) of method Cycle\\\\ActiveRecord\\\\ActiveRecord\\:\\:query\\(\\)$#"
count: 1
path: tests/app/Entity/User.php

-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Cycle\\\\\\\\App\\\\\\\\Entity\\\\\\\\User' and Cycle\\\\App\\\\Entity\\\\User will always evaluate to true\\.$#"
count: 1
Expand Down
15 changes: 12 additions & 3 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@
</file>
<file src="src/Repository/ActiveRepository.php">
<PossiblyUnusedMethod>
<code><![CDATA[__construct]]></code>
<code><![CDATA[findAll]]></code>
<code><![CDATA[findByPK]]></code>
<code><![CDATA[findOne]]></code>
<code><![CDATA[forUpdate]]></code>
</PossiblyUnusedMethod>
</file>
<file src="tests/src/Functional/ActiveRecordTest.php">
Expand Down Expand Up @@ -79,6 +77,17 @@
<code><![CDATA[it_gets_role_from_query]]></code>
</PossiblyUnusedMethod>
</file>
<file src="tests/src/Functional/Repository/ActiveRepositoryTest.php">
<MissingTemplateParam>
<code><![CDATA[class() extends ActiveRepository {]]></code>
</MissingTemplateParam>
<PossiblyUnusedMethod>
<code><![CDATA[it_extends_repository_constructor]]></code>
<code><![CDATA[it_fetches_one_entity]]></code>
<code><![CDATA[it_fetches_one_entity_by_pk]]></code>
<code><![CDATA[it_uses_custom_repository_with_active_query]]></code>
</PossiblyUnusedMethod>
</file>
<file src="tests/src/Functional/TestLogger.php">
<ImplicitToStringCast>
<code><![CDATA[$message]]></code>
Expand Down
6 changes: 4 additions & 2 deletions src/Repository/ActiveRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,11 @@ protected function with(Select $select): static
* }
* ```
*
* @param class-string<TEntity> $role
* @template T
*
* @return Select<TEntity>
* @param class-string<T> $role
*
* @return Select<T>
*/
protected function initSelect(ORMInterface $orm, string $role): Select

Check failure on line 145 in src/Repository/ActiveRepository.php

View workflow job for this annotation

GitHub Actions / phpstan (ubuntu-latest, 8.2, locked)

Type mixed in generic type Cycle\ORM\Select<mixed> in PHPDoc tag @return is not subtype of template type TEntity of object of class Cycle\ORM\Select.
{
Expand Down

0 comments on commit 5111f0c

Please sign in to comment.