Skip to content

Commit

Permalink
chore: enable phpstan (#39)
Browse files Browse the repository at this point in the history
* chore: enable phpstan

* chore: bump js deps

* fix: set accessor public
  • Loading branch information
imorland authored Nov 12, 2023
1 parent 150f64b commit 6ecd5e0
Show file tree
Hide file tree
Showing 7 changed files with 244 additions and 202 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 Passport 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 Passport 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 }}
15 changes: 15 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,26 @@
},
"flagrow": {
"discuss": "https://discuss.flarum.org/d/5203"
},
"flarum-cli": {
"modules": {
"githubActions": true
}
}
},
"autoload": {
"psr-4": {
"FoF\\Passport\\": "src/"
}
},
"require-dev": {
"flarum/phpstan": "*"
},
"scripts": {
"analyse:phpstan": "phpstan analyse",
"clear-cache:phpstan": "phpstan clear-result-cache"
},
"scripts-descriptions": {
"analyse:phpstan": "Run static analysis"
}
}
393 changes: 197 additions & 196 deletions js/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"@flarum/prettier-config": "^1.0.0",
"flarum-tsconfig": "^1.0.2",
"flarum-webpack-config": "^2.0.0",
"webpack": "^5.76.1",
"webpack-cli": "^5.0.1"
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4"
},
"devDependencies": {
"prettier": "^2.8.4"
"prettier": "^3.0.3"
},
"scripts": {
"dev": "webpack --mode development --watch",
Expand Down
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']
2 changes: 1 addition & 1 deletion src/ResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ResourceOwner implements ResourceOwnerInterface
*/
private $response;

private static $fields = [];
public static $fields = [];

public function __construct(array $response = [])
{
Expand Down

0 comments on commit 6ecd5e0

Please sign in to comment.