PHPackages                             decodelabs/typify - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. decodelabs/typify

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

decodelabs/typify
=================

Mime type detection tools

v0.4.1(8mo ago)71.5k1MITPHPPHP ^8.4CI passing

Since Apr 8Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/decodelabs/typify)[ Packagist](https://packagist.org/packages/decodelabs/typify)[ RSS](/packages/decodelabs-typify/feed)WikiDiscussions develop Synced 1w ago

READMEChangelog (10)Dependencies (5)Versions (22)Used By (1)

Typify
======

[](#typify)

[![PHP from Packagist](https://camo.githubusercontent.com/d8b7e21c1a831fa0eaa682ad8f3a75333f4598e766094c0314795f7e8751dc4c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6465636f64656c6162732f7479706966793f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/typify)[![Latest Version](https://camo.githubusercontent.com/83d3361d8cbed2eba9a5f605ea06fa7e6edf5999276655f8f3b355d9c67b19af/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465636f64656c6162732f7479706966792e7376673f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/typify)[![Total Downloads](https://camo.githubusercontent.com/0712cb7ad8eb033f7d06ec2d55705b89eaa7da070af77f0eb33bca9315627b91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465636f64656c6162732f7479706966792e7376673f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/typify)[![GitHub Workflow Status](https://camo.githubusercontent.com/6e5286920f10291d24079cc133228ba47574b036c77b8e2dd2d6865f94a659d8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6465636f64656c6162732f7479706966792f696e746567726174652e796d6c3f6272616e63683d646576656c6f70)](https://github.com/decodelabs/typify/actions/workflows/integrate.yml)[![PHPStan](https://camo.githubusercontent.com/e25c14ce011edabdd0fbd2e10415b41cc5d66ed11ef3e5b7edd074c5bdd35a2d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d656e61626c65642d3434434331312e7376673f6c6f6e6743616368653d74727565267374796c653d666c6174)](https://github.com/phpstan/phpstan)[![License](https://camo.githubusercontent.com/8e7e2bf736da9140734b6b1a4d24e1257a5b04dfcc2f13e2ce5d2eff9e7fb7ce/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6465636f64656c6162732f7479706966793f7374796c653d666c6174)](https://packagist.org/packages/decodelabs/typify)

### Mime type detection tools for PHP

[](#mime-type-detection-tools-for-php)

Use typify to identify and apply mime types information to your files and responses.

---

Installation
------------

[](#installation)

This package requires PHP 8.4 or higher.

Install via Composer:

```
composer require decodelabs/typify
```

Usage
-----

[](#usage)

### Detecting types

[](#detecting-types)

Detect a mime type for a file path:

```
use DecodeLabs\Typify\Detector;

$detector = new Detector();
echo $detector->detect(__FILE__);
// application/x-php
```

Get known extensions for a type:

```
$exts = $detector->getExtensionsFor('text/plain');
// txt, text, conf, def, list, log, in
```

Suggest an extension for a mime type:

```
echo $detector->getExtensionFor('text/plain');
// txt
```

Licensing
---------

[](#licensing)

Typify is licensed under the MIT License. See [LICENSE](./LICENSE) for the full license text.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance66

Regular maintenance activity

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~85 days

Recently: every ~28 days

Total

20

Last Release

250d ago

PHP version history (4 changes)v0.1.0PHP ^7.2|^8.0

v0.2.0PHP ^8.0

v0.2.5PHP ^8.1

v0.3.2PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a241d64d12b3b5ee94197862ec1ec30b82ed2efa34a0cd7f4c3565a021daddd?d=identicon)[betterthanclay](/maintainers/betterthanclay)

---

Top Contributors

[![betterthanclay](https://avatars.githubusercontent.com/u/1273586?v=4)](https://github.com/betterthanclay "betterthanclay (122 commits)")

---

Tags

mime-typesphpmimecontentdetection

### Embed Badge

![Health badge](/badges/decodelabs-typify/health.svg)

```
[![Health](https://phpackages.com/badges/decodelabs-typify/health.svg)](https://phpackages.com/packages/decodelabs-typify)
```

###  Alternatives

[symfony/mime

Allows manipulating MIME messages

2.8k668.8M911](/packages/symfony-mime)[zbateson/mail-mime-parser

MIME email message parser

54149.2M79](/packages/zbateson-mail-mime-parser)[php-mime-mail-parser/php-mime-mail-parser

A fully tested email parser for PHP 8.0+ (mailparse extension wrapper).

9979.6M27](/packages/php-mime-mail-parser-php-mime-mail-parser)[nette/mail

📧 Nette Mail: A handy library for creating and sending emails in PHP.

5389.8M246](/packages/nette-mail)[dflydev/canal

Content analysis for the purpose of determining Internet media types.

33121.2k2](/packages/dflydev-canal)[zbateson/stream-decorators

PHP psr7 stream decorators for mime message part streams

4748.6M6](/packages/zbateson-stream-decorators)

PHPackages © 2026

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