Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

Commit

Permalink
chore: enable phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Nov 12, 2023
1 parent 9840922 commit 4ffe579
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: FoF Stop Forum Spam PHP

on: [workflow_dispatch, push, pull_request]

jobs:
run:
uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@main
with:
enable_backend_testing: false
enable_phpstan: true

backend_directory: .
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Javascript
name: FoF Stop Forum Spam JS

on: [workflow_dispatch, push, pull_request]

Expand All @@ -8,11 +8,12 @@ jobs:
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: false
enable_typescript: true

frontend_directory: ./js
backend_directory: .
js_package_manager: npm
main_git_branch: master

secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,25 @@
},
"flagrow": {
"discuss": "https://discuss.flarum.org/d/17846"
},
"flarum-cli": {
"modules": {
"githubActions": true
}
}
},
"suggest": {
"fof/spamblock": "Allows the option to report spammers to StopForumSpam in order to keep the greater forum community spam free."
},
"require-dev": {
"flarum/phpstan": "*",
"fof/spamblock": "*"
},
"scripts": {
"analyse:phpstan": "phpstan analyse",
"clear-cache:phpstan": "phpstan clear-result-cache"
},
"scripts-descriptions": {
"analyse:phpstan": "Run static analysis"
}
}
14 changes: 14 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
includes:
- vendor/flarum/phpstan/extension.neon

parameters:
# The level will be increased in Flarum 2.0
level: 5
paths:
- extend.php
- src
excludePaths:
- *.blade.php
checkMissingIterableValueType: false
databaseMigrationsPath: ['migrations']

2 changes: 1 addition & 1 deletion src/StopForumSpam.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function isEnabled(): bool
{
$key = $this->settings->get(self::KEY);

return $key != null && !empty($key);
return $key !== null && !empty($key);
}

public function report(array $data): ResponseInterface
Expand Down

0 comments on commit 4ffe579

Please sign in to comment.