-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Task: Setup PHPStan * Task: Add phpstan require-dev * Task: fix handleResponse phpdoc * Task: add/fix phpdoc params and return * Apply php-cs-fixer changes * fix missing null in phpdocblock Co-authored-by: kingjia90 <kingjia90@users.noreply.github.com>
- Loading branch information
Showing
8 changed files
with
102 additions
and
5 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 @@ | ||
APP_ENV=test |
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,5 @@ | ||
#!/bin/bash | ||
|
||
set -eu -o xtrace | ||
|
||
cp .github/ci/files/.env . |
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,50 @@ | ||
name: "Static Analysis" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "[0-9]+.[0-9]+" | ||
- "[0-9]+.x" | ||
push: | ||
branches: | ||
- "[0-9]+.[0-9]+" | ||
- "[0-9]+.x" | ||
|
||
jobs: | ||
static-analysis-phpstan: | ||
name: "Static Analysis with PHPStan" | ||
runs-on: "ubuntu-20.04" | ||
strategy: | ||
matrix: | ||
include: | ||
- { php-version: 8.0, database: "mariadb:10.7", pimcore_version: "", dependencies: lowest, experimental: false } | ||
- { php-version: 8.1, database: "mariadb:10.7", pimcore_version: "", dependencies: highest, experimental: false } | ||
steps: | ||
- name: "Checkout code" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
coverage: "none" | ||
php-version: "${{ matrix.php-version }}" | ||
|
||
- name: "Setup Pimcore environment" | ||
run: | | ||
.github/ci/scripts/setup-pimcore-environment.sh | ||
# - name: "Update Pimcore version" | ||
# env: | ||
# PIMCORE_VERSION: "${{ matrix.pimcore_version }}" | ||
# run: | | ||
# if [ ! -z "$PIMCORE_VERSION" ]; then | ||
# composer require --no-update pimcore/pimcore:"${PIMCORE_VERSION}" | ||
# fi | ||
|
||
- name: "Install dependencies with Composer" | ||
uses: "ramsey/composer-install@v2" | ||
with: | ||
dependency-versions: "${{ matrix.dependencies }}" | ||
|
||
- name: "Run a static analysis with phpstan/phpstan" | ||
run: "vendor/bin/phpstan analyse ${{ matrix.phpstan_args }} -c phpstan.neon --memory-limit=-1" |
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,2 @@ | ||
parameters: | ||
ignoreErrors: |
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,19 @@ | ||
<?php | ||
|
||
if (file_exists(__DIR__ . '/vendor/autoload.php')) { | ||
define('PIMCORE_PROJECT_ROOT', __DIR__); | ||
} elseif (file_exists(__DIR__ . '/../../../vendor/autoload.php')) { | ||
define('PIMCORE_PROJECT_ROOT', __DIR__ . '/../../..'); | ||
} elseif (getenv('PIMCORE_PROJECT_ROOT')) { | ||
define('PIMCORE_PROJECT_ROOT', getenv('PIMCORE_PROJECT_ROOT')); | ||
} else { | ||
throw new \Exception('Unknown configuration! Pimcore project root not found, please set env variable PIMCORE_PROJECT_ROOT.'); | ||
} | ||
|
||
include PIMCORE_PROJECT_ROOT . '/vendor/autoload.php'; | ||
\Pimcore\Bootstrap::setProjectRoot(); | ||
\Pimcore\Bootstrap::bootstrap(); | ||
|
||
if (!defined('PIMCORE_TEST')) { | ||
define('PIMCORE_TEST', true); | ||
} |
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,8 @@ | ||
parameters: | ||
level: 5 | ||
paths: | ||
- src | ||
bootstrapFiles: | ||
- phpstan-bootstrap.php | ||
includes: | ||
- phpstan-baseline.neon |
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