PHPackages                             dansrocks/treefinder - 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. dansrocks/treefinder

ActiveLibrary

dansrocks/treefinder
====================

A tree finder utility

1492PHP

Since Apr 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/dansrocks/treefinder)[ Packagist](https://packagist.org/packages/dansrocks/treefinder)[ RSS](/packages/dansrocks-treefinder/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

treefinder
==========

[](#treefinder)

A tree finder utility

Example:
--------

[](#example)

Defining a Closure

```
$compareStrings = function (string $str1, string $str2) {
        $minChars = min(mb_strlen($str1), mb_strlen($str2));
        $changes = levenshtein($str1, $str2);
        $percent = (($minChars - $changes) / $minChars) * 100;

        return intval($percent);
    };

```

After, we try to compare severals strin with previous closure

```
$treefinder = new \TreeFinder\TreeFinder($compareStrings, 50);
$coincidences = $treefinder->findCoincidences(
    ['carrot', 'pastilla', 'comanda' ],
    ['comando', 'pastillero', 'carotida' ]
);

```

Finaly, you could to see the results

```
print_r($coincidences);

```

Then, you should see...

```
treefinder$ php main.php
Ejecutando coincidencias entre (carrot, comando)
Ejecutando coincidencias entre (carrot, pastillero)
Ejecutando coincidencias entre (carrot, carotida)
Ejecutando coincidencias entre (pastilla, comando)
Ejecutando coincidencias entre (pastilla, pastillero)
Ejecutando coincidencias entre (pastilla, carotida)
Ejecutando coincidencias entre (comanda, comando)
Ejecutando coincidencias entre (comanda, pastillero)
Ejecutando coincidencias entre (comanda, carotida)
Array
(
    [0] => Array
        (
            [left-pos] => 1
            [right-pos] => 1
            [left] => pastilla
            [right] => pastillero
            [coincidence] => 62
        )

    [1] => Array
        (
            [left-pos] => 2
            [right-pos] => 0
            [left] => comanda
            [right] => comando
            [coincidence] => 85
        )
)

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/df1f87a4359b06d9fa8e8305c76adff860f15a7c0767048becc10f6027e1466c?d=identicon)[Daniel Cabrera](/maintainers/Daniel%20Cabrera)

---

Top Contributors

[![dansrocks](https://avatars.githubusercontent.com/u/1129211?v=4)](https://github.com/dansrocks "dansrocks (7 commits)")

### Embed Badge

![Health badge](/badges/dansrocks-treefinder/health.svg)

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

PHPackages © 2026

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