PHPackages                             serendipity\_hq/component-then-when - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. serendipity\_hq/component-then-when

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

serendipity\_hq/component-then-when
===================================

A library to calculate the time of next retry in apps that need to be fault tolerant and retry failed attempts of doing something.

2.0.2(1mo ago)2174.8k↑83.3%2MITPHPPHP ^8.2CI passing

Since Feb 11Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Aerendir/component-then-when)[ Packagist](https://packagist.org/packages/serendipity_hq/component-then-when)[ Docs](https://github.com/Aerendir/component-then-when)[ RSS](/packages/serendipity-hq-component-then-when/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (19)Versions (27)Used By (2)

 [ ![](https://camo.githubusercontent.com/5041251627a7ec1bf9335a20531d818d198f5315fc6e12d88c4694c9dcfd5bc7/687474703a2f2f7777772e736572656e64697069747968712e636f6d2f6173736574732f6f70656e2d736f757263652d70726f6a656374732f4c6f676f2d536572656e64697069747948512d49636f6e2d546578742d507572706c652e706e67) ](http://www.serendipityhq.com)

Serendipity HQ Then When
========================

[](#serendipity-hq-then-when)

A library to calculate the time of next retry in apps that needs to be fault-tolerant and retry failed attempts of doing something.

 [![](https://camo.githubusercontent.com/312dd5f0951211ec405209b09742b6cd6033ecd7054d7180f4ddaad8d910def2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736572656e6469706974795f68712f636f6d706f6e656e742d7468656e2d7768656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/Aerendir/component-then-when/releases) [![](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT) [![](https://camo.githubusercontent.com/4dc2ed25e8e289efa92624215fa8fd6f9827097ff61b9adf3a8227acd7fa969b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736572656e6469706974795f68712f636f6d706f6e656e742d746578742d6d61747269783f636f6c6f723d253233383839324246267374796c653d666c61742d737175617265266c6f676f3d706870)](https://github.com/Aerendir/component-text-matrix/releases)

Current Status
--------------

[](#current-status)

[![Coverage](https://camo.githubusercontent.com/c7b89efee0d71ab4decac3d34338cf5ec17084ad033aef6d0b3fd6b76f5861e4/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d416572656e6469725f636f6d706f6e656e742d7468656e2d7768656e266d65747269633d636f766572616765)](https://sonarcloud.io/dashboard?id=Aerendir_component-then-when)[![Maintainability Rating](https://camo.githubusercontent.com/f9859c04a1ff96ba5bdf0016da7e4225ed903d274b2e80c28d017b5e4be030c5/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d416572656e6469725f636f6d706f6e656e742d7468656e2d7768656e266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/dashboard?id=Aerendir_component-then-when)[![Quality Gate Status](https://camo.githubusercontent.com/37f2e8a90afb2fc82ec87da839e653ba9eaa19900cfe7ad884719f0cc6e81236/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d416572656e6469725f636f6d706f6e656e742d7468656e2d7768656e266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/dashboard?id=Aerendir_component-then-when)[![Reliability Rating](https://camo.githubusercontent.com/2988a4ecef22b4ad69b330ae6ff765ef4dd96fdbd57b6d6d11643c10137f2df7/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d416572656e6469725f636f6d706f6e656e742d7468656e2d7768656e266d65747269633d72656c696162696c6974795f726174696e67)](https://sonarcloud.io/dashboard?id=Aerendir_component-then-when)[![Security Rating](https://camo.githubusercontent.com/4fd453e09c38039d906b2b3093fab4e262b46bfa1e014a801d07ffc215dbd1c3/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d416572656e6469725f636f6d706f6e656e742d7468656e2d7768656e266d65747269633d73656375726974795f726174696e67)](https://sonarcloud.io/dashboard?id=Aerendir_component-then-when)[![Technical Debt](https://camo.githubusercontent.com/d2c8eca63641b6a43ca6c4587d9bf8d31f27679e5303e24aa45d26c6331d02e5/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d416572656e6469725f636f6d706f6e656e742d7468656e2d7768656e266d65747269633d7371616c655f696e646578)](https://sonarcloud.io/dashboard?id=Aerendir_component-then-when)[![Vulnerabilities](https://camo.githubusercontent.com/330cb6d884c74caf2ee180616cde900a262949e2ba0f534cbe41ff17ac5a8b47/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d416572656e6469725f636f6d706f6e656e742d7468656e2d7768656e266d65747269633d76756c6e65726162696c6974696573)](https://sonarcloud.io/dashboard?id=Aerendir_component-then-when)

[![PHPStan](https://github.com/Aerendir/component-then-when/workflows/PHPStan/badge.svg)](https://github.com/Aerendir/component-then-when/actions?query=branch%3Adev)[![PSalm](https://github.com/Aerendir/component-then-when/workflows/PSalm/badge.svg)](https://github.com/Aerendir/component-then-when/actions?query=branch%3Adev)[![PHPUnit](https://github.com/Aerendir/component-then-when/workflows/PHPunit/badge.svg)](https://github.com/Aerendir/component-then-when/actions?query=branch%3Adev)[![Composer](https://github.com/Aerendir/component-then-when/workflows/Composer/badge.svg)](https://github.com/Aerendir/component-then-when/actions?query=branch%3Adev)[![PHP CS Fixer](https://github.com/Aerendir/component-then-when/workflows/PHP%20CS%20Fixer/badge.svg)](https://github.com/Aerendir/component-then-when/actions?query=branch%3Adev)[![Rector](https://github.com/Aerendir/component-then-when/workflows/Rector/badge.svg)](https://github.com/Aerendir/component-then-when/actions?query=branch%3Adev)

[![codecov](https://camo.githubusercontent.com/a02c9206f3428ea0827d215b61e997b251db42cda8f3186af06fe76ff1777f90/68747470733a2f2f636f6465636f762e696f2f67682f416572656e6469722f636f6d706f6e656e742d7468656e2d7768656e2f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d57394648333932463733)](https://codecov.io/gh/Aerendir/component-then-when)

[![CodeCov SunBurst](https://camo.githubusercontent.com/656cf057192e35003d7997ba0a9499494b040ef48e7fec00d927e00b3d0c9c25/68747470733a2f2f636f6465636f762e696f2f67682f416572656e6469722f636f6d706f6e656e742d7468656e2d7768656e2f6272616e63682f6d61737465722f6772617068732f73756e62757273742e737667)](https://codecov.io/gh/Aerendir/component-then-when)[![CodeCov Tree](https://camo.githubusercontent.com/6e17212d038dd6c2be94dfd0fada8a6783414571d3d6a83463126ab4b6c21092/68747470733a2f2f636f6465636f762e696f2f67682f416572656e6469722f636f6d706f6e656e742d7468656e2d7768656e2f6272616e63682f6d61737465722f6772617068732f747265652e737667)](https://codecov.io/gh/Aerendir/component-then-when)[![CodeCov I Cicle](https://camo.githubusercontent.com/2211d90a0e48566fbf6f879c4593c35f1f3f10079e471d00da6193cb3615f218/68747470733a2f2f636f6465636f762e696f2f67682f416572656e6469722f636f6d706f6e656e742d7468656e2d7768656e2f6272616e63682f6d61737465722f6772617068732f696369636c652e737667)](https://codecov.io/gh/Aerendir/component-then-when)

---

###  **Do you like this library?**
 **[LEAVE A ★](#js-repo-pjax-container)**

[](#----do-you-like-this-library----leave-a-)

 or run
 `composer global require symfony/thanks && composer thanks`
 to say thank you to all libraries you use in your current project, this included!

---

Install Serendipity HQ Text Matrix via Composer
-----------------------------------------------

[](#install-serendipity-hq-text-matrix-via-composer)

```
$ composer require serendipity_hq/component-then-when

```

This library follows the  versioning conventions.

Documentation
=============

[](#documentation)

You can read how to use the SerendipityHQ ThenWhen library in the [documentation](docs/Strategies.md).

---

###  **Do you like this library?**
 **[LEAVE A ★](#js-repo-pjax-container)**

[](#----do-you-like-this-library----leave-a--1)

 or run
 `composer global require symfony/thanks && composer thanks`
 to say thank you to all libraries you use in your current project, this included!

---

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance91

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity86

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~332 days

Recently: every ~383 days

Total

11

Last Release

51d ago

Major Versions

0.1.0 → 1.0.02017-03-07

1.1.4 → 2.0.02023-12-02

PHP version history (5 changes)0.1.0PHP ~7.0

1.1.0PHP ^7.0||^7.1

1.1.2PHP ^7.3|^8.0

1.1.3PHP ^7.4|^8.0

2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd91a553e180dea3a2e726643704e33a1d7e4c818b65ead1516ddf2f4e23ea43?d=identicon)[Aerendir](/maintainers/Aerendir)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (648 commits)")[![kodiakhq[bot]](https://avatars.githubusercontent.com/in/29196?v=4)](https://github.com/kodiakhq[bot] "kodiakhq[bot] (580 commits)")[![Aerendir](https://avatars.githubusercontent.com/u/1968622?v=4)](https://github.com/Aerendir "Aerendir (237 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (4 commits)")[![leonardofalanga](https://avatars.githubusercontent.com/u/20907369?v=4)](https://github.com/leonardofalanga "leonardofalanga (1 commits)")

###  Code Quality

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/serendipity-hq-component-then-when/health.svg)

```
[![Health](https://phpackages.com/badges/serendipity-hq-component-then-when/health.svg)](https://phpackages.com/packages/serendipity-hq-component-then-when)
```

###  Alternatives

[ashallendesign/short-url

A Laravel package for creating shortened URLs for your web apps.

1.4k1.9M4](/packages/ashallendesign-short-url)[laragraph/utils

Utilities for using GraphQL with Laravel

2113.8M7](/packages/laragraph-utils)[intervention/zodiac

Zodiac Sign Calculator

58191.7k](/packages/intervention-zodiac)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[solspace/craft-calendar

The most powerful event management and calendaring plugin!

1830.8k1](/packages/solspace-craft-calendar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
