From 877386be3a0bd374e347a50abfbad3bdeb30ba6d Mon Sep 17 00:00:00 2001 From: Jeroen Thora Date: Sun, 10 May 2020 21:28:56 +0200 Subject: [PATCH 1/3] Phpstan level 2 fixes --- lib/Github/Api/Apps.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Github/Api/Apps.php b/lib/Github/Api/Apps.php index 4985928a8f5..7a98e731ee8 100644 --- a/lib/Github/Api/Apps.php +++ b/lib/Github/Api/Apps.php @@ -58,7 +58,7 @@ public function findInstallations() * * @link https://developer.github.com/v3/apps/#get-an-installation * - * @param $installationId An integration installation id + * @param int $installationId An integration installation id * * @return array */ @@ -74,7 +74,7 @@ public function getInstallation($installationId) * * @link https://developer.github.com/v3/apps/#get-an-organization-installation * - * @param $org An organization + * @param string $org An organization * * @return array */ @@ -90,8 +90,8 @@ public function getInstallationForOrganization($org) * * @link https://developer.github.com/v3/apps/#get-a-repository-installation * - * @param $owner the owner of a repository - * @param $repo the name of the repository + * @param string $owner the owner of a repository + * @param string $repo the name of the repository * * @return array */ @@ -107,7 +107,7 @@ public function getInstallationForRepo($owner, $repo) * * @link https://developer.github.com/v3/apps/#get-a-user-installation * - * @param $username + * @param string $username * * @return array */ @@ -123,7 +123,7 @@ public function getInstallationForUser($username) * * @link https://developer.github.com/v3/apps/#delete-an-installation * - * @param $installationId An integration installation id + * @param int $installationId An integration installation id */ public function removeInstallation($installationId) { From 92cad4dc69cb2177690d8d7a286989bd3e32184b Mon Sep 17 00:00:00 2001 From: Jeroen Thora Date: Sun, 10 May 2020 21:29:56 +0200 Subject: [PATCH 2/3] Phpstan level 4 fixes --- lib/Github/Api/Repository/Assets.php | 4 ++-- lib/Github/HttpClient/Plugin/Authentication.php | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Github/Api/Repository/Assets.php b/lib/Github/Api/Repository/Assets.php index 899b2db34c0..56db6843de5 100644 --- a/lib/Github/Api/Repository/Assets.php +++ b/lib/Github/Api/Repository/Assets.php @@ -67,8 +67,8 @@ public function show($username, $repository, $id) */ public function create($username, $repository, $id, $name, $contentType, $content) { - if (!defined('OPENSSL_TLSEXT_SERVER_NAME') || !OPENSSL_TLSEXT_SERVER_NAME) { - throw new ErrorException('Asset upload support requires Server Name Indication. This is not supported by your PHP version. See http://php.net/manual/en/openssl.constsni.php.'); + if (!defined('OPENSSL_TLSEXT_SERVER_NAME') || OPENSSL_TLSEXT_SERVER_NAME == 0) { + throw new ErrorException('Asset upload support requires Server Name Indication. This is not supported by your PHP version. See https://www.php.net/manual/en/openssl.constsni.php.'); } // Asset creation requires a separate endpoint, uploads.github.com. diff --git a/lib/Github/HttpClient/Plugin/Authentication.php b/lib/Github/HttpClient/Plugin/Authentication.php index 0ab09ab20ba..6c0f98f1f73 100644 --- a/lib/Github/HttpClient/Plugin/Authentication.php +++ b/lib/Github/HttpClient/Plugin/Authentication.php @@ -79,7 +79,6 @@ public function doHandleRequest(RequestInterface $request, callable $next, calla default: throw new RuntimeException(sprintf('%s not yet implemented', $this->method)); - break; } return $next($request); From cc3972b4d005b81ab4f10021afe480b0d48b64e8 Mon Sep 17 00:00:00 2001 From: Jeroen Thora Date: Sun, 10 May 2020 21:28:56 +0200 Subject: [PATCH 3/3] Use phpstan level 4 as default --- phpstan.neon.dist | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 31545070d13..1c57e1fef7e 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,4 +1,4 @@ parameters: - level: 0 - paths: - - lib + level: 4 + paths: + - lib