Skip to content

Commit 63ecead

Browse files
committed
chore: config Psalm
1 parent 1498cc8 commit 63ecead

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
},
3737
"scripts": {
3838
"analyze": [
39-
"bash -c \"XDEBUG_MODE=off phpstan analyse\""
39+
"bash -c \"XDEBUG_MODE=off phpstan analyse\"",
40+
"psalm"
4041
],
4142
"sa": "@analyze",
4243
"cs": "php-cs-fixer fix --ansi --verbose --dry-run --diff",

psalm.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="7"
4+
resolveFromConfigFile="true"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
autoloader="psalm_autoload.php"
9+
cacheDirectory="build/psalm/"
10+
>
11+
<projectFiles>
12+
<directory name="src/" />
13+
<directory name="tests/" />
14+
<ignoreFiles>
15+
<directory name="vendor" />
16+
</ignoreFiles>
17+
</projectFiles>
18+
</psalm>

psalm_autoload.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
require __DIR__ . '/vendor/codeigniter4/framework/system/Test/bootstrap.php';
6+
7+
$helperDirs = [
8+
'vendor/codeigniter4/framework/system/Helpers',
9+
];
10+
11+
foreach ($helperDirs as $dir) {
12+
$dir = __DIR__ . '/' . $dir;
13+
if (! is_dir($dir)) {
14+
continue;
15+
}
16+
17+
chdir($dir);
18+
19+
foreach (glob('*_helper.php') as $filename) {
20+
$filePath = realpath($dir . '/' . $filename);
21+
22+
require_once $filePath;
23+
}
24+
}
25+
26+
chdir(__DIR__);

0 commit comments

Comments
 (0)