PHPackages                             aternos/licensee - 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. aternos/licensee

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

aternos/licensee
================

A library to detect well-known licenses based on their title or content.

v3.0.0(11mo ago)12.9k↓38.1%MITPHPPHP &gt;=8.3CI passing

Since Dec 19Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/aternosorg/php-licensee)[ Packagist](https://packagist.org/packages/aternos/licensee)[ RSS](/packages/aternos-licensee/feed)WikiDiscussions master Synced 1mo ago

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

PHP-Licensee
============

[](#php-licensee)

This library can be used to detect well-known licenses based on their title or content. PHP-Licensee is based on the [Licensee Ruby Gem](https://github.com/licensee/licensee), but not quite a full port.

Information about licenses is generated from data from [choosealicense.com](https://github.com/github/choosealicense.com)and the [SPDX License List](https://github.com/spdx/license-list-XML). Note that only licenses that are listed on choosealicense.com can be detected by this library.

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

[](#installation)

```
composer require aternos/licensee
```

Usage
-----

[](#usage)

```
$licensee = new \Aternos\Licensee\Licensee();
```

### Detect license by ID string

[](#detect-license-by-id-string)

```
$license = $licensee->findLicenseById('mit');
echo "Found " . $license->getTitle() . "\n";
```

### Detect license by title

[](#detect-license-by-title)

```
$license = $licensee->findLicenseByTitle('MIT License');
echo "Found " . $license->getTitle() . "\n";
```

Setting the optional argument `allowMatchWithoutVersion` to `true` will allow the detection of licenses without considering the version number, in case no exact match can be found.

### Detect license by content

[](#detect-license-by-content)

```
$content = new \Aternos\Licensee\License\Text\LicenseText(file_get_contents('LICENSE'), 'LICENSE');
$match = $licensee->findLicenseByContent($content);
echo "Found " . $match->getLicense()->getTitle() . "\n";
echo "Confidence: " . $match->getConfidence() . "\n";
```

This will try to find a license that is an exact match ([after some normalization steps](src/TextTransformer)), or use a version of the [Dice-Sørensen coefficient](https://en.wikipedia.org/wiki/Dice-S%C3%B8rensen_coefficient).

Optionally, a `confidenceThreshold` value between 0 and 100 can be supplied to `findLicenseByContent`. If not set, the default value of 98.0 will be used.

### Get license information

[](#get-license-information)

Most of the information available on choosealicense.com can be accessed through the license object:

```
$license = $licensee->findLicenseById('mit');

echo "Title: " . $license->getTitle() . "\n";
echo "ID: " . $license->getSpdxId()->value . "\n";
echo "Description: " . $license->getDescription() . "\n";
echo "How: " . $license->getHow() . "\n";

echo "Using:\n";
foreach ($license->getUsing() as $using) {
    echo "  - " . $using . "\n";
}

echo "Permissions:\n";
foreach ($license->getPermissions() as $permission) {
    echo "  - " . $permission->getLabel() . ": " . $permission->getDescription() . "\n";
}

echo "Conditions:\n";
foreach ($license->getConditions() as $condition) {
    echo "  - " . $condition->getLabel() . ": " . $condition->getDescription() . "\n";
}

echo "Limitations:\n";
foreach ($license->getLimitations() as $limitation) {
    echo "  - " . $limitation->getLabel() . ": " . $limitation->getDescription() . "\n";
}
```

Key differences to Ruby Licensee
--------------------------------

[](#key-differences-to-ruby-licensee)

### No projects

[](#no-projects)

This library does not automatically scan project directories for license files or package metadata. Finding the correct license file is up to the user.

### No pseudo licenses

[](#no-pseudo-licenses)

Ruby Licensee can return the pseudo licenses `other` and `no-license` if no license could be detected. This library will simply return `null` in this case.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance61

Regular maintenance activity

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80.8% 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 ~39 days

Total

5

Last Release

357d ago

Major Versions

v1.1.0 → v2.0.02025-05-06

v2.0.1 → v3.0.02025-05-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/182e603c02f308d1036a1ecaba0b994665e87d13a86ff4550a96c9189a92c544?d=identicon)[aternos](/maintainers/aternos)

---

Top Contributors

[![KurtThiemann](https://avatars.githubusercontent.com/u/26512466?v=4)](https://github.com/KurtThiemann "KurtThiemann (21 commits)")[![JulianVennen](https://avatars.githubusercontent.com/u/45244473?v=4)](https://github.com/JulianVennen "JulianVennen (3 commits)")[![pavog](https://avatars.githubusercontent.com/u/4786628?v=4)](https://github.com/pavog "pavog (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aternos-licensee/health.svg)

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

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[kirschbaum-development/commentions

A package to allow you to create comments, tag users and more

12369.2k](/packages/kirschbaum-development-commentions)[madeitbelgium/seo-analyzer

SEO Analyzer

334.8k1](/packages/madeitbelgium-seo-analyzer)

PHPackages © 2026

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