PHPackages                             amyboyd/symfony-router-validation - 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. amyboyd/symfony-router-validation

AbandonedLibrary

amyboyd/symfony-router-validation
=================================

Service and command for checking that your Symfony routes are valid

1.0.0(9y ago)15.8kPHPPHP &gt;=5.4.0

Since Jun 11Pushed 9y ago1 watchersCompare

[ Source](https://github.com/amyboyd/symfony-router-validation)[ Packagist](https://packagist.org/packages/amyboyd/symfony-router-validation)[ Docs](https://github.com/amyboyd/symfony-router-validation)[ RSS](/packages/amyboyd-symfony-router-validation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Symfony router validation
=========================

[](#symfony-router-validation)

This library provides a service and command for checking if the routes in your router configuration are valid.

Install
-------

[](#install)

Add the package to your dependencies:

```
composer require amyboyd/symfony-router-validation

```

Add these lines to your services configuration (e.g. in `services.yml` or `config.yml`):

```
services:
    amyboyd.command.router_validate_command:
        class: AmyBoyd\SymfonyStuff\RouterValidation\RouterValidationCommand
        tags:
            -  { name: console.command }

    amyboyd.router_validation:
        class: AmyBoyd\SymfonyStuff\RouterValidation\RouterValidationService
        arguments:
            controllerNameParser: '@controller_name_converter'
            container: '@service_container'
```

To check your routes are valid from the command line:

- In Symfony 2.\*, run `app/console router:validate`
- In Symfony 3.\*, run `bin/console router:validate`

Contribute
----------

[](#contribute)

To set up for local development:

```
git clone git@github.com:amyboyd/symfony-router-validation.git
cd symfony-router-validation
bin/composer-install

```

To verify your installation is working correctly, run the tests:

```
bin/test
bin/run-validate-command

```

The tests are run against multiple versions of Symfony (currently 2.5, 2.8, 3.0 and 3.1).

Sample output
-------------

[](#sample-output)

```
3 valid routes
6 invalid routes
app_invalid_controller_because_bundle_does_not_exist - Bundle "InvalidBundle" (from the _controller value "InvalidBundle:Default:index") does not exist, or is it not enabled
app_invalid_controller_because_of_trailing_action - Method "indexActionAction" does not exist in class "AppBundle\Controller\DefaultController".
app_invalid_controller_because_class_does_not_exist - The _controller value "AppBundle:InvalidClass:index" maps to a "AppBundle\Controller\InvalidClassController" class, but this class was not found. Create this class or check the spelling of the class and its namespace.
app_invalid_service_because_service_doesnt_exist - You have requested a non-existent service "app.invalid_controller_service". Did you mean this: "app.controller_service"?
app_invalid_service_because_method_doesnt_exist - Method "invalidMethodAction" does not exist in class "AppBundle\Controller\DefaultController".
app_invalid_missing_controller - _controller property is not set.
2 routes are in a format not supported by this command  - Please report the details at https://github.com/amyboyd/symfony-router-validation/issues
app_invalid_route_format - Route format "blabla!£%" is not supported by this tool
app_invalid_route_format_2 - Route format "AppBundleDefault@" is not supported by this tool

```

How to use in continuous integration testing or a Git pre-commit hook
---------------------------------------------------------------------

[](#how-to-use-in-continuous-integration-testing-or-a-git-pre-commit-hook)

The command returns exit code 0 if all routes are valid, and 1 if there are any invalid routes. You can use this in continuous integration testing or a Git pre-commit hook as follows:

```
app/console router:validate # or bin/console in Symfony 3
if [[ $? != '0' ]]; then
    exit 1
fi
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3619d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/af76b5b33fb2e1e0b0fb5106a21d487018d6074fef507fb8913c912df45ed120?d=identicon)[poiwrt90jqr09uj24gopiuj](/maintainers/poiwrt90jqr09uj24gopiuj)

---

Top Contributors

[![amyboyd](https://avatars.githubusercontent.com/u/398210?v=4)](https://github.com/amyboyd "amyboyd (3 commits)")

### Embed Badge

![Health badge](/badges/amyboyd-symfony-router-validation/health.svg)

```
[![Health](https://phpackages.com/badges/amyboyd-symfony-router-validation/health.svg)](https://phpackages.com/packages/amyboyd-symfony-router-validation)
```

PHPackages © 2026

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