From 82ea679e86f690c55b559260a3e2da8f9cd6385b Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Mon, 8 Jun 2020 12:06:35 +0545 Subject: [PATCH] Adjust for phpstan 0.12.26 --- lib/private/legacy/image.php | 1 + lib/private/legacy/util.php | 1 + phpstan.neon | 23 ++++++++++------------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/lib/private/legacy/image.php b/lib/private/legacy/image.php index b6771031a9ae..94201d883326 100644 --- a/lib/private/legacy/image.php +++ b/lib/private/legacy/image.php @@ -87,6 +87,7 @@ public function __construct($imageRef = null, $logger = null) { } if (\OC_Util::fileInfoLoaded()) { + /* @phpstan-ignore-next-line */ $this->fileInfo = new finfo(FILEINFO_MIME_TYPE); } diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php index 138df207ce88..3c0ba5006a54 100644 --- a/lib/private/legacy/util.php +++ b/lib/private/legacy/util.php @@ -1340,6 +1340,7 @@ public static function clearOpcodeCache() { } // Zend Opcache if (\function_exists('accelerator_reset')) { + /* @phpstan-ignore-next-line */ accelerator_reset(); } // Opcache (PHP >= 5.5) diff --git a/phpstan.neon b/phpstan.neon index ac6ece496019..83f82a6120df 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,16 +1,6 @@ parameters: - bootstrap: %currentWorkingDirectory%/lib/base.php - autoload_directories: - - %currentWorkingDirectory%/apps/files_sharing/appinfo/Migrations - - %currentWorkingDirectory%/apps/dav/appinfo/Migrations - - %currentWorkingDirectory%/apps/federatedfilesharing/appinfo/Migrations - - %currentWorkingDirectory%/apps/files_external/appinfo/Migrations - - %currentWorkingDirectory%/apps/files_external/lib - - %currentWorkingDirectory%/apps/files_external/3rdparty - - %currentWorkingDirectory%/apps/files_sharing/appinfo/Migrations - - %currentWorkingDirectory%/apps/files_trashbin/appinfo/Migrations - - %currentWorkingDirectory%/core/Migrations - - %currentWorkingDirectory%/tests/lib/Util/User + bootstrapFiles: + - %currentWorkingDirectory%/lib/base.php excludes_analyse: - %currentWorkingDirectory%/core/templates/* - %currentWorkingDirectory%/core/routes.php @@ -22,6 +12,13 @@ parameters: - %currentWorkingDirectory%/apps/*/appinfo/routes.php - %currentWorkingDirectory%/apps/*/composer/* - %currentWorkingDirectory%/apps/*/3rdparty/* + - %currentWorkingDirectory%/apps/files_external/ajax/oauth2.php + - %currentWorkingDirectory%/apps/files_external/lib/Lib/Backend/DAV.php + - %currentWorkingDirectory%/apps/files_external/lib/Lib/Backend/Google.php + - %currentWorkingDirectory%/apps/files_external/lib/Lib/Backend/SMB.php + - %currentWorkingDirectory%/apps/files_external/lib/Lib/Backend/SMB_OC.php + - %currentWorkingDirectory%/apps/files_external/lib/Lib/Storage/Google.php + - %currentWorkingDirectory%/apps/files_external/lib/Lib/Storage/SMB.php - %currentWorkingDirectory%/apps/files_external/3rdparty/aws-sdk-php/Symfony/Component/ClassLoader/Tests/Fixtures/Apc/fallback/Namespaced/FooBar.php - %currentWorkingDirectory%/apps/files_sharing/ajax/shareinfo.php - %currentWorkingDirectory%/settings/templates/* @@ -32,7 +29,7 @@ parameters: ignoreErrors: - '#Undefined variable: \$OC_[a-zA-Z0-9\\_]+#' - '#Undefined variable: \$vendor#' - - '#Undefined variable: \$baseuri#' + - '#Instantiated class Test\\Util\\User\\Dummy not found.#' # errors below are to be addressed by own pull requests - non trivial changes required - '#Unsafe usage of new static().#' - '#Cannot instantiate interface OCP\\Files\\ObjectStore\\IObjectStore.#'