nimp / link-loom-core
This package is designed to create short links and decode them back
v1.0.1
2025-09-30 10:17 UTC
Requires
- php: ^8.3
- psr/event-dispatcher: 1.*
Requires (Dev)
- nimp/observer: ^1.0
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.2
README
A library for shortening URLs and decoding shortcodes back into original links. It's based on clearly separated interfaces (repository, validator, code generator) and PSR-14 events.
- Minimal dependencies
- Extensibility through custom interface implementations
- Events during encoding/decoding and errors
Installation
composer require nimp/observer
Quick start
use Nimp\Linkloom\Linkloom; $shortener = new UrlShortener( new Repository(), new Validator(), new Generator(), new EventDispatcher( new ListenerProvider() ), ); $url = 'https://example.org'; $core = $shortener->encode($url); $urlDecoder = $shortener->decode($core);
Tests
composer install && composer test