Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* phpstan v1 + workflow * Fix intend * More fixes * Update phpstan.neon * phpstan level 2 * Move errors ignoring into phpstan.neon * phpstan level 3 * Don't ignore templates folder * Something from level 4 * Update phpstan.neon
- Loading branch information
Showing
21 changed files
with
157 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: "PHPStan" | ||
|
||
on: | ||
pull_request: | ||
branches: [develop] | ||
push: | ||
branches: [develop] | ||
|
||
jobs: | ||
tests: | ||
name: PhpStan on PHP ${{ matrix.php-versions }} | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-versions: [ '8.1', '8.2', '8.3' ] | ||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v4" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
coverage: "none" | ||
extensions: "intl, zip" | ||
ini-values: "memory_limit=-1" | ||
php-version: "${{ matrix.php-version }}" | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
# Use composer.json for key, if composer.lock is not committed. | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
#key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
|
||
- name: "Install composer dependencies" | ||
run: "composer install" | ||
|
||
- name: "Run PHPStan" | ||
run: "/usr/bin/php vendor/bin/phpstan analyse" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
require __DIR__ . '/system/libs/pot/OTS.php'; | ||
$ots = POT::getInstance(); | ||
|
||
require __DIR__ . '/system/libs/pot/InvitesDriver.php'; | ||
require __DIR__ . '/system/libs/rfc6238.php'; | ||
require __DIR__ . '/common.php'; | ||
|
||
const ACTION = ''; | ||
const PAGE = ''; | ||
const URI = ''; | ||
define('SELF_NAME', basename(__FILE__)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
parameters: | ||
level: 3 | ||
paths: | ||
- . | ||
- templates/tibiacom | ||
- templates/kathrine | ||
excludePaths: | ||
- system/cache/* | ||
- vendor/* | ||
- plugins/* | ||
- system/libs | ||
- tools/signature/mango.php | ||
- tools/signature/gd.class.php | ||
bootstrapFiles: | ||
- phpstan-bootstrap.php | ||
ignoreErrors: | ||
- '#Variable \$db might not be defined#' | ||
- '#Variable \$twig might not be defined#' | ||
- '#Variable \$hooks might not be defined#' | ||
- '#Variable \$account_logged might not be defined#' | ||
- '#Variable \$logged might not be defined#' | ||
- '#Variable \$config might not be defined#' | ||
- '#Variable \$action might not be defined#' | ||
- '#Variable \$errors might not be defined#' | ||
- '#Variable \$cache might not be defined#' | ||
- '#Variable \$status might not be defined#' | ||
- '#Variable \$player might not be defined#' | ||
- '#Variable \$guild might not be defined#' | ||
- '#Variable \$[a-zA-Z0-9\\_]+ might not be defined#' | ||
# Eloquent models | ||
- '#Call to an undefined static method [a-zA-Z0-9\\_]+::[a-zA-Z0-9\\_]+()#' | ||
# system/pages/highscores.php | ||
- '#Call to an undefined method Illuminate\\Database\\Query\\Builder::withOnlineStatus\(\)#' | ||
- '#Access to an undefined property Illuminate\\Database\\Eloquent\\Model::\$online_status#' | ||
- '#Access to an undefined property Illuminate\\Database\\Eloquent\\Model::\$vocation_name#' | ||
- | ||
message: '#Variable \$tmp in empty\(\) always exists and is always falsy#' | ||
path: templates\kathrine\javascript.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters