Skip to content

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 4bdd136 commit f23bcf6
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 54 deletions.
49 changes: 0 additions & 49 deletions .github/issue_template.md

This file was deleted.

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 Night Mode 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 Night Mode 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: yarn
main_git_branch: master

secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
17 changes: 16 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@
},
"optional-dependencies": [
"fof/default-user-preferences"
]
],
"flarum-cli": {
"modules": {
"githubActions": true
}
}
},
"autoload": {
"psr-4": {
Expand All @@ -68,5 +73,15 @@
"src/Overrides/Frontend/Assets.php",
"src/Overrides/Frontend/RecompileFrontendAssets.php"
]
},
"scripts": {
"analyse:phpstan": "phpstan analyse",
"clear-cache:phpstan": "phpstan clear-result-cache"
},
"scripts-descriptions": {
"analyse:phpstan": "Run static analysis"
},
"require-dev": {
"flarum/phpstan": "*"
}
}
13 changes: 13 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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']
4 changes: 2 additions & 2 deletions src/Content/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ protected function assembleCompilers(?string $locale): array
/**
* @param string|null $url
* @param string $type
* @param string $auto
* @param bool $auto
*
* @return string
*/
protected function generateTag(?string $url, string $type, string $auto): string
protected function generateTag(?string $url, string $type, bool $auto): string
{
return sprintf(
'<link rel="stylesheet" media="%s" class="nightmode-%s" href="%s" />',
Expand Down

0 comments on commit f23bcf6

Please sign in to comment.