Skip to content

Commit

Permalink
Updated bundle to maintain the compatibility with NelmioApiDocBundle …
Browse files Browse the repository at this point in the history
…2.8.0
  • Loading branch information
benatespina committed May 25, 2015
1 parent 7631be6 commit 6bb07da
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,15 @@ public function process(ContainerBuilder $container)
foreach ($container->findTaggedServiceIds('nelmio_api_doc.extractor.handler') as $id => $attributes) {
$handlers[] = new Reference($id);
}
$annotationProviders = [];
foreach ($container->findTaggedServiceIds('nelmio_api_doc.extractor.annotations_provider') as $id => $attributes) {
$annotationProviders[] = new Reference($id);
}
$container
->getDefinition('kreta_simple_api_doc.extractor.api_doc_extractor')
->replaceArgument(5, $handlers);
$container
->getDefinition('kreta_simple_api_doc.extractor.api_doc_extractor')
->replaceArgument(4, $handlers);
->replaceArgument(6, $annotationProviders);
}
}
27 changes: 20 additions & 7 deletions Extractor/ApiDocExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Doctrine\Common\Annotations\Reader;
use Kreta\SimpleApiDocBundle\Parser\ValidationParser;
use ReflectionMethod;
use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser;
use Symfony\Component\Routing\Route;
use Nelmio\ApiDocBundle\Extractor\ApiDocExtractor as BaseApiDocExtractor;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
Expand All @@ -40,23 +41,35 @@ class ApiDocExtractor extends BaseApiDocExtractor
/**
* Constructor.
*
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container The container
* @param \Symfony\Component\Routing\RouterInterface $router The router
* @param \Doctrine\Common\Annotations\Reader $reader The reader
* @param \Nelmio\ApiDocBundle\Util\DocCommentExtractor $commentExtractor The comment extractor
* @param array $handlers Array that contains handlers
* @param \Kreta\SimpleApiDocBundle\Parser\ValidationParser $validationParser The validation parser
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container The container
* @param \Symfony\Component\Routing\RouterInterface $router The router
* @param \Doctrine\Common\Annotations\Reader $reader The reader
* @param \Nelmio\ApiDocBundle\Util\DocCommentExtractor $commentExtractor The comment extractor
* @param \Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser $controllerNameParser Controller name parser
* @param array $handlers Array that contains handlers
* @param array $annotationsProviders Annotation providers
* @param \Kreta\SimpleApiDocBundle\Parser\ValidationParser $validationParser The validation parser
*/
public function __construct(
ContainerInterface $container,
RouterInterface $router,
Reader $reader,
DocCommentExtractor $commentExtractor,
ControllerNameParser $controllerNameParser,
array $handlers,
array $annotationsProviders,
ValidationParser $validationParser
)
{
parent::__construct($container, $router, $reader, $commentExtractor, $handlers);
parent::__construct(
$container,
$router,
$reader,
$commentExtractor,
$controllerNameParser,
$handlers,
$annotationsProviders
);
$this->validationParser = $validationParser;
}

Expand Down
5 changes: 3 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## License
License

The MIT License (MIT)

Copyright (c) 2015 **Kreta SimpleApiDocBundle** - by [gorka.lauzirika@gmail.com](mailto:gorka.lauzirika@gmail.com) and [benatespina@gmail.com](mailto:benatespina@gmail.com)
Copyright (c) 2015 Kreta Standard Edition - by gorkalaucirica and benatespina

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
2 changes: 2 additions & 0 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ services:
- @router.default
- @annotation_reader
- @nelmio_api_doc.doc_comment_extractor
- @nelmio_api_doc.controller_name_parser
- []
- []
- @kreta_simple_api_doc.parser.validation_parser
kreta_simple_api_doc.parser.validation_parser:
Expand Down

0 comments on commit 6bb07da

Please sign in to comment.