From 212ea8655e7e121d3d46746fd0a68175a00fc729 Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Fri, 29 Sep 2017 16:00:09 +0200 Subject: [PATCH] Expose di tags as consts for PHP config autocompletion --- .../FrameworkExtension.php | 2 + .../FrameworkBundle/Resources/di/tags.php | 62 +++++++++++++++++++ .../DependencyInjection/SecurityExtension.php | 2 + .../SecurityBundle/Resources/di/tags.php | 14 +++++ .../DependencyInjection/TwigExtension.php | 2 + .../Bundle/TwigBundle/Resources/di/tags.php | 16 +++++ 6 files changed, 98 insertions(+) create mode 100644 src/Symfony/Bundle/FrameworkBundle/Resources/di/tags.php create mode 100644 src/Symfony/Bundle/SecurityBundle/Resources/di/tags.php create mode 100644 src/Symfony/Bundle/TwigBundle/Resources/di/tags.php diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index dafecf9d581d6..78ffb501cf827 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -11,6 +11,8 @@ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection; +require_once __DIR__.'/../Resources/di/tags.php'; + use Doctrine\Common\Annotations\Reader; use Symfony\Bridge\Monolog\Processor\DebugProcessor; use Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand; diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/di/tags.php b/src/Symfony/Bundle/FrameworkBundle/Resources/di/tags.php new file mode 100644 index 0000000000000..8e5712f8f645b --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/di/tags.php @@ -0,0 +1,62 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader\Configurator\tag { + const AUTO_ALIAS = 'auto_alias'; + const DATA_COLLECTOR = 'data_collector'; +} + +namespace Symfony\Component\DependencyInjection\Loader\Configurator\tag\config_cache { + const RESOURCE_CHECKER = 'config_cache.resource_checker'; +} + +namespace Symfony\Component\DependencyInjection\Loader\Configurator\tag\console { + const COMMAND = 'console.command'; +} + +namespace Symfony\Component\DependencyInjection\Loader\Configurator\tag\container { + const ENV_VAR_PROCESSOR = 'container.env_var_processor'; + const SERVICE_SUBSCRIBER = 'container.service_subscriber'; +} + +namespace Symfony\Component\DependencyInjection\Loader\Configurator\tag\controller { + const ARGUMENT_VALUE_RESOLVER = 'controller.argument_value_resolver'; + const SERVICE_ARGUMENTS = 'controller.service_arguments'; +} + +namespace Symfony\Component\DependencyInjection\Loader\Configurator\tag\form { + const TYPE = 'form.type'; + const TYPE_GUESSER = 'form.type_guesser'; +} + +namespace Symfony\Component\DependencyInjection\Loader\Configurator\tag\kernel { + const CACHE_CLEARER = 'kernel.cache_clearer'; + const CACHE_WARMER = 'kernel.cache_warmer'; + const EVENT_SUBSCRIBER = 'kernel.event_subscriber'; + const RESET = 'kernel.reset'; +} + +namespace Symfony\Component\DependencyInjection\Loader\Configurator\tag\property_info { + const ACCESS_EXTRACTOR = 'property_info.access_extractor'; + const DESCRIPTION_EXTRACTOR = 'property_info.description_extractor'; + const LIST_EXTRACTOR = 'property_info.list_extractor'; + const TYPE_EXTRACTOR = 'property_info.type_extractor'; +} + +namespace Symfony\Component\DependencyInjection\Loader\Configurator\tag\serializer { + const ENCODER = 'serializer.encoder'; + const NORMALIZER = 'serializer.normalizer'; +} + +namespace Symfony\Component\DependencyInjection\Loader\Configurator\tag\validator { + const CONSTRAINT_VALIDATOR = 'validator.constraint_validator'; + const INITIALIZER = 'validator.initializer'; +} diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index 45ab00ac47871..516fbfce892b8 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -11,6 +11,8 @@ namespace Symfony\Bundle\SecurityBundle\DependencyInjection; +require_once __DIR__.'/../Resources/di/tags.php'; + use Symfony\Bundle\SecurityBundle\Command\InitAclCommand; use Symfony\Bundle\SecurityBundle\Command\SetAclCommand; use Symfony\Bundle\SecurityBundle\Command\UserPasswordEncoderCommand; diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/di/tags.php b/src/Symfony/Bundle/SecurityBundle/Resources/di/tags.php new file mode 100644 index 0000000000000..e86ce63b25693 --- /dev/null +++ b/src/Symfony/Bundle/SecurityBundle/Resources/di/tags.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader\Configurator\tag\security; + +const VOTER = 'security.voter'; diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php index 3beb9b5cf98c1..18cb11c8854ca 100644 --- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php +++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php @@ -11,6 +11,8 @@ namespace Symfony\Bundle\TwigBundle\DependencyInjection; +require_once __DIR__.'/../Resources/di/tags.php'; + use Symfony\Bridge\Twig\Extension\WebLinkExtension; use Symfony\Component\Config\FileLocator; use Symfony\Component\Config\Resource\FileExistenceResource; diff --git a/src/Symfony/Bundle/TwigBundle/Resources/di/tags.php b/src/Symfony/Bundle/TwigBundle/Resources/di/tags.php new file mode 100644 index 0000000000000..724c66c41bd17 --- /dev/null +++ b/src/Symfony/Bundle/TwigBundle/Resources/di/tags.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader\Configurator\tag\twig; + +const EXTENSION = 'twig.extension'; +const LOADER = 'twig.loader'; +const RUNTIME = 'twig.runtime';