Skip to content

Commit

Permalink
Upgraded static analyzers
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Jan 23, 2022
1 parent 45de9d9 commit 73f5ec3
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: '8.0'
tools: composer:2.1
coverage: none

Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: '8.0'
tools: composer:2.1
coverage: none

Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
install:
@docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:7.4-base update
@docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:7.4-base bin all update
@docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:8.0-base update
@docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:8.0-base bin all update

phpunit:
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit --rm registry.gitlab.com/grahamcampbell/php:7.4-cli
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit --rm registry.gitlab.com/grahamcampbell/php:8.0-cli

phpstan-analyze:
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:7.4-cli analyze
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:8.0-cli analyze

phpstan-baseline:
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:7.4-cli analyze --generate-baseline
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:8.0-cli analyze --generate-baseline

psalm-analyze:
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:7.4-cli
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:8.0-cli

psalm-baseline:
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:7.4-cli --set-baseline=psalm-baseline.xml
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:8.0-cli --set-baseline=psalm-baseline.xml

psalm-show-info:
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:7.4-cli --show-info=true
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/psalm.phar --rm registry.gitlab.com/grahamcampbell/php:8.0-cli --show-info=true

test: phpunit phpstan-analyze psalm-analyze

Expand Down
5 changes: 5 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
parameters:
ignoreErrors:
-
message: "#^Property Bitbucket\\\\Api\\\\AbstractApi\\:\\:\\$perPage is never written, only read\\.$#"
count: 1
path: src/Api/AbstractApi.php

-
message: "#^Variable method call on Bitbucket\\\\Api\\\\AbstractApi\\.$#"
count: 1
Expand Down
10 changes: 1 addition & 9 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.3.1@2feba22a005a18bf31d4c7b9bdb9252c73897476">
<file src="src/HttpClient/Util/JsonArray.php">
<MixedArgument occurrences="1">
<code>\get_debug_type($data)</code>
</MixedArgument>
<UndefinedFunction occurrences="1">
<code>\get_debug_type($data)</code>
</UndefinedFunction>
</file>
<files psalm-version="4.x-dev@">
<file src="src/ResultPager.php">
<InaccessibleProperty occurrences="1">
<code>$clone-&gt;perPage</code>
Expand Down
1 change: 1 addition & 0 deletions src/HttpClient/Util/UriBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ final class UriBuilder
*/
public static function build(string ...$parts): string
{
/** @var int $index */
foreach ($parts as $index => $part) {
if ('' === $part) {
throw new ValueError(\sprintf('%s::buildUri(): Argument #%d ($parts) must non-empty', self::class, $index + 1));
Expand Down
12 changes: 6 additions & 6 deletions vendor-bin/phpstan/composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"require": {
"php": "^7.2.5 || ^8.0",
"phpstan/phpstan": "0.12.82",
"phpstan/phpstan-deprecation-rules": "0.12.6",
"phpstan/phpstan-strict-rules": "0.12.9",
"thecodingmachine/phpstan-strict-rules": "0.12.1",
"ergebnis/phpstan-rules": "0.15.3"
"php": "^8.0.2",
"phpstan/phpstan": "1.4.2",
"phpstan/phpstan-deprecation-rules": "1.0.0",
"phpstan/phpstan-strict-rules": "1.1.0",
"thecodingmachine/phpstan-strict-rules": "1.0.0",
"ergebnis/phpstan-rules": "1.0.0"
},
"config": {
"preferred-install": "dist"
Expand Down
4 changes: 2 additions & 2 deletions vendor-bin/phpunit/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"require": {
"php": "^7.2.5 || ^8.0",
"phpunit/phpunit": "^8.5.15 || ^9.5.4"
"php": "^7.2.5 || ^8.0.2",
"phpunit/phpunit": "^8.5.23 || ^9.5.12"
},
"config": {
"preferred-install": "dist"
Expand Down
4 changes: 2 additions & 2 deletions vendor-bin/psalm/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"require": {
"php": "^7.2.5 || ^8.0",
"psalm/phar": "4.6.3"
"php": "^8.0.2",
"psalm/phar": "4.18.1"
},
"config": {
"preferred-install": "dist"
Expand Down

0 comments on commit 73f5ec3

Please sign in to comment.