This commit is contained in:
William DURAND 2013-11-14 10:28:42 +01:00
parent f94d6403f5
commit d7fd929379
13 changed files with 60 additions and 65 deletions

View File

@ -482,6 +482,7 @@ class ApiDoc
public function setDeprecated($deprecated)
{
$this->deprecated = (bool) $deprecated;
return $this;
}

View File

@ -15,7 +15,6 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Reference;
class ExtractorHandlerCompilerPass implements CompilerPassInterface
{
/**
@ -25,13 +24,11 @@ class ExtractorHandlerCompilerPass implements CompilerPassInterface
{
$handlers = array();
foreach ($container->findTaggedServiceIds('nelmio_api_doc.extractor.handler') as $id => $attributes) {
// Adding handlers from tagged services
$handlers[] = new Reference($id);
}
$definition = $container->getDefinition(
'nelmio_api_doc.extractor.api_doc_extractor'
);
$definition->replaceArgument(4, $handlers);
$container
->getDefinition('nelmio_api_doc.extractor.api_doc_extractor')
->replaceArgument(4, $handlers);
}
}

View File

@ -46,12 +46,12 @@ class ApiDocExtractor
private $commentExtractor;
/**
* @var array ParserInterface
* @var ParserInterface[]
*/
protected $parsers = array();
/**
* @var array HandlerInterface
* @var HandlerInterface[]
*/
protected $handlers;
@ -474,6 +474,7 @@ class ApiDocExtractor
$array[$name] = $this->clearClasses($item);
}
}
return $array;
}
}

View File

@ -7,7 +7,6 @@ use Nelmio\ApiDocBundle\Tests\Fixtures;
use Symfony\Component\Form\Extension\Core\CoreExtension;
use Symfony\Component\Form\FormFactory;
use Symfony\Component\Form\FormFactoryBuilder;
use Symfony\Component\Form\FormRegistry;
use Symfony\Component\Form\ResolvedFormTypeFactory;
class FormTypeParserTest extends \PHPUnit_Framework_TestCase

View File

@ -4,7 +4,6 @@ namespace NelmioApiDocBundle\Tests\Parser;
use Nelmio\ApiDocBundle\Tests\WebTestCase;
use Nelmio\ApiDocBundle\Parser\ValidationParser;
class ValidationParserTest extends WebTestCase
{
protected $handler;
@ -29,7 +28,6 @@ class ValidationParserTest extends WebTestCase
}
}
public function dataTestParser()
{
return array(

View File

@ -14,7 +14,6 @@ namespace Nelmio\ApiDocBundle\Tests;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\DependencyInjection\Scope;
abstract class WebTestCase extends BaseWebTestCase
{