From 452f97bd216bdbacced54a7dbaa8de8fd117f42b Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Wed, 22 Feb 2023 19:30:26 +0000 Subject: [PATCH 1/5] Adds type checking --- .github/workflows/static-analysis.yml | 43 +++++++++++++++++++++++++++ composer.json | 1 + phpstan.neon.dist | 5 ++++ 3 files changed, 49 insertions(+) create mode 100644 .github/workflows/static-analysis.yml create mode 100644 phpstan.neon.dist diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml new file mode 100644 index 0000000..bd406ea --- /dev/null +++ b/.github/workflows/static-analysis.yml @@ -0,0 +1,43 @@ +name: static analysis + +on: + push: + branches: + - master + - '*.x' + pull_request: + schedule: + - cron: '0 0 * * *' + +permissions: + contents: read + +jobs: + tests: + runs-on: ubuntu-22.04 + + strategy: + fail-fast: true + + name: Static Analysis + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + tools: composer:v2 + coverage: none + + - name: Install dependencies + uses: nick-fields/retry@v2 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress + + - name: Execute type checking + run: vendor/bin/phpstan diff --git a/composer.json b/composer.json index 6236217..29dc62e 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,7 @@ "illuminate/support": "~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0" }, "require-dev": { + "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^7.0|^8.0|^9.0" }, "autoload": { diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 0000000..5b79b49 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,5 @@ +parameters: + paths: + - src + + level: 0 From 950e49accc9a5e019f518d17a24149b9c6a421eb Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Wed, 22 Feb 2023 19:36:48 +0000 Subject: [PATCH 2/5] Removes PHP 7.1 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 29dc62e..3d14110 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^7.1.3|^8.0", + "php": "^7.2.0|^8.0", "illuminate/support": "~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0" }, "require-dev": { From f5cccd2e4cfeee7a6ce9521240a799cb6b7fad91 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Wed, 22 Feb 2023 19:37:07 +0000 Subject: [PATCH 3/5] Removes PHP 7.1 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f55b38b..a3959e2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: true matrix: - php: [7.1, 7.2, 7.3, 7.4, '8.0', 8.1, 8.2] + php: [7.2, 7.3, 7.4, '8.0', 8.1, 8.2] name: PHP ${{ matrix.php }} From d18f6995ca5c9c068368063f5e7bb23f8eb0a801 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 23 Feb 2023 11:23:33 +0400 Subject: [PATCH 4/5] Update .gitattributes --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 4a70804..d3c4ec8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13,4 +13,5 @@ .gitignore export-ignore .styleci.yml export-ignore CHANGELOG.md export-ignore +phpstan.neon.dist export-ignore phpunit.xml.dist export-ignore From 66023cb80d36415677d4e22781b83989726aa773 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 23 Feb 2023 11:29:19 +0400 Subject: [PATCH 5/5] Update static-analysis.yml --- .github/workflows/static-analysis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index bd406ea..453d8a6 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -6,8 +6,6 @@ on: - master - '*.x' pull_request: - schedule: - - cron: '0 0 * * *' permissions: contents: read