diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 6e1c4870d..94978c120 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -34,3 +34,27 @@ jobs: uses: OskarStark/php-cs-fixer-ga@2.16.3.1 with: args: --dry-run --diff-format udiff + + psalm: + name: Psalm + runs-on: ubuntu-latest + steps: + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + extensions: mbstring, intl + tools: composer:v2 + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Download dependencies + run: | + composer require --dev --no-update psalm/phar:3.12.1 + composer update --no-interaction --prefer-dist + + - name: Psalm + run: | + ./vendor/bin/psalm.phar --version + ./vendor/bin/psalm.phar --output-format=github --no-progress --show-info=false --stats diff --git a/Makefile b/Makefile index c435452df..a2b292345 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,10 @@ tag: git commit -m '$(TAG) release' chag tag -static: static-phpstan static-codestyle-check +static: static-phpstan static-psalm static-codestyle-check + +static-psalm: + docker run --rm -it -v ${PWD}:/app -w /app vimeo/psalm-github-actions static-phpstan: docker run --rm -it -e REQUIRE_DEV=true -v ${PWD}:/app -w /app oskarstark/phpstan-ga:0.12.31 analyze $(PHPSTAN_PARAMS) diff --git a/psalm.baseline.xml b/psalm.baseline.xml new file mode 100644 index 000000000..72995074c --- /dev/null +++ b/psalm.baseline.xml @@ -0,0 +1,87 @@ + + + + + null + + + $options + + + getBoundary + + + + + $result + + + + + $uri + + + + + $easy->request->getUri() + + + $timeoutRequiresNoSignal && \strtoupper(\substr(\PHP_OS, 0, 3)) !== 'WIN' + + + + + $this->active + + + $this->active + + + $this->_mh + + + + + $options['delay'] * 1000 + + + + + $uri + + + + + $this->stack + $this->stack + $this->stack + $this->stack + + + + + + + + $request + + + + + $location + + + + + ($this->delay)(++$options['retries'], $response) + + + + + \var_dump($input) + + + $info + + + diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 000000000..d70acfe4f --- /dev/null +++ b/psalm.xml @@ -0,0 +1,16 @@ + + + + + + + + +