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

This package is auto-updated.

Last update: 2025-09-30 10:21:40 UTC


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