diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml new file mode 100644 index 0000000..e68069c --- /dev/null +++ b/.github/workflows/backend.yml @@ -0,0 +1,12 @@ +name: FoF BBCode Details 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: . diff --git a/.github/workflows/build.yml b/.github/workflows/frontend.yml similarity index 93% rename from .github/workflows/build.yml rename to .github/workflows/frontend.yml index ca3526b..08941fa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/frontend.yml @@ -1,4 +1,4 @@ -name: Javascript +name: FoF BBCode Details JS on: [workflow_dispatch, push, pull_request] @@ -14,5 +14,6 @@ jobs: backend_directory: . js_package_manager: npm main_git_branch: master + secrets: bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }} diff --git a/composer.json b/composer.json index 1e64f31..8940ff4 100644 --- a/composer.json +++ b/composer.json @@ -1,62 +1,77 @@ { - "name": "fof/bbcode-details", - "description": "Details BBCode for Flarum", - "keywords": [ - "flarum" - ], - "type": "flarum-extension", - "license": "MIT", - "support": { - "issues": "https://github.com/FriendsOfFlarum/bbcode-details/issues", - "source": "https://github.com/FriendsOfFlarum/bbcode-details", - "forum": "https://discuss.flarum.org/d/18796" - }, - "homepage": "https://friendsofflarum.org", - "funding": [ - { - "type": "website", - "url": "https://opencollective.com/fof/donate" - } - ], - "require": { - "flarum/core": "^1.2.0" - }, - "authors": [ - { - "name": "Sajjad Hashemian", - "email": "wolaws@gmail.com" + "name": "fof/bbcode-details", + "description": "Details BBCode for Flarum", + "keywords": [ + "flarum" + ], + "type": "flarum-extension", + "license": "MIT", + "support": { + "issues": "https://github.com/FriendsOfFlarum/bbcode-details/issues", + "source": "https://github.com/FriendsOfFlarum/bbcode-details", + "forum": "https://discuss.flarum.org/d/18796" }, - { - "name": "David Sevilla Martín", - "email": "david.s@redevs.org", - "role": "Developer" + "homepage": "https://friendsofflarum.org", + "funding": [ + { + "type": "website", + "url": "https://opencollective.com/fof/donate" + } + ], + "require": { + "flarum/core": "^1.2.0" }, - { - "name": "Katos", - "email": "katos@flarum.org", - "role": "Developer" - } - ], - "replace": { - "sijad/flarum-ext-details": "*" - }, - "autoload": { - "psr-4": { - "FoF\\BBCodeDetails\\": "src/" - } - }, - "extra": { - "flarum-extension": { - "title": "FoF BBCode Details", - "category": "feature", - "icon": { - "name": "fas fa-minus-square", - "backgroundColor": "#e74c3c", - "color": "#fff" - } + "authors": [ + { + "name": "Sajjad Hashemian", + "email": "wolaws@gmail.com" + }, + { + "name": "David Sevilla Martín", + "email": "david.s@redevs.org", + "role": "Developer" + }, + { + "name": "Katos", + "email": "katos@flarum.org", + "role": "Developer" + } + ], + "replace": { + "sijad/flarum-ext-details": "*" + }, + "autoload": { + "psr-4": { + "FoF\\BBCodeDetails\\": "src/" + } + }, + "extra": { + "flarum-extension": { + "title": "FoF BBCode Details", + "category": "feature", + "icon": { + "name": "fas fa-minus-square", + "backgroundColor": "#e74c3c", + "color": "#fff" + } + }, + "flagrow": { + "discuss": "https://discuss.flarum.org/d/18796" + }, + "flarum-cli": { + "modules": { + "githubActions": true + } + } + }, + "require-dev": { + "flarum/phpstan": "*" + }, + "scripts": { + "analyse:phpstan": "phpstan analyse", + "clear-cache:phpstan": "phpstan clear-result-cache" }, - "flagrow": { - "discuss": "https://discuss.flarum.org/d/18796" + "scripts-descriptions": { + "analyse:phpstan": "Run static analysis" } - } } diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..476e09d --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,12 @@ +includes: + - vendor/flarum/phpstan/extension.neon + +parameters: + # The level will be increased in Flarum 2.0 + level: 5 + paths: + - extend.php + excludePaths: + - *.blade.php + checkMissingIterableValueType: false + databaseMigrationsPath: ['migrations']