Skip to content

Commit 548ab59

Browse files
committed
Add github actions, add psalm
1 parent f9470f1 commit 548ab59

File tree

6 files changed

+59
-3
lines changed

6 files changed

+59
-3
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
ignore:
8+
- dependency-name: "*"
9+
update-types: ["version-update:semver-minor", "version-update:semver-patch"]

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
permissions:
4+
contents: read
5+
6+
on: [push]
7+
8+
jobs:
9+
php:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
php: ['8.0', '8.1', '8.2', '8.3']
14+
steps:
15+
- name: Setup PHP
16+
uses: shivammathur/setup-php@v2
17+
with:
18+
php-version: ${{ matrix.php }}
19+
- uses: actions/checkout@v4
20+
21+
- name: Install dependencies
22+
run: composer install --no-interaction --no-progress
23+
24+
- name: Run phpstan
25+
run: php vendor/bin/phpstan
26+
27+
- name: Run psalm
28+
run: php vendor/bin/psalm

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
},
1313
"require-dev":
1414
{
15-
"phpstan/phpstan": "^1.4"
15+
"phpstan/phpstan": "^1.10",
16+
"vimeo/psalm": "^5.16"
1617
},
1718
"autoload":
1819
{

psalm.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="2"
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="true"
10+
>
11+
<projectFiles>
12+
<directory name="src" />
13+
<directory name="." />
14+
<ignoreFiles>
15+
<directory name="vendor" />
16+
</ignoreFiles>
17+
</projectFiles>
18+
</psalm>

view.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Display everything in browser, because some people can't look in logs for errors
1212
error_reporting( E_ALL | E_STRICT );
13-
ini_set( 'display_errors', true );
13+
ini_set( 'display_errors', '1' );
1414

1515
require __DIR__ . '/src/MinecraftQuery.php';
1616
require __DIR__ . '/src/MinecraftQueryException.php';

view_serverping.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Display everything in browser, because some people can't look in logs for errors
1212
error_reporting( E_ALL | E_STRICT );
13-
ini_set( 'display_errors', true );
13+
ini_set( 'display_errors', '1' );
1414

1515
require __DIR__ . '/src/MinecraftPing.php';
1616
require __DIR__ . '/src/MinecraftPingException.php';

0 commit comments

Comments
 (0)