endurance / workout-fit
Explicit FIT Workout interpretation into immutable Endurance Workout prescriptions
v0.2.0
2026-11-23 20:54 UTC
Requires
- php: ^8.5
- endurance/fit: ^0.2.0
- endurance/workout: ^0.2.0
Requires (Dev)
- phpunit/phpunit: ^12.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-23 20:58:05 UTC
README
Interpret a FIT Workout as an Endurance Workout prescription for PHP 8.5.
composer require endurance/workout-fit
use Endurance\WorkoutFit\FitWorkoutReader; $mapping = FitWorkoutReader::standard($profileSet)->read($input, $progress); $prescription = $mapping->workout;
- Supply a compatible generated FIT Profile; none is bundled or inferred. The reader retains input ownership with the caller and returns only after all member CRCs and final EOF validate. Progress callbacks support cancellation.
- Supported instructions include time, distance, manual completion, fixed nested repeats and compatible absolute/relative targets. Open-ended/conditional repeats and unsupported targets are rejected rather than approximated.
- Default bounds are 4096 physical steps and 65536 data messages. Repeat traversal stays bounded without expanding repetitions. The result contains a prescription value and bounded diagnostics.
- Profile incompatibility raises
FitWorkoutProfileUnavailable; malformed Workout structure raisesInvalidFitWorkout; unsupported instructions/limits raiseUnsupportedFitWorkout. Protocol/CRC failures retain their FIT exceptions.
Types in Internal and elements marked @internal are not public API.
License: MPL-2.0.