Skip to content

Commit 31bc360

Browse files
committed
chore: add script to prepare PHPStan baseline
1 parent 6f5c1d7 commit 31bc360

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

utils/prepare-baseline.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
/**
4+
* This file is part of CodeIgniter 4 framework.
5+
*
6+
* (c) CodeIgniter Foundation <[email protected]>
7+
*
8+
* For the full copyright and license information, please view
9+
* the LICENSE file that was distributed with this source code.
10+
*/
11+
12+
$baselineDir = __DIR__ . '/phpstan-baseline';
13+
14+
$files = glob($baselineDir . '/*.neon');
15+
if ($files === false) {
16+
exit(1);
17+
}
18+
19+
foreach ($files as $file) {
20+
if (is_file($file)) {
21+
unlink($file);
22+
}
23+
}
24+
25+
$loaderFile = $baselineDir . '/loader.neon';
26+
if (! touch($loaderFile)) {
27+
echo "Error: Failed to create loader.neon.\n";
28+
29+
exit(1);
30+
}

0 commit comments

Comments
 (0)