Skip to content

2.7.5 — type-safety pass

Choose a tag to compare

@happytodev happytodev released this 22 Nov 11:03
· 2 commits to main since this release

Blogr 2.7.5

A type-safety pass over the package — what it turned up is fixed here.

Fixes

  • Nullable timestamps. The sitemap and the SEO block dereferenced published_at / updated_at
    without a check: a post without a publish date answered 500 on /sitemap.xml instead of being
    skipped.
  • Reading time. BlogPostTranslation::calculateReadingTime() stored ceil()'s float in an integer
    column.
  • Console argv. SettingsRepository read $_SERVER['argv'] without checking it exists — php-fpm
    has none, and the one place that reads it is the config:cache guard.
  • Admin draft import. Offsets of a value built from JSON were read without checking its type.
  • CMS blocks. The blocks column lives on cms_page_translations; the merge with the published
    revision is documented against that model, where the column actually is.

Internals

Every model now documents its columns (@property) and its relations
(@return BelongsTo<X, $this>), which is what PHPStan level 9 needs to follow a relation out of a
controller. The baseline is regenerated (1199 entries for 1877 findings, replacing 1391 entries that no
longer matched), so pint and phpstan both pass and the pre-commit hook is usable again.

Upgrade

composer require happytodev/blogr:^2.7.5
php artisan view:clear && php artisan optimize:clear

No migration, no configuration change.