Skip to content

Bump phpstan/phpstan from 1.12.3 to 1.12.4 in the phpstan group #3852

Bump phpstan/phpstan from 1.12.3 to 1.12.4 in the phpstan group

Bump phpstan/phpstan from 1.12.3 to 1.12.4 in the phpstan group #3852

Workflow file for this run

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ** Static analysis **
#
# This GitHub Action requires every pull request to fulfill the minimum requirements at all times. Various static
# analysis tools are included and executed during this workflow. They only check out the source code without the need
# to run the whole Share community platform. Hence, this automated static analysis checks are fast. Besides, no tests
# have to be created manually. However, no behavior can be tested.
#
# - This tests must never fail!:
#
# We should never allow those checks to fail before merging a pull request. Having failing pipelines over a more
# extended period results in developers and code reviewers to ignore those checks, which again results in more and
# more errors over time. If necessary, it is better to reduce the strictness of some checks in the corresponding
# config files, or explicitly tell the tools to ignore a particular pattern or line.
#
# - Tool integration:
#
# Most tools are integrated directly using a package manager (npm, composer). This allows to Dependabot to update
# the dependencies of the GitHub Actions. Besides, the CI system uses the same versions like developers would
# locally. However, this approach also a a drawback. More "artificial" dependencies on the static analysis tools
# which are not necessary to run the Share community platform. In case, one they there arise dependency conflicts
# just remove the tool from the package manager and add the tool using a pre-built executable (wget) or an action
# from the marketplace (This is already the case or This is already the case for `phploc` and `phpcpd`.)
#
# - Caching:
#
# By caching the third party code installed by package manager, the build time can be significantly reduced.
#
# - Composites:
#
# By using composites to build the jobs, a lot of duplicated code can be prevent.
#
name: 'Static analysis'
# Run-on every creation, update and merge of a pull request.
# However, prevent checks to be initiated twice if the pull request origins from a branch on the official repository.
# For example, this happens with dependabot.
on:
pull_request:
branches:
- '**' # all branches
- '!master' # excludes master to prevent double test runs during release prep.
jobs:
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ** Javascript **
#
# Eslint:
# - Statically analyzes javascript code (depends on node and npm)
# - Config defined in .eslintrc.yaml
# - Automatic fix support
# - npm "test" script must be defined in package.json
# - More information at: (https://eslint.org/)
#
eslint:
name: JavaScript [ESLint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Setup Node and npm modules'
uses: ./.github/actions/setup-npm-node-modules
- run: npm run test-js
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ** Sass,CSS **
#
# StyleLint:
# - Statically analyzes Sass and css files (depends on node and npm)
# - Config defined in .stylelintrc.json
# - Automatic fix support
# - More information at: https://stylelint.io/
# - "test-style" script is defined in package.json to execute stylelint
#
stylelint:
name: Sass,CSS [StyleLint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Setup Node and npm modules'
uses: ./.github/actions/setup-npm-node-modules
- run: npm run test-css
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ** Sass,CSS,MD,YAML **
#
# Prettier:
# - Check formatting style (depends on node and npm)
# - Config defined in .prettierrc.json and .prettierignore
# - Automatic fix support npx prettier . --check
# - More information at: https://prettier.io/
#
prettier:
name: Sass,CSS,MD,YAML formatting [Prettier]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Setup Node and npm modules'
uses: ./.github/actions/setup-npm-node-modules
- run: npm run test-asset
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ** PHP **
#
#
# Php-CS-Fixer:
# - Reports code style issues in php files
# - config defined in .php_cs(.dist)
# - More information at: https://github.com/FriendsOfPHP/PHP-CS-Fixer
#
php-cs-fixer:
name: PHP Code Style [Php-CS-Fixer]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Setup PHP and composer packages'
uses: ./.github/actions/setup-php-composer
- run: PHP_CS_FIXER_IGNORE_ENV=1 php bin/php-cs-fixer fix --diff --dry-run --allow-risky=yes --verbose --format=txt
#
# PhpStan:
#
# - Statically analyzes php files (The more strongly-typed the code is, the more information we get)
# - config defined in phpstan.neon(.dist) (8 different levels!)
# - More information at: https://phpstan.org/
#
# - Why use both PhpStan and Psalm? In their current state they are able to find different possible problems.
#
phpstan:
name: PHP Static Analysis [Php-Stan]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Setup PHP and composer packages'
uses: ./.github/actions/setup-php-composer
- run: bin/phpstan analyze
#
# Psalm:
#
# - Statically analyzes php files (The more strongly-typed the code is, the more information we get)
# - config defined in psalm.xml(.dist) (8 different levels!)
# - More information at: https://psalm.dev/
#
# - Why use both PhpStan and Psalm? In their current state they are able to find different possible problems.
#
psalm:
name: PHP Static Analysis [Psalm]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Setup PHP and composer packages'
uses: ./.github/actions/setup-php-composer
- run: vendor/vimeo/psalm/psalm
#
# phpcpd (Php Copy Paste Detector):
#
# - Checking for PHP code that was just copied
# - More information at: https://github.com/sebastianbergmann/phpcpd
#
phpcpd:
name: PHP Static Analysis [PhpCPD]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: PHP Copy Paste Detector
uses: StephaneBour/[email protected]
with:
args: src
#
# phpdd (Php Code Fixer):
#
# - to search issues with deprecated functionality in newer interpreter versions..
# - More information at: https://github.com/wapmorgan/PhpDeprecationDetector
#
# phpdd:
# name: PHP Static Analysis [Phpdd]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: "Setup PHP and composer packages"
# uses: ./.github/actions/setup-php-composer
# - run: bin/phpdd src tests # Currently disabled: https://github.com/wapmorgan/PhpDeprecationDetector/issues
#
# PhpLoc:
#
# - Measuring the size and analyzing the structure of the project (php)
# - More information at: https://github.com/sebastianbergmann/phploc
#
php-loc:
name: PHP Info [PhpLoc]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: wget https://phar.phpunit.de/phploc.phar
- run: php phploc.phar src tests
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ** Twig **
#
# - Lints a template and outputs encountered errors.
#
lint-twig:
name: Twig [Lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Setup PHP and composer packages'
uses: ./.github/actions/setup-php-composer
- run: bin/console lint:twig templates/
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ** YAML **
#
# - Ensures all yaml files contain valid syntax
#
lint-yaml:
name: Yaml [Lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Setup PHP and composer packages'
uses: ./.github/actions/setup-php-composer
- run: bin/console lint:yaml translations/ config/ .github/ docker/ behat.yaml.dist .eslintrc.yaml
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ** Container**
#
# - Checks the services defined in the container
# - Ensures that arguments injected into services match type declarations
#
lint-container:
name: Symfony Container [Lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Setup PHP and composer packages'
uses: ./.github/actions/setup-php-composer
- run: bin/console lint:container