From 452ef7218e85e649f0ad268d65b146a85b03a7c3 Mon Sep 17 00:00:00 2001 From: Marcel Kuhmann Date: Thu, 7 May 2020 11:31:17 +0200 Subject: [PATCH 1/7] Update .travis.yml --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8f4e1727eb8..e6409ecc9cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,10 @@ matrix: - php: 7.2 name: Backward compatibillity check env: DEPENDENCIES="roave/backward-compatibility-check" TEST_COMMAND="./.github/bc-test.sh" + - php: 7.1 + name: phpstan + script: + - vendor/bin/phpstan analyze before_install: - if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi; From a59e75e780d751579038da1ebbb2e5eaac55e6c9 Mon Sep 17 00:00:00 2001 From: "Marcel Kuhmann (Koders)" Date: Thu, 7 May 2020 11:41:20 +0200 Subject: [PATCH 2/7] added phpstan --- .travis.yml | 2 +- composer.json | 3 ++- phpstan.neon.dist | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 phpstan.neon.dist diff --git a/.travis.yml b/.travis.yml index e6409ecc9cb..c8b6f8f7a74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ matrix: - php: 7.1 name: phpstan script: - - vendor/bin/phpstan analyze + - vendor/bin/phpstan analyse before_install: - if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi; diff --git a/composer.json b/composer.json index 2f46ebc4129..c42123f94c0 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,8 @@ "php-http/guzzle6-adapter": "^1.0 || ^2.0", "php-http/mock-client": "^1.2", "guzzlehttp/psr7": "^1.2", - "cache/array-adapter": "^0.4" + "cache/array-adapter": "^0.4", + "phpstan/phpstan": "^0.12.23" }, "autoload": { "psr-4": { "Github\\": "lib/Github/" } diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 00000000000..31545070d13 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,4 @@ +parameters: + level: 0 + paths: + - lib From a77c8850a5d1dbbd9a0921b31df3df13f30894d8 Mon Sep 17 00:00:00 2001 From: "Marcel Kuhmann (Koders)" Date: Thu, 7 May 2020 11:47:34 +0200 Subject: [PATCH 3/7] added phpstan-baseline --- phpstan-baseline.neon | 32 ++++++++++++++++++++++++++++++++ phpstan.neon.dist | 5 ++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 phpstan-baseline.neon diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 00000000000..8d1ff887815 --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,32 @@ +parameters: + ignoreErrors: + - + message: "#^PHPDoc tag @param has invalid value \\(\\$installationId An integration installation id\\)\\: Unexpected token \"\\$installationId\", expected type at offset 155$#" + count: 1 + path: lib/Github/Api/Apps.php + + - + message: "#^PHPDoc tag @param has invalid value \\(\\$org An organization\\)\\: Unexpected token \"\\$org\", expected type at offset 188$#" + count: 1 + path: lib/Github/Api/Apps.php + + - + message: "#^PHPDoc tag @param has invalid value \\(\\$owner the owner of a repository\\)\\: Unexpected token \"\\$owner\", expected type at offset 182$#" + count: 1 + path: lib/Github/Api/Apps.php + + - + message: "#^PHPDoc tag @param has invalid value \\(\\$repo the name of the repository\\)\\: Unexpected token \"\\$repo\", expected type at offset 230$#" + count: 1 + path: lib/Github/Api/Apps.php + + - + message: "#^PHPDoc tag @param has invalid value \\(\\$username\\)\\: Unexpected token \"\\$username\", expected type at offset 170$#" + count: 1 + path: lib/Github/Api/Apps.php + + - + message: "#^PHPDoc tag @param has invalid value \\(\\$installationId An integration installation id\\)\\: Unexpected token \"\\$installationId\", expected type at offset 161$#" + count: 1 + path: lib/Github/Api/Apps.php + diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 31545070d13..7d28b835456 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,4 +1,7 @@ +includes: + - phpstan-baseline.neon + parameters: - level: 0 + level: 3 paths: - lib From e395c86ceecc9d8d16c647ca7d281c062ac39a9c Mon Sep 17 00:00:00 2001 From: "Marcel Kuhmann (Koders)" Date: Thu, 7 May 2020 11:53:40 +0200 Subject: [PATCH 4/7] reset phpstan level to 0 --- phpstan-baseline.neon | 31 +------------------------------ phpstan.neon.dist | 2 +- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 8d1ff887815..eb4e8a8686e 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,32 +1,3 @@ parameters: ignoreErrors: - - - message: "#^PHPDoc tag @param has invalid value \\(\\$installationId An integration installation id\\)\\: Unexpected token \"\\$installationId\", expected type at offset 155$#" - count: 1 - path: lib/Github/Api/Apps.php - - - - message: "#^PHPDoc tag @param has invalid value \\(\\$org An organization\\)\\: Unexpected token \"\\$org\", expected type at offset 188$#" - count: 1 - path: lib/Github/Api/Apps.php - - - - message: "#^PHPDoc tag @param has invalid value \\(\\$owner the owner of a repository\\)\\: Unexpected token \"\\$owner\", expected type at offset 182$#" - count: 1 - path: lib/Github/Api/Apps.php - - - - message: "#^PHPDoc tag @param has invalid value \\(\\$repo the name of the repository\\)\\: Unexpected token \"\\$repo\", expected type at offset 230$#" - count: 1 - path: lib/Github/Api/Apps.php - - - - message: "#^PHPDoc tag @param has invalid value \\(\\$username\\)\\: Unexpected token \"\\$username\", expected type at offset 170$#" - count: 1 - path: lib/Github/Api/Apps.php - - - - message: "#^PHPDoc tag @param has invalid value \\(\\$installationId An integration installation id\\)\\: Unexpected token \"\\$installationId\", expected type at offset 161$#" - count: 1 - path: lib/Github/Api/Apps.php - + [] diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 7d28b835456..a49eb4c502e 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -2,6 +2,6 @@ includes: - phpstan-baseline.neon parameters: - level: 3 + level: 0 paths: - lib From 2f9e50792a4543cc58e7334a16e43d947c11220d Mon Sep 17 00:00:00 2001 From: Marcel Kuhmann Date: Thu, 7 May 2020 14:37:30 +0200 Subject: [PATCH 5/7] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c8b6f8f7a74..7bb93d8fcbb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ matrix: - php: 7.1 name: phpstan script: - - vendor/bin/phpstan analyse + - vendor/bin/phpstan analyse --no-progress before_install: - if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi; From 53d52c72ba67de7a97e161143c19cf1160199803 Mon Sep 17 00:00:00 2001 From: Marcel Kuhmann Date: Thu, 7 May 2020 14:38:09 +0200 Subject: [PATCH 6/7] remove phpstan baseline --- phpstan.neon.dist | 3 --- 1 file changed, 3 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index a49eb4c502e..31545070d13 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,6 +1,3 @@ -includes: - - phpstan-baseline.neon - parameters: level: 0 paths: From f90467ebd49590d2c8b0b7a7ac02c72a39f0b230 Mon Sep 17 00:00:00 2001 From: Marcel Kuhmann Date: Thu, 7 May 2020 14:38:23 +0200 Subject: [PATCH 7/7] remove phpstan baseline --- phpstan-baseline.neon | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 phpstan-baseline.neon diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon deleted file mode 100644 index eb4e8a8686e..00000000000 --- a/phpstan-baseline.neon +++ /dev/null @@ -1,3 +0,0 @@ -parameters: - ignoreErrors: - []