Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Call to undefined method Symfony\Component\Routing\Route::addOptions() #9

Closed
HelloGrayson opened this issue Apr 19, 2012 · 5 comments

Comments

@HelloGrayson
Copy link

Trying to setup a simple example with NelmioApiDocBundle. I'm guessing this is because the bundle is following Symfony2 master. Is there a way to add 2.0 support or can you point me to instructions to following 2.1 master? Thanks

Fatal error: Call to undefined method Symfony\Component\Routing\Route::addOptions() in /src/projecti/vendor/bundles/Nelmio/ApiDocBundle/Extractor/ApiDocExtractor.php on line 203

Call Stack:
    0.0003     327544   1. {main}() /src/projectweb/app_dev.php:0
    0.0066     817800   2. Symfony\Component\HttpKernel\Kernel->handle() /src/project/web/app_dev.php:37
    0.0212    1113160   3. Symfony\Bundle\FrameworkBundle\HttpKernel->handle() /src/project/app/bootstrap.php.cache:547
    0.0213    1113796   4. Symfony\Component\HttpKernel\HttpKernel->handle() /src/project/app/cache/dev/classes.php:4879
    0.0213    1113796   5. Symfony\Component\HttpKernel\HttpKernel->handleRaw() /src/project/app/cache/dev/classes.php:3875
    0.0799    1669508   6. call_user_func_array() /src/project/app/cache/dev/classes.php:3905
    0.0799    1669640   7. Nelmio\ApiDocBundle\Controller\ApiDocController->indexAction() /src/project/app/cache/dev/classes.php:3905
    0.0800    1669640   8. Nelmio\ApiDocBundle\Extractor\ApiDocExtractor->all() /src/project/vendor/bundles/Nelmio/ApiDocBundle/Controller/ApiDocController.php:21
    0.2217    2097108   9. Nelmio\ApiDocBundle\Extractor\ApiDocExtractor->getData() /src/project/vendor/bundles/Nelmio/ApiDocBundle/Extractor/ApiDocExtractor.php:67


Variables in local scope (#9):
  $annotation = class Nelmio\ApiDocBundle\Annotation\ApiDoc { private $filters = array ('a-filter' => array ('dataType' => 'integer'), 'another-filter' => array ('dataType' => 'string', 'pattern' => '(foo|bar) ASC|DESC')); private $formType = NULL; private $description = 'This is a description of your API method'; private $isResource = TRUE }
  $comment = *uninitialized*
  $comments = *uninitialized*
  $docblock = '@ApiDoc(\n resource=true,\n description=\\"This is a description of your API method\\",\n filters={\n {\\"name\\"=\\"a-filter\\", \\"dataType\\"=\\"integer\\"},\n {\\"name\\"=\\"another-filter\\", \\"dataType\\"=\\"string\\", \\"pattern\\"=\\"(foo|bar) ASC|DESC\\"}\n }\n )\n \n @return \\FOS\\RestBundle\\View\\View\n /'
  $line = ' /'
  $matches = array ()
  $method = class ReflectionMethod { public $name = 'getProfilesAction'; public $class = 'Project\\Bundle\\ApiBundle\\Controller\\ProfilesController' }
  $paramDocs = array ()
  $route = class Symfony\Component\Routing\Route { private $pattern = '/profiles.{_format}'; private $defaults = array ('_controller' => 'Project\\Bundle\\ApiBundle\\Controller\\ProfilesController::getProfilesAction', '_format' => 'json'); private $requirements = array ('_method' => 'GET'); private $options = array ('compiler_class' => 'Symfony\\Component\\Routing\\RouteCompiler'); private $compiled = NULL }

@Seldaek
Copy link
Member

Seldaek commented Apr 20, 2012

Well, I don't think we can support 2.0 unless we fork it into a branch and start doing a lot of ugly hackery. There is a bunch of missing features in 2.0 that we leverage in this code.

If you'd like to use 2.1 prerelease from master, you can start off from https://github.com/symfony/symfony-standard and then reintegrate your project. That said, there are a bunch of Form changes going on at the moment which aren't especially fun to deal with, so if you need to be productive I'd recommend waiting for 2.1 final and then try our bundle later.

@Seldaek Seldaek closed this as completed Apr 20, 2012
@HelloGrayson
Copy link
Author

darn :) - any clue when 2.1 is going to be seeing the light of day? weeks/months?

@Seldaek
Copy link
Member

Seldaek commented Apr 22, 2012

Weeks I'd hope. Lots of stuff happening lately so I don't know. But let's hope by Symfony Live Paris it'll be out, or latest it will be out there, I guess.

@willdurand
Copy link
Collaborator

@breerly a 1.0.x branch has been created, it's 2.0 compatible :)

@HelloGrayson
Copy link
Author

ooooooooooh :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants