Skip to content

Releases: tigusigalpa/lunarcrush-php

Release list

v1.1.0

Choose a tag to compare

@tigusigalpa tigusigalpa released this 10 Sep 20:09

Release Notes — v1.1.0

This release improves SDK safety, configuration behavior, and project automation.

Fixed

  • URL-encode all caller-supplied API path segments across Coins, Topics, Categories, Creators, Stocks, Searches, and AI resources.
  • Prevent reserved characters such as /, ?, and # from altering the requested API endpoint.
  • Preserve explicit 0 values from environment variables for retry configuration:
    • LUNARCRUSH_RETRY_ATTEMPTS=0
    • LUNARCRUSH_RETRY_DELAY=0

Added

  • Comprehensive regression coverage for dynamic API path parameters across all resource groups.
  • Tests for zero-valued retry settings loaded from environment variables.
  • GitHub Actions workflows for:
    • CI validation, syntax checks, and tests
    • PHP 8.1–8.4 compatibility testing
    • Xdebug coverage reports with Clover artifacts
    • Codecov uploads
    • CodeQL security analysis
  • New CI, test, coverage, CodeQL, Codecov, and release badges in the README.
  • Codecov configuration with project and patch coverage status checks.

Changed

  • Documented the CI-tested PHP range: PHP 8.1 through 8.4.

Verification

  • PHPUnit: 14 tests, 124 assertions.
  • Composer metadata validation passes.

v1.0.0

Choose a tag to compare

@tigusigalpa tigusigalpa released this 01 Jul 14:52

v1.0.0 — Initial Release 🚀

The first stable release of tigusigalpa/lunarcrush-php — a modern, framework-agnostic PHP SDK for the LunarCrush API v4. Bring real-time crypto & stock social intelligence into any PHP or Laravel project through a fluent, strongly-typed interface.

✨ Highlights

  • Framework-agnostic core — works in any PHP 8.1+ project, with an optional Laravel 10–13 integration layer on top.
  • Bring your own HTTP client — Guzzle ships by default, but any PSR-18 client (Symfony HttpClient, HTTPlug, …) drops straight in via the constructor.
  • Fluent query builder — chain sortBy(), limit(), page(), desc()/asc(), interval(), bucket(), start(), end(), withParam(), and terminate with get() (hydrated) or raw() (decoded JSON).
  • Strongly typed, readonly DTOs — responses hydrate into real objects, and every DTO keeps the untouched payload on its raw property so new API fields are always reachable.
  • Typed, iterable collections — implement Countable, IteratorAggregate, and ArrayAccess, with first(), last(), filter(), map(), toArray(), and more.
  • Automatic rate-limit handling — exponential-backoff retries on HTTP 429, honoring the Retry-After header when present.
  • Clean exception hierarchyLunarCrushExceptionApiExceptionRateLimitException / UnauthorizedException / NotFoundException.

📦 What's included

Full API v4 coverage across nine resource groups:
CoinsResource, TopicsResource, CategoriesResource, CreatorsResource, PostsResource, StocksResource, SearchesResource, SystemResource, and AiResource.

DTOs: CoinDto, TopicDto, StockDto, CreatorDto, PostDto, TimeSeriesPointDto, SearchDto, CategoryDto.

Collections: CoinCollection, TopicCollection, StockCollection, CreatorCollection, PostCollection, CategoryCollection, SearchCollection, TimeSeriesCollection.

Laravel integration: auto-discovered LunarCrushServiceProvider, a LunarCrush facade, and a publishable config/lunarcrush.php wired to your .env.

Enum-safe networks: a Network enum (Twitter, YouTube, Instagram, Reddit, TikTok).

✅ Quality

  • PHPUnit 10 test suite covering successful responses, DTO/collection hydration, the rate-limit retry loop, exception mapping, and — via orchestra/testbench — the Laravel service provider and facade.
  • All HTTP responses are mocked with Guzzle's MockHandler, so the suite runs fully offline.

📥 Installation

composer require tigusigalpa/lunarcrush-php