Skip to content

Commit f25fee0

Browse files
committed
Run Psalm in CI
1 parent eda6a3d commit f25fee0

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

.github/workflows/pipeline.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
fail-fast: false
1010
matrix:
1111
operating-system: [ubuntu-latest]
12-
php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4']
12+
php-versions: ['8.0', '8.1', '8.2', '8.3']
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v4
@@ -35,6 +35,9 @@ jobs:
3535
- name: Install Composer dependencies
3636
run: composer install --no-progress --prefer-dist --optimize-autoloader
3737

38+
- name: Run static analyzer
39+
run: composer run psalm
40+
3841
- name: Run tests
3942
run: composer run test -- --no-coverage
4043

psalm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<projectFiles>
1212
<directory name="src" />
1313
<ignoreFiles>
14-
<file name="src/Automapper.php" />
14+
<file name="src/AutoMapper.php" />
1515
<directory name="vendor" />
1616
</ignoreFiles>
1717
</projectFiles>

src/AutoMapper.php

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php declare(strict_types=1);
1+
<?php declare (strict_types=1);
22

33
namespace Acelot\AutoMapper;
44

@@ -89,21 +89,41 @@ public static function callCtx(callable $callable): CallWithContext
8989
return self::getInstance(Processors::class)->callCtx($callable);
9090
}
9191

92+
/**
93+
* @param callable(mixed): bool $condition
94+
* @param ProcessorInterface $true
95+
* @param ProcessorInterface|null $false
96+
* @return Condition
97+
*/
9298
public static function condition(callable $condition, ProcessorInterface $true, ?ProcessorInterface $false = null): Condition
9399
{
94100
return self::getInstance(Processors::class)->condition($condition, $true, $false);
95101
}
96102

103+
/**
104+
* @param callable(ContextInterface, mixed): bool $condition
105+
* @param ProcessorInterface $true
106+
* @param ProcessorInterface|null $false
107+
* @return ConditionWithContext
108+
*/
97109
public static function conditionCtx(callable $condition, ProcessorInterface $true, ?ProcessorInterface $false = null): ConditionWithContext
98110
{
99111
return self::getInstance(Processors::class)->conditionCtx($condition, $true, $false);
100112
}
101113

114+
/**
115+
* @param callable(mixed, int|string): bool $predicate
116+
* @return Find
117+
*/
102118
public static function find(callable $predicate): Find
103119
{
104120
return self::getInstance(Processors::class)->find($predicate);
105121
}
106122

123+
/**
124+
* @param callable(ContextInterface, mixed, int|string): bool $predicate
125+
* @return FindWithContext
126+
*/
107127
public static function findCtx(callable $predicate): FindWithContext
108128
{
109129
return self::getInstance(Processors::class)->findCtx($predicate);
@@ -199,6 +219,10 @@ public static function ifNotEqual(mixed $to, ProcessorInterface $true, ?Processo
199219
return self::getInstance(Helpers::class)->ifNotEqual($to, $true, $false, $strict);
200220
}
201221

222+
/**
223+
* @param non-empty-string $separator
224+
* @return Pipeline
225+
*/
202226
public static function explodeString(string $separator): Pipeline
203227
{
204228
return self::getInstance(Helpers::class)->explodeString($separator);

0 commit comments

Comments
 (0)