Skip to content

Commit 59614de

Browse files
authored
Merge pull request #6444 from MGatner/psalm-config
2 parents a6e4d38 + 0488516 commit 59614de

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"phpstan/phpstan": "^1.7.1",
2525
"phpunit/phpunit": "^9.1",
2626
"predis/predis": "^1.1 || ^2.0",
27-
"rector/rector": "0.14.0"
27+
"rector/rector": "0.14.0",
28+
"vimeo/psalm": "^4.26"
2829
},
2930
"suggest": {
3031
"ext-imagick": "If you use Image class ImageMagickHandler",

psalm.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="1"
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="app/" />
13+
<directory name="public/" />
14+
<directory name="system/" />
15+
<directory name="tests/" />
16+
<file name="spark" />
17+
<ignoreFiles>
18+
<directory name="app/Views" />
19+
<directory name="system/Commands/Generators/Views" />
20+
<directory name="system/Validation/Views" />
21+
<directory name="tests/system/View/Views" />
22+
<directory name="tests/_support/View/Views" />
23+
<directory name="system/ThirdParty" />
24+
<directory name="vendor" />
25+
</ignoreFiles>
26+
</projectFiles>
27+
</psalm>

psalm_autoload.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
require __DIR__ . '/system/Test/bootstrap.php';
6+
7+
$helperDirs = [
8+
'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+
}

0 commit comments

Comments
 (0)