This is wrong, it should be:
````php
$container->addCompilerPass(new RegisterRouterPass());
````

And also add how to compile the container, or link to http://symfony.com/doc/current/components/dependency_injection/compilation.html because this otherwise doesn't work.