PHPackages                             fuko-php/source - 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. fuko-php/source

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

fuko-php/source
===============

Extracts chunks of source code identified by code references, e.g. filename + line

1.0.0(5y ago)042MITPHPPHP &gt;=7.1

Since Jun 8Pushed 5y ago1 watchersCompare

[ Source](https://github.com/fuko-php/source)[ Packagist](https://packagist.org/packages/fuko-php/source)[ RSS](/packages/fuko-php-source/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Fuko\\Source [![GitHub license](https://camo.githubusercontent.com/c0534c03b5fe898ca52c280b289f0498cf08639eb420d1ae94270fbee1425a85/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f66756b6f2d7068702f736f757263652e737667)](https://github.com/fuko-php/source/blob/master/LICENSE) [![Latest Version](https://camo.githubusercontent.com/fcd236a503d46feb64792f7db6c25b3437c59f06d208e47549da76d0315b9aad/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66756b6f2d7068702f736f757263652e737667)](https://packagist.org/packages/fuko-php/source)
====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#fukosource--)

**Fuko\\Source** is a small PHP library that helps you to extracts chunks of source code identified by code references, e.g. filename + line.

It is really simple to use. Imagine you want to extract a piece of code, and you know what source code line exactly you want to reference: for example `/var/www/html/index.php` at line 17. You must first create a new `\Fuko\Source\Code`object, and then call the `getLinesAt()` method:

```
include __DIR__ . '/vendor/autoload.php';

$source = new \Fuko\Source\Code('/var/www/html/index.php');
print_r($source->getLinesAt(17));
/*
Array
(
    [14] => Illuminate\Support\ClassLoader::register();
    [15] => Illuminate\Support\ClassLoader::addDirectories(array(CLASS_DIR,CONTROLLERS,CONTROLLERS.'Middleware/', MODELS, CONTROLLERS.'Admin/'));
    [16] =>
    [17] => $FileLoader = new FileLoader(new Filesystem,  RESOURCES.'lang');
    [18] => $translator = new Translator($FileLoader, 'en');
    [19] => $Container = new Container();
    [20] => $validation = new Factory($translator, $Container);
)
*/
```

By default there are 7 lines of code (LOCs) returned, but you can specify a different number in the range of 1 to 20 (as defined in `\Fuko\Source\Code::LOC_MAX`):

```
include __DIR__ . '/vendor/autoload.php';

$source = new \Fuko\Source\Code('/var/www/html/index.php');
print_r($source->getLinesAt(17, 1));
/*
Array
(
    [17] => $FileLoader = new FileLoader(new Filesystem,  RESOURCES.'lang');
)
*/
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

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

Unknown

Total

1

Last Release

1851d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/694812?v=4)[Kaloyan Tsvetkov](/maintainers/kktsvetkov)[@kktsvetkov](https://github.com/kktsvetkov)

---

Top Contributors

[![kktsvetkov](https://avatars.githubusercontent.com/u/694812?v=4)](https://github.com/kktsvetkov "kktsvetkov (9 commits)")

---

Tags

fukofuko-phpsourcesource-codesourcefukofuko-phpsource-code

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fuko-php-source/health.svg)

```
[![Health](https://phpackages.com/badges/fuko-php-source/health.svg)](https://phpackages.com/packages/fuko-php-source)
```

###  Alternatives

[fuko-php/masked

Masks sensitive data: replaces blacklisted elements with redacted values

140130.2k](/packages/fuko-php-masked)[ncuesta/pinocchio

Annotated Source generator for PHP (port of Docco)

112.6k2](/packages/ncuesta-pinocchio)

PHPackages © 2026

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