Skip to content

Commit 6a40157

Browse files
committed
Add Psalm
1 parent f92ec92 commit 6a40157

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ Development toolkit for CodeIgniter libraries and projects
1616

1717
* [NexusPHP Tachycardia](https://github.com/NexusPHP/tachycardia)
1818
* [PHPStan](https://phpstan.org/user-guide/getting-started)
19-
* [PHPUnit](http://phpunit.readthedocs.io)
19+
* [PHPUnit](https://phpunit.readthedocs.io)
20+
* [Psalm](https://psalm.dev)
2021

2122
### Mocking
2223

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"phpstan/phpstan-deprecation-rules": "^1.0",
3333
"phpstan/phpstan-phpunit": "^1.0",
3434
"phpunit/phpunit": "^9.3",
35-
"roave/security-advisories": "dev-latest"
35+
"roave/security-advisories": "dev-latest",
36+
"vimeo/psalm": "^4.22"
3637
},
3738
"minimum-stability": "dev",
3839
"prefer-stable": true,

src/Template/psalm.xml

Whitespace-only changes.

src/Template/psalm_autoload.php

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

0 commit comments

Comments
 (0)