Skip to content

Maintenance: fix duration bugs, update dependencies, modernise CI - #16

Merged
sifex merged 1 commit into
mainfrom
chore/maintenance-update
Aug 15, 2026
Merged

sifex merged 1 commit into
mainfrom
chore/maintenance-update

Conversation

@sifex

@sifex sifex commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

Full maintenance pass: fixes the two open bug reports, updates all dependencies to current majors, adds static analysis that was referenced but missing, and modernises CI.

Bug fixes — closes #4 and #6

Both issues reported SLA durations missing time on the final day (e.g. 16:58 Fri → 09:01 Mon returned 2 min instead of 3 min 1 sec). Root cause: the per-day iteration in SLA::get_current_duration() and the agenda period generation in Agenda\Weekly::toPeriods() were anchored at the start time-of-day, so when the end time-of-day was earlier than the start time-of-day, the end date was never iterated and its SLA time was dropped.

  • src/SLA.php — anchor the daily iteration at startOfDay() and keep the real subject bounds separate for the overlap min/max logic
  • src/Agenda/Weekly.php — same day-anchoring fix for agenda period generation
  • tests/SLATest.php — regression tests for both reported scenarios

Verified: issue #4 now returns 379 min (was 77), issue #6 returns 181 s (was 120).

Dependencies

  • PHP floor raised to ^8.3 (8.1 is EOL, 8.2 EOL Dec 2026) — unlocks the current toolchain
  • nesbot/carbon ^2 → ^3
  • illuminate/collections → ^11|^12|^13
  • Dev: pestphp/pest ^1 → ^4 (PHP 8.4/8.5 compatible — Pest 1 crashes on 8.5), phpstan/phpstan ^1 → ^2, laravel/pint ^1.30, spatie/invade ^2, spatie/pest-plugin-test-time ^2.2; removed direct phpunit/phpunit (bundled by Pest)
  • npm: vitepress 1.6.4, tailwindcss/@tailwindcss/vite 4.3.3, vue 3.5.41
  • Fixed the broken test-coverage composer script (missing space: pest--coverage-clover)

Static analysis & style

  • Added phpstan.neon.dist (CI workflow referenced it but it didn't exist) and fixed all 50 level-8 findings, including a latent bug (Weekly::addTimePeriods over-flattened period pairs) and dead code calling a never-defined method
  • Migrated phpunit.xml to the current schema (PHPUnit 12)

CI

  • Test matrix: PHP 8.1–8.4 → 8.3, 8.4, 8.5
  • First-party actions only: actions/checkout@v7, actions/setup-node@v7, actions/github-script@v9, plus shivammathur/setup-php and GitHub's dependabot/fetch-metadata; removed peaceiris/actions-gh-pages, laravel-pint-action, git-auto-commit-action, changelog-updater-action, ramsey/composer-install (replaced with direct tooling)
  • Docs deploy now pushes to gh-pages via plain git

Housekeeping

Bug fixes (issues #4 and #6):
- Fix SLA time on the final day being skipped when the end time-of-day
  is earlier than the start time-of-day, by anchoring the daily
  iteration at the start of day in both SLA::get_current_duration and
  Agenda\Weekly::toPeriods
- Add regression tests covering both reported scenarios

Dependencies:
- Require PHP ^8.3 (8.1/8.2 are EOL)
- Update to Carbon ^3, illuminate/collections ^11|^12|^13
- Upgrade dev tooling to Pest ^4, PHPStan ^2, Pint ^1.30,
  spatie/invade ^2, spatie/pest-plugin-test-time ^2.2
- Update npm dependencies (vitepress 1.6.4, tailwindcss 4.3.3, vue 3.5.41)
- Fix broken test-coverage composer script (missing space)

Static analysis & style:
- Add phpstan.neon.dist (referenced by CI but missing) and fix all 50
  level-8 findings, including latent bugs (Weekly::addTimePeriods
  over-flattening) and dead code (getPeriodsForDay was never defined)
- Migrate phpunit.xml to the current schema

CI:
- Modernise GitHub Actions (checkout@v7, setup-node@v7, pint action
  replaced with direct tooling, gh-pages deploy via first-party actions)
- Test matrix now covers PHP 8.3, 8.4, 8.5
@sifex
sifex merged commit 827ec1e into main Aug 15, 2026
10 checks passed
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.

Unexpected calculation

1 participant