Skip to content

Commit c8ad90a

Browse files
committed
PHPQA fixes
1 parent 09e8f53 commit c8ad90a

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ rules:
66
parameters:
77
level: max
88
checkGenericClassInNonGenericObjectType: false
9+
treatPhpDocTypesAsCertain: false

tests/TestCase/Rule/Model/AddAssociationMatchOptionsTypesRuleTest.php

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,14 @@ public function testRule(): void
6767
66,
6868
],
6969
[
70-
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::belongsTo with option "bindingKey" (array<string>|string) does not accept int.',
70+
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::belongsTo with option "bindingKey" (list<string>|string) does not accept 10.',
7171
66,
72+
'Type #1 from the union: 10 is not a list.',
7273
],
7374
[
74-
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::belongsTo with option "foreignKey" (array<string>|string|false) does not accept 11.',
75+
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::belongsTo with option "foreignKey" (list<string>|string|false) does not accept 11.',
7576
66,
77+
'Type #1 from the union: 11 is not a list.',
7678
],
7779
[
7880
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::belongsTo with option "joinType" (string) does not accept int.',
@@ -107,8 +109,9 @@ public function testRule(): void
107109
85,
108110
],
109111
[
110-
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::belongsToMany with option "targetForeignKey" (array<string>|string|null) does not accept Closure.',
112+
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::belongsToMany with option "targetForeignKey" (list<string>|string|null) does not accept Closure(): 10.',
111113
98,
114+
'Type #1 from the union: Closure(): 10 is not a list.',
112115
],
113116
[
114117
$messageThrough,
@@ -147,12 +150,14 @@ public function testRule(): void
147150
120,
148151
],
149152
[
150-
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::hasOne with option "bindingKey" (array<string>|string) does not accept int.',
153+
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::hasOne with option "bindingKey" (list<string>|string) does not accept 10.',
151154
120,
155+
'Type #1 from the union: 10 is not a list.',
152156
],
153157
[
154-
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::hasOne with option "foreignKey" (array<string>|string|false) does not accept 11.',
158+
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::hasOne with option "foreignKey" (list<string>|string|false) does not accept 11.',
155159
120,
160+
'Type #1 from the union: 11 is not a list.',
156161
],
157162
[
158163
'Call to CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake\FailingRuleItemsTable::hasOne with option "joinType" (string) does not accept int.',
@@ -215,12 +220,14 @@ public function testRule(): void
215220
148,
216221
],
217222
[
218-
'Call to Cake\ORM\AssociationCollection::load with option "bindingKey" (array<string>|string) does not accept int.',
223+
'Call to Cake\ORM\AssociationCollection::load with option "bindingKey" (list<string>|string) does not accept 10.',
219224
148,
225+
'Type #1 from the union: 10 is not a list.',
220226
],
221227
[
222-
'Call to Cake\ORM\AssociationCollection::load with option "foreignKey" (array<string>|string|false) does not accept 11.',
228+
'Call to Cake\ORM\AssociationCollection::load with option "foreignKey" (list<string>|string|false) does not accept 11.',
223229
148,
230+
'Type #1 from the union: 11 is not a list.',
224231
],
225232
[
226233
'Call to Cake\ORM\AssociationCollection::load with option "joinType" (string) does not accept int.',

tests/test_app/Model/Table/UsersTable.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ public function logLastLogin(User $user): User
4040
return $this->saveOrFail($user);
4141
}
4242

43-
public function blockOld()
43+
/**
44+
* @return void
45+
*/
46+
public function blockOld(): void
4447
{
4548
}
4649
}

0 commit comments

Comments
 (0)