Skip to content

Commit

Permalink
Remove the COM import
Browse files Browse the repository at this point in the history
  • Loading branch information
Hectorhammett committed May 29, 2024
1 parent e286724 commit 74d9bc3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Credentials/GCECredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Exception\ServerException;
use GuzzleHttp\Psr7\Request;
use \COM;

use InvalidArgumentException;

Expand Down Expand Up @@ -413,13 +412,13 @@ private static function detectResidencyLinux(string $productNameFile): bool

private static function detectResidencyWindows(string $registryProductKey): bool
{
if (!class_exists(COM::class)) {
if (!class_exists(\COM::class)) {
// the COM extension must be installed and enabled to detect Windows residency
// see https://www.php.net/manual/en/book.com.php
return false;
}

$shell = new COM('WScript.Shell');
$shell = new \COM('WScript.Shell');
$productName = $shell->regRead($registryProductKey);

Check failure on line 422 in src/Credentials/GCECredentials.php

View workflow job for this annotation

GitHub Actions / PHPStan Static Analysis

Call to an undefined method COM::regRead().

if ($productName !== self::WINDOWS_PRODUCT_NAME) {
Expand Down

0 comments on commit 74d9bc3

Please sign in to comment.