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 8124746
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 select of method Cycle\\\\ActiveRecord\\\\Repository\\\\ActiveRepository\\:\\:with\\(\\)\\.$#"
count: 1
path: src/Repository/ActiveRepository.php

-
message: "#^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\\.$#"
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
{
Expand Down

0 comments on commit 8124746

Please sign in to comment.