Skip to content

RegexAnalyser: Add string cast in preg_replace() call #44

RegexAnalyser: Add string cast in preg_replace() call

RegexAnalyser: Add string cast in preg_replace() call #44

Workflow file for this run

name: PHPStan
on:
workflow_dispatch: ~
pull_request:
paths:
- '**.php'
- composer.json
- tools/phpstan/composer.json
- phpstan.ci.neon
- phpstan.neon.dist
- .github/workflows/phpstan.yml
jobs:
phpstan:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.1', '8.4']
prefer: ['prefer-stable', 'prefer-lowest']
name: PHPStan with PHP ${{ matrix.php-versions }} ${{ matrix.prefer }}
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
env:
fail-fast: true
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.prefer }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-
- name: Install dependencies
env:
COMPOSER_COMPILE: all
run: |
if [ "${{ matrix.prefer }}" = "prefer-lowest" ]; then
# Actually test with lowest possible versions.
export COMPOSER_NO_SECURITY_BLOCKING=1
fi
composer config --no-plugins allow-plugins.civicrm/composer-compile-plugin false
composer config --no-plugins allow-plugins.civicrm/composer-downloads-plugin true
composer config --no-plugins allow-plugins.composer/installers true
composer config --no-plugins allow-plugins.cweagans/composer-patches true
# Run with --no-scripts so ComposerHelper doesn't prevent installation
# of civicrm packages.
composer update --no-scripts --no-progress --prefer-dist --${{ matrix.prefer }} --optimize-autoloader --ignore-platform-reqs
composer composer-phpunit -- update --no-progress --prefer-dist --optimize-autoloader
composer composer-phpstan -- update --no-progress --prefer-dist --optimize-autoloader
cd ..
git clone --depth=1 https://lab.civicrm.org/extensions/action-provider.git
git clone --depth=1 https://lab.civicrm.org/extensions/dataprocessor.git
git clone --depth=1 https://github.com/Project60/org.project60.sepa.git
- name: Run PHPStan
run: composer phpstan -- analyse -c phpstan.ci.neon