michaeljoelphillips / ctags-php
Reads tag files generated by universal ctags
Installs: 21
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/michaeljoelphillips/ctags-php
Requires
- php: ^7.4
Requires (Dev)
- doctrine/coding-standard: ^8.1
- phpbench/phpbench: ^0.17.1
- phpstan/phpstan: ^0.12.56
- phpunit/phpunit: ^9.4
This package is auto-updated.
Last update: 2025-10-25 16:42:23 UTC
README
This library provides support for reading tag files generated by various versions of Ctags, including Universal and Exuberant Ctags.
Installation
composer require michaeljoelphillips/ctags-php
Usage
You can filter tags using a predicate function, match tags similar to
readtags, or list all tags. The result for each is a Generator
containing CTags\Tag objects:
use CTags\Reader; use CTags\Tag; use Generator; $reader = Reader::fromFile('tags', true); $reader->listAll(); $reader->match('MyClass'); $reader->partialMatch('My'); $reader->filter(static function (Tag $tag) { return $tag->name === 'MyClass' && $tag->fields['kind'] === 'c'; });
If reading the Universal Ctags extension fields is not necessary, you can exclude them for better performance:
use CTags\Reader; $reader = Reader::fromFile('tags', false);