Skip to content

Commit c30cf8a

Browse files
authored
Merge pull request #13 from BoatraceOpenAPI/feature/issue-9-psalm
chore: add vimeo/psalm for static analysis
2 parents fe3a95e + f19a555 commit c30cf8a

4 files changed

Lines changed: 65 additions & 1 deletion

File tree

.github/workflows/psalm.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: psalm
2+
3+
on:
4+
push:
5+
branches:
6+
- '*.x'
7+
pull_request:
8+
schedule:
9+
- cron: '0 0 * * *'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
psalm:
17+
name: Psalm Static Analysis on PHP ${{ matrix.php-version }} (Ubuntu 24.04)
18+
runs-on: ubuntu-24.04
19+
strategy:
20+
matrix:
21+
php-version:
22+
- '8.4'
23+
steps:
24+
- name: Setup PHP ${{ matrix.php-version }}
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php-version }}
28+
extensions: mbstring, xml
29+
30+
- name: Checkout Repository
31+
uses: actions/checkout@v4
32+
33+
- name: Install Dependencies
34+
run: composer install --prefer-dist --no-interaction --no-progress --dev
35+
36+
- name: Run Psalm
37+
run: vendor/bin/psalm --show-info=true

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"nesbot/carbon": "^2.63 || ^3.0"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "^12.0"
23+
"phpunit/phpunit": "^12.0",
24+
"vimeo/psalm": "^6.0"
2425
},
2526
"autoload": {
2627
"psr-4": {

psalm.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
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+
findUnusedCode="false"
10+
>
11+
<projectFiles>
12+
<directory name="src"/>
13+
<ignoreFiles>
14+
<directory name="vendor"/>
15+
</ignoreFiles>
16+
</projectFiles>
17+
18+
<stubs>
19+
<file name="stubs/Scraper.stubphp"/>
20+
</stubs>
21+
</psalm>

stubs/Scraper.stubphp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
namespace BVP\Scraper;
4+
5+
final class Scraper {}

0 commit comments

Comments
 (0)