Skip to content

Commit 5f52522

Browse files
committed
fix: resolve phpcs issues
1 parent dc43964 commit 5f52522

5 files changed

Lines changed: 14 additions & 3 deletions

src/Type/SelectQueryFindListReturnTypeExtension.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,25 @@
4141
*/
4242
class SelectQueryFindListReturnTypeExtension implements DynamicMethodReturnTypeExtension
4343
{
44+
/**
45+
* @inheritDoc
46+
*/
4447
public function getClass(): string
4548
{
4649
return SelectQuery::class;
4750
}
4851

52+
/**
53+
* @inheritDoc
54+
*/
4955
public function isMethodSupported(MethodReflection $methodReflection): bool
5056
{
5157
return $methodReflection->getName() === 'toArray';
5258
}
5359

60+
/**
61+
* @inheritDoc
62+
*/
5463
public function getTypeFromMethodCall(
5564
MethodReflection $methodReflection,
5665
MethodCall $methodCall,

tests/TestCase/Type/Fake/FindListCorrectUsage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function testFindList(): array
2525
$list = $table->find('list')->toArray();
2626

2727
// Iterating should work with string values
28-
foreach ($list as $id => $title) {
28+
foreach ($list as $title) {
2929
echo strlen($title);
3030
}
3131

tests/TestCase/Type/Fake/FindListGroupedUsage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public function testFindListGroupedIteration(): void
5151
$grouped = $table->find('list', groupField: 'category_id')->toArray();
5252

5353
// Outer loop: groups
54-
foreach ($grouped as $groupKey => $items) {
54+
foreach ($grouped as $items) {
5555
// Inner loop: items in group
56-
foreach ($items as $itemKey => $value) {
56+
foreach ($items as $value) {
5757
// This would error if $value were not string
5858
echo strlen($value);
5959
}

tests/TestCase/Type/SelectQueryFindListReturnTypeExtensionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
class SelectQueryFindListReturnTypeExtensionTest extends TestCase
2020
{
2121
use PhpStanTestTrait;
22+
2223
/**
2324
* Test that find('list')->toArray() returns correct type.
2425
*

tests/TestCase/Type/TypeFactoryBuildDynamicReturnTypeExtensionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
class TypeFactoryBuildDynamicReturnTypeExtensionTest extends TestCase
2020
{
2121
use PhpStanTestTrait;
22+
2223
/**
2324
* Test that TypeFactory::build() returns correct types and allows valid method calls.
2425
*

0 commit comments

Comments
 (0)