trypost/app/Rules
Paulo Castellano 54fcaa7263 refactor(media): centralize image/video/document detection in Media\Type
Media-type detection was duplicated across Media, MediaItem (byte-identical copies), HasMedia::getMediaType, the ContentTypeCompatibleWithMedia rule, and six publishers — each hardcoding MIME prefixes and divergent extension lists (Media's video list even had avi/webm/mkv, contradicting the Type enum's mp4/mov).

Add classify(), fromExtension(), and isGif() to Media\Type as the single source for 'what kind is this?' (broad classification), distinct from fromMime()/allowedMimeTypes() (the strict upload allow-list). Every detector now delegates to the enum; the broad extension lists and MIME prefixes live only there. Behavior-preserving (full suite green); adds direct tests for classify/fromExtension/isGif.
2026-06-25 10:57:57 -03:00
..
ContentFitsPlatformLimits.php refactor(posts): tighten content-length caps and simplify contentOverflow 2026-05-11 20:06:44 -03:00
ContentTypeCompatibleWithMedia.php refactor(media): centralize image/video/document detection in Media\Type 2026-06-25 10:57:57 -03:00
ContentTypeMatchesPlatform.php refactor: derive sibling key in content-type rules without regex 2026-05-04 13:06:13 -03:00
ContentTypeMatchesPostPlatform.php refactor: derive sibling key in content-type rules without regex 2026-05-04 13:06:13 -03:00
ResolvableUrl.php fix(automations): code-review hardening for feed fetch & URL validation 2026-06-16 12:09:16 -03:00