Skip to content

Improve README and discoverability#153

Merged
florianv merged 4 commits intomasterfrom
docs/improve-readme-and-discoverability
Apr 29, 2026
Merged

Improve README and discoverability#153
florianv merged 4 commits intomasterfrom
docs/improve-readme-and-discoverability

Conversation

@florianv
Copy link
Copy Markdown
Owner

@florianv florianv commented Apr 29, 2026

What changed

README

  • Rewrote the README around a clearer value proposition with new sections (What is Swap?, When should you use Swap?, Why not call an exchange rate API directly?, Which package should I use?, Common use cases).
  • Replaced the provider name-drops in the intro and quickstart with a neutral default (european_central_bank, free, no API key). The example shows // EUR → USD exchange rate followed by an explicit $amount * $rate->getValue() step so the conversion is unambiguous.
  • Reorganized the Providers table into Public providers (no API key) and Commercial providers (require an API key) groups, alphabetical within each. Added an Identifier column with the string actually passed to Builder::add(), sourced from Exchanger\Service\Registry.
  • Simplified the Fixer rows: now two clearly labeled entries (apilayer_fixer for "Fixer (APILayer)", fixer for "Fixer (direct)").
  • Fixed the stale FlorianvSwapBundle links (they now point to florianv/symfony-swap).
  • Fixed the Ukranie typo.
  • Added a cross-link block to Exchanger, Laravel Swap, and Symfony Swap.
  • Added light, professional emojis to top-level section titles for visual scanning. Paragraphs, tables, and code blocks remain plain.

doc/readme.md

  • Replaced the legacy intro block at the top of the doc with a short About this documentation section that frames the doc against the README.
  • Modernized the Installation example (PSR-18 first via symfony/http-client, Guzzle 7 alternative noted; php-http/curl-client is no longer the recommended path).
  • Neutralized the Configuration example (european_central_bank as the default, no commercial provider name-drops).
  • Added an explicit How the fallback chain works paragraph (skip on unsupported pair, retry on thrown exception, ChainException after all collected exceptions).
  • Renamed the Rate provider subsection to Inspecting the rate and listed every method exposed on the returned ExchangeRate.
  • Added a minimal Symfony Cache PSR-16 example before the existing Predis + PSR-6/PSR-16 bridge example, so the simple path is visible first.
  • Updated the HTTP request caching example to use Guzzle 7 instead of the EOL guzzle6-adapter.
  • Replaced the verbose Supported Services code dump with a focused Provider configuration table that maps each commercial identifier to its required option (api_key, access_key, app_id, token, api-key) and optional flags (enterprise, paid). Public providers and the array fixture are documented separately. The full provider list with capabilities now lives in the README's Providers table; the doc points to it instead of duplicating it.
  • Added a short FAQ (what happens when every provider fails, can I use Swap without an API key, how do I cache rates, how do I disable cache for a single query, how do I add my own provider, where is the full provider list).
  • Added light, professional emojis to top-level section titles, matching the README.

composer.json

  • Updated description and Packagist keywords (currency conversion, currency conversion library, php currency conversion, exchange rate api, forex, forex api).

Why

  • Clearer value proposition on the first screen.
  • Quickstart that works end-to-end without an external account.
  • Searchable terms (currency conversion, exchange rate API, forex API, PHP currency conversion) are now present in headings, the opening paragraph, and the Packagist metadata.
  • Short factual sections are easy for both developers and LLMs to reference.
  • The doc no longer duplicates the README's Providers table; it focuses on the parts the README cannot cover (per-provider config keys, fallback semantics, custom service, FAQ).

What did NOT change

  • No runtime code changes. Public API of Swap\Swap and Swap\Builder is unchanged.
  • No changes to src/, tests/, CI, Psalm config, or php-cs-fixer config.
  • The CHANGELOG was not touched (this is doc work, not a release).

Refresh the README around a clearer value proposition, with new sections
that answer 'What is Swap?', 'When should you use Swap?', 'Why not call
an exchange rate API directly?', and 'Which package should I use?'.
Replace the introductory provider name-drops and quickstart with a
neutral default (european_central_bank, free, no API key) so the example
works end-to-end without external accounts. Reorganize the providers
table into Public vs Commercial groups and add the registry-identifier
column so the string passed to Builder::add() is documented. Simplify
the Fixer rows.

Fix the stale FlorianvSwapBundle links (now florianv/symfony-swap) and
the 'Ukranie' typo. Cross-link to Exchanger, Laravel Swap, and Symfony
Swap.

Update composer.json description and keywords for Packagist SEO. No
runtime changes; public API of Swap and Builder is unchanged.
Rewrite doc/readme.md around clearer structure: 'About this documentation'
intro, modernized installation (PSR-18 first, Guzzle 7 alternative),
neutralized configuration examples (european_central_bank as default),
explicit 'How the fallback chain works' paragraph (skip / retry /
ChainException), a minimal Symfony Cache PSR-16 example before the Predis
+ bridge example, and an updated HTTP request caching example using
Guzzle 7 instead of the EOL guzzle6-adapter.

Replace the legacy 'Supported Services' code dump with a focused
'Provider configuration' table that maps each commercial identifier to
its required option (api_key, access_key, app_id, token, api-key) and
optional flags (enterprise, paid). Public providers and the array
fixture are documented separately. The full provider list with
capabilities now lives in the README's Providers table; the doc points
to it instead of duplicating it.

Add a short FAQ at the end (what happens when every provider fails, can
I use Swap without an API key, how do I cache rates, etc.) for faster
scanning and easier reference.

Add light, professional emojis to section titles in both README.md and
doc/readme.md to aid visual scanning. Emojis are restricted to top-level
sections; paragraphs, code blocks, and tables remain plain.

No runtime changes; documentation only.
- Rewrite the 'Why not call an exchange rate API directly?' section
  with a clearer framing (single API vs Swap), shorter bullets, and
  a closing note that calling a single API can be enough for simple
  cases.
- Add a one-line onboarding sentence at the top of the Providers
  section ('start with a single provider, then add others as needed').
- Reduce repetition of the '30 providers' phrasing in the intro and
  in the 'What is Swap?' section; the count is kept in the tagline
  and in the Providers section where it is most informative.
- Add light emojis to the remaining top-level sections (Sponsorship,
  Contributing, License, Credits) for consistency with the rest of
  the README.
Add three orientation sections at the top of the doc so a developer or
search engine landing on doc/readme.md directly gets the same value
proposition as the README:

- 'What is Swap?' (factual, ~5 lines)
- 'When should you use Swap?' (factual, ~3 lines)
- 'Why not call an exchange rate API directly?' (mirrors the README
  verbatim so the canonical phrasing is consistent across both surfaces)

Drop the 'About this documentation' meta section; its orientation role
is taken over by the three sections above.

Compact 'Per-query options' from three sub-headings (cache_ttl, cache,
cache_key_prefix) into a single options table plus one example block.
Same information, denser and easier to scan.

Trim the prose around the HTTP request caching example.

Add one FAQ entry: 'How does Swap relate to Exchanger?' that points to
the README's 'Which package should I use?' section, so the doc covers
the ecosystem map without duplicating it.

Update the index to reflect the new section order and the emoji-prefixed
anchors.

Net length: roughly the same as before; structure is clearer, the doc
stands on its own for a discovery-stage reader, and vocabulary is
aligned with the README ('currency conversion library', 'exchange rate
provider', 'fallback chain', 'caching').
@florianv florianv merged commit 65b4e07 into master Apr 29, 2026
6 checks passed
@florianv florianv deleted the docs/improve-readme-and-discoverability branch April 29, 2026 18:49
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