Skip to content

Latest commit

 

History

History
107 lines (91 loc) · 5.4 KB

File metadata and controls

107 lines (91 loc) · 5.4 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[2.3.0] - 2026-06-18

Added

  • Concurrent-safe progress storage: new Verseles\Progressable\Contracts\ProgressStore contract and Stores\CacheProgressStore default implementation that update each local entry independently under a cache lock when the cache driver supports atomic locks (Closes #21)
  • setLocalKey() now registers a stable local key when called before setOverallUniqueName()

Changed

  • Default cache-backed storage now uses the new CacheProgressStore, so per-local updates, renames, and resets are lock-aware when supported
  • setLocalProgress(), setLocalKey(), removeLocalFromOverall(), and resetOverallProgress() keep using custom setCustomSaveData() / setCustomGetData() callbacks unchanged; only the default cache path is routed through the new store

[2.2.0] - 2026-05-08

Added

  • Laravel 13 Support: Compatible with illuminate/* ^13 packages
  • Step-based Progress: Track progress by discrete steps
    • setTotalSteps(int $totalSteps) / getTotalSteps() - Define total steps
    • setStep(int $step) / getStep() - Set/get current step (auto-calculates percentage)
    • incrementStep(int $amount = 1) - Advance current step
  • Estimated Time Remaining:
    • getEstimatedTimeRemaining() - Local ETA in seconds based on elapsed time
    • getOverallEstimatedTimeRemaining() - Overall ETA using earliest start time across instances
  • Array Export: toArray() exports the full progress snapshot as an associative array
  • Metadata Merge: mergeMetadata(array $metadata) merges metadata without overwriting existing keys

Fixed

  • isOverallComplete() now accurately checks each individual instance instead of relying on the rounded average, preventing false positives
  • setLocalKey() data loss bug when called with the same name as the current key
  • setLocalKey() now preserves existing target data when renaming keys
  • makeSureLocalIsPartOfTheCalc() no longer overwrites existing cached progress to 0 when reinstantiating with the same localKey

[2.1.0] - 2025-03-XX

Changed

  • PHP requirement raised to 8.4
  • Added Laravel 12 and PHPUnit 12 support

[2.0.0] - 2025-01-XX

Added

  • Metadata Support: Store additional data with progress
    • setMetadata(array $metadata) - Set metadata array
    • getMetadata() - Get all metadata
    • addMetadata(string $key, mixed $value) - Add single metadata value
    • getMetadataValue(string $key, mixed $default) - Get single metadata value
  • Status Messages: Attach status messages to progress
    • setStatusMessage(?string $message) - Set status message
    • getStatusMessage() - Get status message
  • Event Callbacks: React to progress changes
    • onProgressChange(callable $callback) - Called on progress change with (float $new, float $old, static $instance)
    • onComplete(callable $callback) - Called when progress reaches 100% with (static $instance)
  • Progress Helpers:
    • incrementLocalProgress(float $amount = 1) - Increment/decrement progress
    • isComplete() - Check if local progress is 100%
    • isOverallComplete() - Check if overall progress is 100%
    • removeLocalFromOverall() - Remove instance from overall calculation
  • Precision Configuration:
    • setPrecision(int $precision) - Set decimal precision
    • getPrecision() - Get current precision
    • Configurable default precision via config/progressable.php
  • CI/CD Improvements:
    • PHPStan static analysis (level 5) with Larastan
    • Laravel Pint code style enforcement
    • Code coverage with pcov and Codecov integration
    • Parallel CI jobs for lint, analyse, and test
  • Documentation:
    • CHANGELOG.md with full history
    • CONTRIBUTING.md with guidelines
    • Comprehensive README with API tables
    • Codecov badge in README

Changed

  • getLocalProgress() now accepts ?int (null uses configured default precision)
  • getOverallProgress() now accepts ?int (null uses configured default precision)
  • Progress data now stores metadata and messages alongside progress value
  • Improved test suite with 35 tests and 70+ assertions

Fixed

  • README.md incorrect method names (updateLocalProgress -> setLocalProgress)
  • README.md incorrect imports (use Verseles\Progressable -> use Verseles\Progressable\Progressable)
  • Config comment referencing wrong class name (FullProgress -> Progressable)
  • Added missing return type to getOverallUniqueName()
  • Optimized setLocalKey() to avoid duplicate storage calls

[1.0.0] - Previous Release

Added

  • Initial release with core progress tracking functionality
  • setOverallUniqueName() - Set progress group identifier
  • setLocalProgress() - Update instance progress
  • getLocalProgress() - Get instance progress
  • getOverallProgress() - Get average progress of all instances
  • resetLocalProgress() - Reset instance to 0
  • resetOverallProgress() - Clear all progress data
  • setCustomSaveData() / setCustomGetData() - Custom storage callbacks
  • setTTL() / getTTL() - Cache TTL configuration
  • setPrefixStorageKey() - Custom cache key prefix
  • setLocalKey() / getLocalKey() - Custom instance identifiers
  • Laravel service provider with auto-discovery
  • Support for Laravel 11 and 12
  • PHP 8.4 requirement