Skip to content

Instantly share code, notes, and snippets.

@rlerdorf
Created November 6, 2025 23:23
Show Gist options
  • Select an option

  • Save rlerdorf/33ce5759c5b9e538c04ac52d7114a4df to your computer and use it in GitHub Desktop.

Select an option

Save rlerdorf/33ce5759c5b9e538c04ac52d7114a4df to your computer and use it in GitHub Desktop.
Phan Demo - PHP 84, Phan v6-dev
<?php
/** @phan-file-suppress PhanUnusedPublicNoOverrideMethodParameter,PhanUnreferencedClass,PhanUnusedVariable */
class Iam { }
class GCECredentials {
/**
* @param Iam $iam [optional] An IAM instance.
* @param string|string[] $scope [optional] the scope of the access request,
* expressed either as an array or as a space-delimited string.
* @param string $targetAudience [optional] The audience for the ID token.
* @param string $quotaProject [optional] Specifies a project to bill for access
* @param string $serviceAccountIdentity [optional] Specify a service
* account identity name to use instead of "default".
* @param string $universeDomain [optional] Specify a universe domain to use
* instead of fetching one from the metadata server.
*
*/
public function __construct(
?Iam $iam = null,
$scope = null,
$targetAudience = null,
$quotaProject = null,
$serviceAccountIdentity = null,
?string $universeDomain = null
) {
'@phan-debug-var $quotaProject';
}
}
function foo(?string $quota_project): void {
$fetcher = new GCECredentials(scope: "foo", quotaProject: $quota_project);
}
foo(null);
{
"phpVersion": "84",
"phanVersion": "v6-dev",
"astVersion": "1.1.3",
"plugins": "0",
"fileOrder": [
"general.php"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment