Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enable phpstan, apply fixes #110

Merged
merged 4 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 Gamification 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: .
32 changes: 0 additions & 32 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 Gamification 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 }}
18 changes: 17 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fof/gamification",
"description": "Upvotes and downvotes for your Flarum community",
"description": "Upvotes and downvotes for your Flarum community",
"keywords": [
"flarum",
"friendsofflarum",
Expand Down Expand Up @@ -55,6 +55,22 @@
},
"flagrow": {
"discuss": "https://discuss.flarum.org/d/20671"
},
"flarum-cli": {
"modules": {
"githubActions": true
}
}
},
"scripts": {
"analyse:phpstan": "phpstan analyse",
"clear-cache:phpstan": "phpstan clear-result-cache"
},
"scripts-descriptions": {
"analyse:phpstan": "Run static analysis"
},
"require-dev": {
"flarum/phpstan": "*",
"flarum/pusher": "*"
}
}
8 changes: 8 additions & 0 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Flarum\Api\Controller;
use Flarum\Api\Serializer;
use Flarum\Discussion\Discussion;
use Flarum\Discussion\Event\Started;
use Flarum\Discussion\Filter\DiscussionFilterer;
use Flarum\Discussion\Search\DiscussionSearcher;
Expand Down Expand Up @@ -41,6 +42,9 @@
new Extend\Locales(__DIR__.'/resources/locale'),

(new Extend\Model(User::class))
->cast('votes', 'int')
->cast('rank', 'string')
->cast('last_vote_time', 'datetime')
->belongsToMany('ranks', Rank::class, 'rank_users'),

(new Extend\Model(Post::class))
Expand All @@ -55,6 +59,10 @@
return $post->hasMany(Vote::class, 'post_id');
}),

(new Extend\Model(Discussion::class))
->cast('votes', 'int')
->cast('hotness', 'float'),

(new ExtensionSettings())
->setPrefix('fof-gamification.')
->addKeys([
Expand Down
Loading
Loading