Skip to content

Commit

Permalink
chore: enable phpstan, address errors (#47)
Browse files Browse the repository at this point in the history
* chore: enable phpstan

* fix: phpstan complaints

* chore: bump js deps
  • Loading branch information
imorland authored Nov 12, 2023
1 parent 13c7cd7 commit 2cf60a7
Show file tree
Hide file tree
Showing 10 changed files with 673 additions and 599 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 Filter 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: .
31 changes: 0 additions & 31 deletions .github/workflows/build.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: FoF Filter JS

on: [workflow_dispatch, push, pull_request]

jobs:
run:
uses: flarum/framework/.github/workflows/REUSABLE_frontend.yml@main
with:
enable_bundlewatch: false
enable_prettier: true
enable_typescript: true

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

secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,21 @@
},
"flagrow": {
"discuss": "https://discuss.flarum.org/d/5131"
},
"flarum-cli": {
"modules": {
"githubActions": true
}
}
},
"require-dev": {
"flarum/phpstan": "*"
},
"scripts": {
"analyse:phpstan": "phpstan analyse",
"clear-cache:phpstan": "phpstan clear-result-cache"
},
"scripts-descriptions": {
"analyse:phpstan": "Run static analysis"
}
}
5 changes: 5 additions & 0 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Flarum\Extend;
use Flarum\Post\Event\Posted;
use Flarum\Post\Event\Saving as PostSaving;
use Flarum\Post\Post;
use Flarum\Settings\Event\Saving as SettingSaving;
use FoF\Filter\Listener\AddCensorChecks;
use FoF\Filter\Listener\AutoMerge;
Expand All @@ -32,6 +33,10 @@
(new Extend\View())
->namespace('fof-filter', __DIR__.'/views'),

(new Extend\Model(Post::class))
->cast('auto_mod', 'bool')
->cast('emailed', 'bool'),

(new Extend\Event())
->listen(SettingSaving::class, AddCensorChecks::class)
->listen(PostSaving::class, CheckPost::class)
Expand Down
Loading

0 comments on commit 2cf60a7

Please sign in to comment.