PHPackages                             sycho/license-detector - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sycho/license-detector

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sycho/license-detector
======================

License Type Detector

v1.0.5(6y ago)27672MITPHPPHP &gt;=7.2.0CI failing

Since Aug 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/SychO9/license-detector)[ Packagist](https://packagist.org/packages/sycho/license-detector)[ Docs](https://sycho9.github.io)[ RSS](/packages/sycho-license-detector/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (6)Dependencies (2)Versions (7)Used By (0)

license-detector
================

[](#license-detector)

A License information detector, inspired by [Licensee](https://github.com/licensee/licensee) and relies on data from [`choosealicense.com`](https://choosealicense.com/)

[![Travis (.org) branch](https://camo.githubusercontent.com/4afc2cf607697ceb5069b9892b2d56e6db68ee11ade3bb6af0efe81c18046a2a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f537963684f392f6c6963656e73652d6465746563746f722f6d61737465723f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/4afc2cf607697ceb5069b9892b2d56e6db68ee11ade3bb6af0efe81c18046a2a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f537963684f392f6c6963656e73652d6465746563746f722f6d61737465723f7374796c653d666c61742d737175617265)[![Latest Version](https://camo.githubusercontent.com/f5565cac0c5fb15945c6902bd8f23946e6f7159a9da40cd44349180f29ac2658/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f537963684f392f6c6963656e73652d6465746563746f722e7376673f7374796c653d666c61742d73717561726526636f6c6f723d6f72616e6765)](https://camo.githubusercontent.com/f5565cac0c5fb15945c6902bd8f23946e6f7159a9da40cd44349180f29ac2658/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f537963684f392f6c6963656e73652d6465746563746f722e7376673f7374796c653d666c61742d73717561726526636f6c6f723d6f72616e6765)[![php](https://camo.githubusercontent.com/90041f595ea4d6e3bb5dc75d0c5626caf7b7f433f39e15c403c6e02dba6c8378/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d372e322d7265642e7376673f7374796c653d666c61742d73717561726526636f6c6f723d626c7565)](https://camo.githubusercontent.com/90041f595ea4d6e3bb5dc75d0c5626caf7b7f433f39e15c403c6e02dba6c8378/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d372e322d7265642e7376673f7374796c653d666c61742d73717561726526636f6c6f723d626c7565)[![License](https://camo.githubusercontent.com/832d96619790ca78f6414bfe9b7fb5f14a0715f6058706a4e614c2b2b98e9a10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d73717561726526636f6c6f723d677265656e)](https://camo.githubusercontent.com/832d96619790ca78f6414bfe9b7fb5f14a0715f6058706a4e614c2b2b98e9a10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d73717561726526636f6c6f723d677265656e)

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

[](#installation)

Using Composer run the following

```
$ composer require sycho/license-detector
```

Problem
-------

[](#problem)

The code uses php's `similar_text()` function to tell which license is the one used, the function is quiet expensive and can take up to one second for the results.

Usage
-----

[](#usage)

Using the `Detector` class's `parse()` or `parseByPath()` methods, you get a `License` object containing data about the license

```
require '...\vendor\autoload.php';

use LicenseDetector\Detector;

$detector = new Detector();

// By license contents
$license = $detector->parse($contents);

// By file path
$license = $detector->parseByPath($path_to_license);
```

Contributing
------------

[](#contributing)

Sign-off your commits, to acknowledge your submission under the license of the project.

Example: `Signed-off-by: Your Name `

License
-------

[](#license)

This package is released under the MIT License. A full copy of this license is included in the package file.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

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

Total

6

Last Release

2452d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3653255?v=4)[SychO](/maintainers/SychO)[@Sycho](https://github.com/Sycho)

---

Top Contributors

[![SychO9](https://avatars.githubusercontent.com/u/20267363?v=4)](https://github.com/SychO9 "SychO9 (24 commits)")

---

Tags

composerlicenselicense-detectorphpsimilarity-measuresphplicense

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sycho-license-detector/health.svg)

```
[![Health](https://phpackages.com/badges/sycho-license-detector/health.svg)](https://phpackages.com/packages/sycho-license-detector)
```

###  Alternatives

[hi-folks/data-block

Data class for managing nested arrays and JSON data.

1472.2k](/packages/hi-folks-data-block)[nilportugues/php_todo

Looks into the code using a user-defined list of to-do phrases and stops commit if the total amount increased or is above a threshold.

1210.0k](/packages/nilportugues-php-todo)

PHPackages © 2026

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