PHPackages                             pinoven/routing - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. pinoven/routing

ActiveLibrary[HTTP &amp; Networking](/categories/http)

pinoven/routing
===============

Pinoven Routing Component. Manage route as simple as it is.

00PHP

Since Aug 31Pushed 5y ago1 watchersCompare

[ Source](https://github.com/rbergDrox/pinoven-routing)[ Packagist](https://packagist.org/packages/pinoven/routing)[ RSS](/packages/pinoven-routing/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Pinoven: Routing [![Pinoven](https://camo.githubusercontent.com/4c0e2527c9c4a050dffeb25e08e78f0a2bc607ededf82fa8be80bc7f69aa0b62/68747470733a2f2f636972636c6563692e636f6d2f67682f726265726744726f782f70696e6f76656e2d726f7574696e672e7376673f7374796c653d737667)](https://circleci.com/gh/rbergDrox/pinoven-routing/tree/master)
================================================================================================================================================================================================================================================================================================================================

[](#pinoven-routing--)

Pinoven Routing

Install
=======

[](#install)

```
$ composer require pinoven/routing

```

Features/Usage
==============

[](#featuresusage)

Interface
---------

[](#interface)

The component is provided with a set of interface:

```
// Describe how you can create router from settings.
\Pinoven\Routing\Route\RouteFactoryInterface::class;

// Describe element that have to be in a route and nothing else.
\Pinoven\Routing\Route\RouteInterface::class;

// Describe element that have to be in a router and nothing else.
\Pinoven\Routing\Router\RouteInterface::class;

// Should be use by the router to match a route.
\Pinoven\Routing\Router\RouteMatcherInterface::class;
```

Route
-----

[](#route)

### Definition

[](#definition)

```
$controller = new class {
    public function hellWord() {

    }
    public function newRoute() {

    }
};
$route =  new \Pinoven\Routing\Route\Route('/my-route/{test}', [$controller, 'helloWord']);

$routeWithAlias =  new \Pinoven\Routing\Route\Route('/my-next-route/{test1}/{test2}', [$controller, 'newRoute'], 'route-alias');
```

You can use getter/setter to change these values.

You can add/update attributes on this route by using this:

```
$controller = new class {
    public function helloWord() {

    }
};
$route =  new \Pinoven\Routing\Route\Route('/my-route/{test}', [$controller, 'helloWord']);

$route->setAttributes('priority', 4);
```

### Factory

[](#factory)

By using an array you can create a route:

```
use Pinoven\Routing\Route\RouteFactory;

$controller = new class {
    // ... Controller definition
};
$routeFactory = new RouteFactory();
$config = [
    'path' => '/hello/{name}',
    'alias' => 'mon-alias',
    'destination' => [$controller, 'methodToCall'],
    'attributes' => [
        'priority' => 6,
        'enabled' => false,
    ]
];
$route = $routeFactory->configure($config);
```

Matcher
-------

[](#matcher)

A route matcher is something that the router will use to found if a routing request has one or more route that can be bind.

```
use Pinoven\Routing\Route\RouteFactory;

$controller = new class {
    // ... Controller definition
};
$routeFactory = new RouteFactory();
$config = [
    'path' => '/hello/{name}',
    'alias' => 'mon-alias',
    'destination' => [$controller, 'methodToCall']
];
$route = $routeFactory->configure($config);

// Default expressions that can be used as delimiter for attributes.
$defaultExpressions = [
    new \Pinoven\Routing\Router\RouteExpression\BracesRouteExpression(),
    new \Pinoven\Routing\Router\RouteExpression\DigitBracesRouteExpression()
];
$matcher = new \Pinoven\Routing\Router\RouteMatcher($defaultExpressions);

// $routeRequestData can be a RouteRequest or whatever you want to use to check if the route match with routing request.
$routeRequestData = new \Pinoven\Routing\Router\RouteRequest\RouteRequest('https://www.test.com/test');
// It will return an empty array or with attributes or null if nothing matches.
$matcher->match($routeRequestData, $route);
```

Router
------

[](#router)

```
// Default expressions that can be used as delimiter for attributes.
$defaultExpressions = [
    new \Pinoven\Routing\Router\RouteExpression\BracesRouteExpression(),
    new \Pinoven\Routing\Router\RouteExpression\DigitBracesRouteExpression()
];
$matcher = new \Pinoven\Routing\Router\RouteMatcher($defaultExpressions);
$router = new \Pinoven\Routing\Router\Router($matcher);

// Default route matcher can be change
$routeMatcher = new class implements \Pinoven\Routing\Router\RouteMatcherInterface {
     public function getRouteExpressions() : array{
    }
    public function match($routeData,\Pinoven\Routing\Route\RouteInterface $route) : ?\Pinoven\Routing\Router\RouteRequest\RouteResultInterface{

    }
};
// must implement RoutMatcherInterface
$router->setMatchRouteStrategy($routeMatcher);
```

### Route result

[](#route-result)

Route matching a routing request will be wrapped to a `RouteResult` instance. That one implements :

```
\Pinoven\Routing\Router\RouteRequest\RouteResultInterface::class;
```

Contribution
============

[](#contribution)

Route methods(add, remove, find, findOne, get) should use strategy. We able to implement whatever w want here such as collection.

Contribution
============

[](#contribution-1)

- Create issue: improvement + the reason why it should be implemented or issue + how to reproduce.
- Create pull request and explain the issue.

More information will come about how to contribute on all pinoven package.

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11984931?v=4)[Raphaël BERGINA](/maintainers/rbergDrox)[@rbergDrox](https://github.com/rbergDrox)

---

Top Contributors

[![rbergDrox](https://avatars.githubusercontent.com/u/11984931?v=4)](https://github.com/rbergDrox "rbergDrox (20 commits)")

### Embed Badge

![Health badge](/badges/pinoven-routing/health.svg)

```
[![Health](https://phpackages.com/badges/pinoven-routing/health.svg)](https://phpackages.com/packages/pinoven-routing)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M91](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
