refactor(astrolabe): add PHP property types to fix Psalm errors

Add explicit property type declarations to IdpTokenRefresher,
CredentialsController, OAuthController, and McpServerClient classes.
This improves type safety and allows Psalm to properly infer types,
eliminating MissingPropertyType and many MixedMethodCall errors.

Also adds IClient import where needed and validates getSystemValue
returns to ensure string types before use.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-01-17 21:24:56 +01:00
parent 737f10f190
commit f0ade4ad28
5 changed files with 71 additions and 326 deletions
+10 -9
View File
@@ -12,6 +12,7 @@ use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
use OCP\IL10N;
@@ -32,15 +33,15 @@ use Psr\Log\LoggerInterface;
* - Confidential clients: PKCE + client_secret (defense in depth)
*/
class OAuthController extends Controller {
private $config;
private $session;
private $userSession;
private $urlGenerator;
private $tokenStorage;
private $logger;
private $l;
private $httpClient;
private $client;
private IConfig $config;
private ISession $session;
private IUserSession $userSession;
private IURLGenerator $urlGenerator;
private McpTokenStorage $tokenStorage;
private LoggerInterface $logger;
private IL10N $l;
private IClient $httpClient;
private McpServerClient $client;
public function __construct(
string $appName,