Skip to content

Commit 9f1765e

Browse files
committed
Add AdditionalConfigFilesTrait
1 parent eb265f9 commit 9f1765e

File tree

2 files changed

+32
-9
lines changed

2 files changed

+32
-9
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* This file is part of CodeIgniter 4 framework.
7+
*
8+
* (c) 2023 CodeIgniter Foundation <admin@codeigniter.com>
9+
*
10+
* For the full copyright and license information, please view
11+
* the LICENSE file that was distributed with this source code.
12+
*/
13+
14+
namespace CodeIgniter\PHPStan\Tests;
15+
16+
/**
17+
* @internal
18+
*/
19+
trait AdditionalConfigFilesTrait
20+
{
21+
public static function getAdditionalConfigFiles(): array
22+
{
23+
return [
24+
...parent::getAdditionalConfigFiles(),
25+
__DIR__ . '/../extension.neon',
26+
__DIR__ . '/extension-test.neon',
27+
];
28+
}
29+
}

tests/Rules/Functions/FactoriesFunctionArgumentTypeRuleTest.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
namespace CodeIgniter\PHPStan\Tests\Rules\Functions;
1515

1616
use CodeIgniter\PHPStan\Rules\Functions\FactoriesFunctionArgumentTypeRule;
17+
use CodeIgniter\PHPStan\Tests\AdditionalConfigFilesTrait;
1718
use CodeIgniter\PHPStan\Type\FactoriesReturnTypeHelper;
1819
use PHPStan\Rules\Rule;
1920
use PHPStan\Testing\RuleTestCase;
@@ -27,6 +28,8 @@
2728
#[Group('Integration')]
2829
final class FactoriesFunctionArgumentTypeRuleTest extends RuleTestCase
2930
{
31+
use AdditionalConfigFilesTrait;
32+
3033
protected function getRule(): Rule
3134
{
3235
return new FactoriesFunctionArgumentTypeRule(
@@ -79,13 +82,4 @@ public function testRule(): void
7982
],
8083
]);
8184
}
82-
83-
public static function getAdditionalConfigFiles(): array
84-
{
85-
return [
86-
...parent::getAdditionalConfigFiles(),
87-
__DIR__ . '/../../../extension.neon',
88-
__DIR__ . '/../../extension-test.neon',
89-
];
90-
}
9185
}

0 commit comments

Comments
 (0)