Skip to content

Commit

Permalink
PHPQA fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rochamarcelo committed Oct 11, 2024
1 parent 09e8f53 commit c8ad90a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ rules:
parameters:
level: max
checkGenericClassInNonGenericObjectType: false
treatPhpDocTypesAsCertain: false
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ public function testRule(): void
66,
],
[
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::belongsTo with option "bindingKey" (array<string>|string) does not accept int.',
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::belongsTo with option "bindingKey" (list<string>|string) does not accept 10.',
66,
'Type #1 from the union: 10 is not a list.',
],
[
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::belongsTo with option "foreignKey" (array<string>|string|false) does not accept 11.',
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::belongsTo with option "foreignKey" (list<string>|string|false) does not accept 11.',
66,
'Type #1 from the union: 11 is not a list.',
],
[
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::belongsTo with option "joinType" (string) does not accept int.',
Expand Down Expand Up @@ -107,8 +109,9 @@ public function testRule(): void
85,
],
[
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::belongsToMany with option "targetForeignKey" (array<string>|string|null) does not accept Closure.',
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::belongsToMany with option "targetForeignKey" (list<string>|string|null) does not accept Closure(): 10.',
98,
'Type #1 from the union: Closure(): 10 is not a list.',
],
[
$messageThrough,
Expand Down Expand Up @@ -147,12 +150,14 @@ public function testRule(): void
120,
],
[
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::hasOne with option "bindingKey" (array<string>|string) does not accept int.',
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::hasOne with option "bindingKey" (list<string>|string) does not accept 10.',
120,
'Type #1 from the union: 10 is not a list.',
],
[
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::hasOne with option "foreignKey" (array<string>|string|false) does not accept 11.',
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::hasOne with option "foreignKey" (list<string>|string|false) does not accept 11.',
120,
'Type #1 from the union: 11 is not a list.',
],
[
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::hasOne with option "joinType" (string) does not accept int.',
Expand Down Expand Up @@ -215,12 +220,14 @@ public function testRule(): void
148,
],
[
'Call to Cake\ORM\AssociationCollection::load with option "bindingKey" (array<string>|string) does not accept int.',
'Call to Cake\ORM\AssociationCollection::load with option "bindingKey" (list<string>|string) does not accept 10.',
148,
'Type #1 from the union: 10 is not a list.',
],
[
'Call to Cake\ORM\AssociationCollection::load with option "foreignKey" (array<string>|string|false) does not accept 11.',
'Call to Cake\ORM\AssociationCollection::load with option "foreignKey" (list<string>|string|false) does not accept 11.',
148,
'Type #1 from the union: 11 is not a list.',
],
[
'Call to Cake\ORM\AssociationCollection::load with option "joinType" (string) does not accept int.',
Expand Down
5 changes: 4 additions & 1 deletion tests/test_app/Model/Table/UsersTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ public function logLastLogin(User $user): User
return $this->saveOrFail($user);
}

public function blockOld()
/**
* @return void
*/
public function blockOld(): void
{
}
}

0 comments on commit c8ad90a

Please sign in to comment.