Skip to content

fix(psalm): resolve FastForex Psalm errors after the historical-rates refactor - #179

Merged
florianv merged 2 commits into
masterfrom
fix/psalm-fastforex
May 16, 2026
Merged

fix(psalm): resolve FastForex Psalm errors after the historical-rates refactor#179
florianv merged 2 commits into
masterfrom
fix/psalm-fastforex

Conversation

@florianv

Copy link
Copy Markdown
Owner

No description provided.

florianv added 2 commits May 16, 2026 10:23
… refactor

- Use the Exchanger\Contract\CurrencyPair interface in processResponse() so the parent-type returned by ExchangeRateQuery::getCurrencyPair() is accepted (ArgumentTypeCoercion).
- Guard the mixed values returned by StringUtil::jsonToArray() with is_string() before passing them to Exception::__construct() and DateTime::__construct() (MixedArgument).
- Drop the unused Exchanger\CurrencyPair and Exchanger\Exception\UnsupportedCurrencyPairException imports (no longer referenced after the refactor).
- Refresh psalm-baseline.xml: replace the stale MissingOverrideAttribute entry for the removed getExchangeRate() method with entries for getLatestExchangeRate / getHistoricalExchangeRate, and drop the now-unused MixedArgument and ParamNameMismatch baselines.
… baselines

- Replace the chained ?? assignment (which still produced a mixed type) with an explicit isset+is_string ladder so Psalm can narrow each branch before passing the value to DateTime::__construct.
- Drop the two MixedArgument baseline entries for $this->options[self::API_KEY_OPTION]: those call sites no longer trigger MixedArgument, and keeping the entries was producing UnusedBaselineEntry failures.
@florianv
florianv merged commit e28fdff into master May 16, 2026
6 checks passed
@florianv
florianv deleted the fix/psalm-fastforex branch May 16, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant