Skip to content

Conversation

@anktd
Copy link
Collaborator

@anktd anktd commented Dec 30, 2025

This PR fixes #403 by adding 2 things:

  1. Initialize $icons_src = [] -> prevents undefined variable if loop never runs
  2. Early return if error -> checks for error key or empty array before iterating

Tested both scenarios:

  1. Without API key - no more warnings/fatal errors
  2. With API key - icons should still work normally

Added unit test for get_icons error handling

  • Test error response when API key not configured
  • Test empty response handling
  • Test valid cryptos (BTC + USDT)
  • Test single crypto scenarios (BTC only, USDT only)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHP Fatal Error when API key not configured (php 8.x)

1 participant