samlitowitz / php-radix-tree-generator
Generate PHP code for a Radix Tree for a static set of data
v1.0.0
2025-09-30 23:12 UTC
Requires
- php: ^8.0
- league/csv: ^9.25
- nikic/php-parser: ^5.6
- symfony/console: ^7.3
- symfony/json-streamer: ^7.3
- symfony/serializer-pack: ^1.3
- symfony/type-info: ^7.3
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^12.3
- samlitowitz/phpstan-opinionated-nomenclature: ^1.0
- squizlabs/php_codesniffer: ^4.0
This package is auto-updated.
Last update: 2025-10-01 08:56:35 UTC
README
Generate PHP code for a Radix Tree for a static set of data
Table of Contents
Installation
Install via Composer.
composer require --dev samlitowitz/php-radix-tree-generator
Usage
-
Create a configuration targeting the type(s) you wish to generate a collection for.
-
Generate the desired collection(s) by running the following command
./vendor/bin/php-radix-tree generate config.json ./path/to/output/dir/
Configuration
A JSON schema for the configuration is available here.
The example RadixTree
is generated using the
example configuration.
The RadixTreeUnderTest
, generated for unit testing, is another good
example of the generated PHP source code.
This site or product includes IP2Location™ ISO 3166-2 Subdivision Code which available from https://www.ip2location.com.