webignition/internet-media-type-interface
PHP interface package defining contracts for representing internet media types (MIME types). Provides a shared API for parsing, validating, and comparing media type strings so implementations can interoperate across the webignition ecosystem.
InternetMediaTypeInterface and ParameterInterface — not a parser or implementation. The decision it informs is whether to standardise on a third-party set of value-object interfaces for media types, or hand-roll your own DTOs. Because it's interfaces, the cost of adoption is a composer require in a library layer, not an architectural commitment.Content-Type (an API client, an upload handler, a document converter), a shared interface lets those packages compose without a hard dependency between them. That is a real roadmap enabler for a platform/SDK play.Adopt when all of the following hold:
webignition ecosystem, or your dependency graph already pulls it in transitively — in which case this release is a required migration, not an optional evaluation.Look elsewhere when:
symfony/mime and league/mime-type-detection cover the practical use cases with far more functionality.text/html; charset=utf-8 and match it against an Accept header?", this package does not answer it. Interfaces alone deliver zero runtime capability..jpg → image/jpeg) — different problem, use a dedicated detection library.ParameterInterface setters outright). Fine for a greenfield library, painful if you have downstream consumers.For executives: This is a small, narrow infrastructure dependency — a set of PHP interfaces describing how internet media types (MIME types) are represented. It delivers no user-facing capability on its own. The 1.0 release marks it as stable and makes a deliberate design choice toward immutable objects, which is good engineering hygiene but carries a breaking change for anyone already on 0.x. Recommendation: no action unless we already depend on it transitively, in which case budget a small migration.
For engineering: Version 1.0 is a breaking release. ParameterInterface loses its setters, and InternetMediaTypeInterface replaces setters with with*() withers — meaning implementations must now be immutable and must return new instances rather than mutating in place. If we consume this package anywhere, every implementing class needs rewriting, and any code doing $mediaType->setType(...) will fatal. The immutability contract is a genuine improvement (safe as cache keys, safe under Octane/long-running workers, no defensive copying), so the migration is worth doing properly rather than pinning to 0.4. Note it is interfaces only — we own the parser either way, so this does not reduce our implementation work; it only standardises the shape of the objects we pass between packages.
How can I help you explore Laravel packages today?