PHPackages                             papi-ai/ingest-php-symbols - 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. papi-ai/ingest-php-symbols

ActiveLibrary

papi-ai/ingest-php-symbols
==========================

PHP symbol extraction for PapiAI ingestion: the Api depth ontology

v0.15.0(today)00MITPHPPHP ^8.2CI passing

Since Jul 27Pushed todayCompare

[ Source](https://github.com/papi-ai/ingest-php-symbols)[ Packagist](https://packagist.org/packages/papi-ai/ingest-php-symbols)[ RSS](/packages/papi-ai-ingest-php-symbols/feed)WikiDiscussions main Synced today

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

papi-ai/ingest-php-symbols
==========================

[](#papi-aiingest-php-symbols)

PHP symbol extraction for [PapiAI](https://papi-ai.org) ingestion: the `Depth::Api` ontology.

Reduces a PHP file to what it declares and what it reaches for, so a model can see the shape of a whole system without paying for its method bodies.

Install
-------

[](#install)

```
composer require papi-ai/ingest-php-symbols
```

Usage
-----

[](#usage)

Pass it to the ingestor and ask for `Depth::Api`:

```
use PapiAI\Ingest\Depth;
use PapiAI\Ingest\IngestRequest;
use PapiAI\Ingest\NativeIngestor;
use PapiAI\Ingest\PhpSymbols\PhpSymbolExtractor;

$ingestor = new NativeIngestor(new PhpSymbolExtractor());
$digest = $ingestor->ingest(new IngestRequest('/path/to/repo', Depth::Api, tokenBudget: 4000));

echo $digest->toPrompt();
```

What a block looks like
-----------------------

[](#what-a-block-looks-like)

`papi-ai/ingest`'s own `NativeIngestor.php`, 1,500 lines of file reduced to this:

```
namespace PapiAI\Ingest;

class NativeIngestor implements RepositoryIngestorInterface
  __construct(?SymbolExtractorInterface $extractor = ..., TokenEstimatorInterface $estimator = ...)
  supports(IngestRequest $request): bool
  ingest(IngestRequest $request): RepositoryDigest
-> HeuristicTokenEstimator, IngestRequest, PathFilter, RepositoryDigest, RepositoryIngestorInterface,
   SymbolExtractorInterface, TokenEstimatorInterface, TreeBuilder

```

The `->` line is the point. Signatures tell you what a class accepts; the edges tell you what it is built out of, including types it only ever instantiates internally, which no signature would reveal.

Measured across `papi-ai/ingest`'s own source: **486 tokens at `Api` against 8,763 at `Full`, or 5.5%**. A repository that would not fit in a context window at all fits comfortably, whole.

What it reports
---------------

[](#what-it-reports)

- Namespace, once, at the top.
- Every class, interface, trait and enum, with what it extends and implements.
- **Public** method signatures only, with parameter and return types, variadics marked and defaults shown as present rather than spelled out. Private and protected methods are implementation: they cost tokens without telling a reader how the pieces connect.
- Top-level functions.
- Outgoing edges: types in signatures, typed properties, and classes reached with `new`. Sorted, deduplicated, with scalars and `self`/`static`/`parent` left out.

Types print as they were written in the source, not fully qualified, because `RepositoryDigest`says as much as `PapiAI\Ingest\RepositoryDigest` to anyone reading the file it came from, for a quarter of the tokens.

Behaviour
---------

[](#behaviour)

Deterministic: the same bytes always give the same block. A file that does not parse yields no block rather than an exception, so it still appears in the tree with its path and size intact.

License
-------

[](#license)

MIT, Marcello Duarte

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

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

---

Top Contributors

[![MarcelloDuarte](https://avatars.githubusercontent.com/u/144535?v=4)](https://github.com/MarcelloDuarte "MarcelloDuarte (1 commits)")

###  Code Quality

TestsPest

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/papi-ai-ingest-php-symbols/health.svg)

```
[![Health](https://phpackages.com/badges/papi-ai-ingest-php-symbols/health.svg)](https://phpackages.com/packages/papi-ai-ingest-php-symbols)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M115](/packages/dedoc-scramble)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M348](/packages/psalm-plugin-laravel)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k16](/packages/tempest-framework)[cakephp/bake

Bake plugin for CakePHP

11212.0M208](/packages/cakephp-bake)[dereuromark/cakephp-ide-helper

CakePHP IdeHelper Plugin to improve auto-completion

1882.3M45](/packages/dereuromark-cakephp-ide-helper)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

54643.3k4](/packages/jolicode-castor)

PHPackages © 2026

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