fix(astrolabe): resolve Psalm type errors in PDF preview code

Fix Psalm static analysis errors:
- Add return type annotations to refresh callback closures
- Use strict null comparisons instead of truthy/falsy checks
- Cast response body to string for json_decode
- Add type annotation for decoded JSON data
- Update psalm-baseline.xml to remove fixed issues

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-01-26 20:19:23 +01:00
co-authored by Claude Opus 4.5
parent d5544a7731
commit c09ebe99cc
3 changed files with 26 additions and 36 deletions
-17
View File
@@ -13,13 +13,6 @@
<code><![CDATA[$result['query_coords']]]></code>
<code><![CDATA[$webhook['eventFilter']]]></code>
</InvalidArrayOffset>
<MissingClosureReturnType>
<code><![CDATA[function (string $refreshToken) {]]></code>
<code><![CDATA[function (string $refreshToken) {]]></code>
<code><![CDATA[function (string $refreshToken) {]]></code>
<code><![CDATA[function (string $refreshToken) {]]></code>
<code><![CDATA[function (string $refreshToken) {]]></code>
</MissingClosureReturnType>
<MixedArgument>
<code><![CDATA[!empty($eventConfig['filter']) ? $eventConfig['filter'] : null]]></code>
<code><![CDATA[$accessToken]]></code>
@@ -62,16 +55,6 @@
<code><![CDATA[$webhook['id']]]></code>
</PossiblyUndefinedArrayOffset>
<RiskyTruthyFalsyComparison>
<code><![CDATA[!$accessToken]]></code>
<code><![CDATA[!$accessToken]]></code>
<code><![CDATA[!$accessToken]]></code>
<code><![CDATA[!$accessToken]]></code>
<code><![CDATA[!$accessToken]]></code>
<code><![CDATA[!$newTokenData]]></code>
<code><![CDATA[!$newTokenData]]></code>
<code><![CDATA[!$newTokenData]]></code>
<code><![CDATA[!$newTokenData]]></code>
<code><![CDATA[!$newTokenData]]></code>
<code><![CDATA[!$token]]></code>
<code><![CDATA[empty($webhook['eventFilter'])]]></code>
</RiskyTruthyFalsyComparison>