-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Set up PHP stan * Fix PHP Stan * Apply php-cs-fixer changes * Fix PHP Stan * Deleted unintended file --------- Co-authored-by: aryaantony92 <aryaantony92@users.noreply.github.com>
- Loading branch information
1 parent
873ef8d
commit 4810b54
Showing
10 changed files
with
130 additions
and
3 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,6 @@ | ||
#!/bin/bash | ||
|
||
set -eu -o xtrace | ||
|
||
#cp -rv .github/ci/files/var . | ||
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,61 @@ | ||
name: "Static Analysis" | ||
|
||
on: | ||
schedule: | ||
- cron: '0 3 * * 1,3,5' | ||
pull_request: | ||
branches: | ||
- "[0-9]+.[0-9]+" | ||
- "[0-9]+.x" | ||
paths-ignore: | ||
- 'doc/**' | ||
- 'src/Resources/public/**' | ||
push: | ||
branches: | ||
- "[0-9]+.[0-9]+" | ||
- "[0-9]+.x" | ||
- "*_actions" | ||
jobs: | ||
static-analysis-phpstan: | ||
name: "Static Analysis with PHPStan" | ||
runs-on: "ubuntu-20.04" | ||
continue-on-error: ${{ matrix.experimental }} | ||
strategy: | ||
matrix: | ||
include: | ||
- { php-version: "8.0", dependencies: "lowest", pimcore_version: "", phpstan_args: "", experimental: false } | ||
- { php-version: "8.1", dependencies: "highest", pimcore_version: "", phpstan_args: "", experimental: false} | ||
- { php-version: "8.1", dependencies: "highest", pimcore_version: "11.x-dev", phpstan_args: "", experimental: true} | ||
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@v1" | ||
with: | ||
dependency-versions: "${{ matrix.dependencies }}" | ||
|
||
- name: "Run a static analysis with phpstan/phpstan" | ||
if: ${{ matrix.dependencies == 'highest' }} | ||
run: "vendor/bin/phpstan analyse ${{ matrix.phpstan_args }} -c phpstan.neon --memory-limit=-1" | ||
|
||
- name: "Run a static analysis with phpstan/phpstan" | ||
if: ${{ matrix.dependencies == 'lowest' }} | ||
run: "vendor/bin/phpstan analyse ${{ matrix.phpstan_args }} -c phpstan-lowest.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,6 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^Static method Pimcore\\\\Model\\\\Element\\\\Editlock\\:\\:isLocked\\(\\) invoked with 3 parameters, 2 required.$#" | ||
count: 1 | ||
path: src/Controller/AdminController.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^Static method Pimcore\\\\Model\\\\Element\\\\Editlock\\:\\:isLocked\\(\\) invoked with 2 parameters, 3 required.$#" | ||
count: 1 | ||
path: src/Controller/AdminController.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
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,3 @@ | ||
includes: | ||
- phpstan.neon | ||
- phpstan-baseline-lowest.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
parameters: | ||
level: 4 | ||
reportUnmatchedIgnoredErrors: false | ||
paths: | ||
- src | ||
bootstrapFiles: | ||
- phpstan-bootstrap.php | ||
excludePaths: | ||
- src/Migrations/* | ||
- src/Tests/* | ||
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