PHPackages                             kauffinger/php-codemap - 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. kauffinger/php-codemap

ActiveLibrary

kauffinger/php-codemap
======================

Generate codemap surface text for PHP code

v0.4.0(1y ago)4166MITPHPPHP ^8.3.0CI passing

Since Feb 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kauffinger/php-codemap)[ Packagist](https://packagist.org/packages/kauffinger/php-codemap)[ RSS](/packages/kauffinger-php-codemap/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (8)Versions (8)Used By (0)

[![Latest Version on Packagist](https://camo.githubusercontent.com/822346f05668c9aa0062c3a3afb52d05c37dfb67a20b5bc0334a5f0b83bcaf13/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b61756666696e6765722f7068702d636f64656d61702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kauffinger/php-codemap)[![Linting](https://camo.githubusercontent.com/ef9353d9df709da86e7288c73ef0c8161747fc6012e9268db3ffa302d54148b7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b61756666696e6765722f7068702d636f64656d61702f636865636b732e796d6c3f6272616e63683d6d61696e266c6162656c3d6c696e74696e67267374796c653d666c61742d737175617265)](https://github.com/kauffinger/php-codemap/actions/workflows/checks.yml)[![Tests](https://camo.githubusercontent.com/222f846c8109c5fa81f02e56a8c08bb24d02be3aaf139d83db23ccae572377bb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b61756666696e6765722f7068702d636f64656d61702f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/kauffinger/php-codemap/actions/workflows/tests.yml)[![Total Downloads](https://camo.githubusercontent.com/49d5a81f0059871a18ea971eedb34a322421ed096af8397bee18ff32cb3266ed/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b61756666696e6765722f7068702d636f64656d61702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kauffinger/php-codemap)

PHP Codemap
===========

[](#php-codemap)

Table of Contents
-----------------

[](#table-of-contents)

- [Introduction](#introduction)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Advanced Usage](#advanced-usage)
- [Testing](#testing)
- [Contributing](#contributing)
- [Changelog](#changelog)
- [FAQ](#faq)
- [License](#license)

Introduction
------------

[](#introduction)

PHP Codemap is a versatile Composer package designed to simplify PHP codebase exploration. It scans your PHP files and generates a textual "codemap"—a structured overview detailing classes, methods, and public properties.

### Why Use PHP Codemap?

[](#why-use-php-codemap)

- **Use with LLMs**: Compress your codebase into a manageable amount of tokens.
- **Use with RepoPrompt**: Do the above, but for using RepoPrompt.

### Key Features

[](#key-features)

- **Recursive Scanning**: Analyze entire directories or specific files effortlessly.
- **AST-Based Parsing**: Uses advanced Abstract Syntax Tree parsing for precision.
- **Comprehensive Output**: Lists classes, methods, and public properties in a readable format.
- **Customizable**: Configure scan paths and PHP versions to suit your project.
- **CLI Simplicity**: Run easily from the command line with flexible options.

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

[](#installation)

### Requirements

[](#requirements)

- **PHP**: 8.3.0 or higher
- **Composer**: Required for installation

### Installing via Composer

[](#installing-via-composer)

Install PHP Codemap by adding it to your project with Composer:

```
composer require kauffinger/php-codemap
```

This command fetches the package and its dependencies, making the `codemap` command available in your `vendor/bin` directory.

Configuration
-------------

[](#configuration)

PHP Codemap supports customization through a `codemap.php` file in your project root. This optional file lets you define scan paths and the PHP version for parsing.

### Example `codemap.php`

[](#example-codemapphp)

```
