PHPackages                             ilexn/slim-route-strategies - 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. [Framework](/categories/framework)
4. /
5. ilexn/slim-route-strategies

ActiveLibrary[Framework](/categories/framework)

ilexn/slim-route-strategies
===========================

Slim 4 route strategies for parameter upcasting

0.1.2(6y ago)01MITPHPPHP ^7.2

Since May 12Pushed 6y ago1 watchersCompare

[ Source](https://github.com/iLexN/slim-route-strategies)[ Packagist](https://packagist.org/packages/ilexn/slim-route-strategies)[ RSS](/packages/ilexn-slim-route-strategies/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (7)Versions (4)Used By (0)

Slim4 Route Strategies
======================

[](#slim4-route-strategies)

[![Latest Stable Version](https://camo.githubusercontent.com/eb0dfe0e2368de40b3a65aad62d33d928698344128fb8947294435c9245891b7/68747470733a2f2f706f7365722e707567782e6f72672f696c65786e2f736c696d2d726f7574652d737472617465676965732f762f737461626c65)](https://packagist.org/packages/ilexn/slim-route-strategies)[![Total Downloads](https://camo.githubusercontent.com/30879127144b73cbb737df3916eea7723e7dfa3f834589f9a161b349401bf7fb/68747470733a2f2f706f7365722e707567782e6f72672f696c65786e2f736c696d2d726f7574652d737472617465676965732f646f776e6c6f616473)](https://packagist.org/packages/ilexn/slim-route-strategies)

[![Coverage Status](https://camo.githubusercontent.com/f81b8f78f0847baad673d60c8857fd2824bc675cbf7f417156bdc2846fb7e58c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f694c65784e2f736c696d2d726f7574652d737472617465676965732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/iLexN/slim-route-strategies?branch=master)[![Build Status](https://camo.githubusercontent.com/a6787665db8a46391f18742ee7939df774f3d65fc33caa4b139bb281c6b03da3/68747470733a2f2f7472617669732d63692e6f72672f694c65784e2f736c696d2d726f7574652d737472617465676965732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/iLexN/slim-route-strategies)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e63e0e5c2d2b0fabfa3e6fb02df87398a6a9246862762df12013f3dcf079a4b5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f694c65784e2f736c696d2d726f7574652d737472617465676965732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/iLexN/slim-route-strategies/?branch=master)[![Infection MSI](https://camo.githubusercontent.com/47cf1d02a18621a6e893ec97523b5ca584113b0cc22babc4b8664a6e089c0d30/68747470733a2f2f62616467652e737472796b65722d6d757461746f722e696f2f6769746875622e636f6d2f694c65784e2f736c696d2d726f7574652d737472617465676965732f6d6173746572)](https://infection.github.io)

Slim 4 route strategies for parameter upcasting

Install
-------

[](#install)

Via Composer

```
$ composer require ilexn/slim-route-strategies
```

Usage
-----

[](#usage)

```
$resolver = new RouteArgsResolver();
$resolver->add(new Case1());

$app = AppFactory::create();
$routeCollector = $app->getRouteCollector();
$routeCollector->setDefaultInvocationStrategy($resolver);

$app->get('/hello/{name}', function ($request, $response, Name $name) {
    $response->getBody()->write("Hello ". $name->getName());
    return $response;
});
```

```
final class Case1 implements RouteArgsResolverInterface
{
    public function __invoke(string $value): int
    {
        return 1;
    }

    public function get(string $value): Name
    {
        return new Name($value);
    }

    /**
    * @return callable[]
    */
    public function getArgsResolver(): array
    {
        return [
            'name' => [$this, 'get'],
            'b' => static function ($value) {
                return $value;
            },
            'c' => $this,
        ];
    }
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~14 days

Total

3

Last Release

2530d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4638751?v=4)[iLexN](/maintainers/iLexN)[@iLexN](https://github.com/iLexN)

---

Top Contributors

[![iLexN](https://avatars.githubusercontent.com/u/4638751?v=4)](https://github.com/iLexN "iLexN (14 commits)")

---

Tags

slim4routeslim4

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ilexn-slim-route-strategies/health.svg)

```
[![Health](https://phpackages.com/badges/ilexn-slim-route-strategies/health.svg)](https://phpackages.com/packages/ilexn-slim-route-strategies)
```

###  Alternatives

[pecee/simple-router

Simple, fast PHP router that is easy to get integrated and in almost any project. Heavily inspired by the Laravel router.

696214.6k17](/packages/pecee-simple-router)[odan/slim4-skeleton

A Slim 4 skeleton

4588.5k](/packages/odan-slim4-skeleton)[izniburak/router

simple router class for php

23522.6k7](/packages/izniburak-router)[lesichkovm/laravel-advanced-route

Advanced route class for Laravel - restoring implicit controllers to the framework.

70140.7k1](/packages/lesichkovm-laravel-advanced-route)[developermarius/simple-router

Simple, fast PHP router that is easy to get integrated and in almost any project. Heavily inspired by the Laravel router.

112.4k](/packages/developermarius-simple-router)

PHPackages © 2026

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