File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 pull_request :
66
77env :
8+ PSALM_PHP_VERSION : " 8.3"
89 COVERAGE_PHP_VERSION : " 8.3"
910
1011jobs :
5657 env :
5758 COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5859 if : ${{ matrix.php-version == env.COVERAGE_PHP_VERSION }}
60+
61+ psalm :
62+ name : Psalm
63+ runs-on : ubuntu-latest
64+
65+ steps :
66+ - name : Checkout
67+ uses : actions/checkout@v2
68+
69+ - name : Setup PHP
70+ uses : shivammathur/setup-php@v2
71+ with :
72+ php-version : ${{ env.PSALM_PHP_VERSION }}
73+
74+ - name : Install composer dependencies
75+ uses : " ramsey/composer-install@v1"
76+
77+ - name : Run Psalm
78+ run : vendor/bin/psalm --no-progress
Original file line number Diff line number Diff line change 1212 },
1313 "require-dev" : {
1414 "phpunit/phpunit" : " ^9.0" ,
15- "php-coveralls/php-coveralls" : " ^2.0"
15+ "php-coveralls/php-coveralls" : " ^2.0" ,
16+ "vimeo/psalm" : " 5.17.0"
1617 },
1718 "autoload" : {
1819 "psr-4" : {
Original file line number Diff line number Diff line change 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+ findUnusedBaselineEntry =" true"
9+ findUnusedPsalmSuppress =" true"
10+ findUnusedCode =" false"
11+ >
12+ <projectFiles >
13+ <directory name =" src" />
14+ <ignoreFiles >
15+ <directory name =" vendor" />
16+ </ignoreFiles >
17+ </projectFiles >
18+ </psalm >
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ class GBFormatter implements CountryPostcodeFormatter
4747 /**
4848 * The regular expression patterns, or null if not built yet.
4949 *
50+ * @psalm-var non-empty-string[]|null
51+ *
5052 * @var string[]|null
5153 */
5254 private $ patterns = null ;
@@ -86,6 +88,8 @@ public function format(string $postcode) : ?string
8688 * - The area code (ex: WC) for additional checks
8789 * - The inward code (e.g. 9RZ) for formatting
8890 *
91+ * @psalm-return non-empty-string[]
92+ *
8993 * @return string[]
9094 */
9195 private function getPatterns () : array
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ private function doGetFormatter(string $country): ?CountryPostcodeFormatter
8686 return null ;
8787 }
8888
89+ /** @var class-string<CountryPostcodeFormatter> $class */
8990 $ class = __NAMESPACE__ . '\\Formatter \\' . $ country . 'Formatter ' ;
9091
9192 return class_exists ($ class ) ? new $ class () : null ;
You can’t perform that action at this time.
0 commit comments