Skip to content

This library will fetch information about all the tagged services in the Symfony DIC

License

Notifications You must be signed in to change notification settings

egulias/TagDebug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tag debug for Symfony2 DIC Events Build Status Coverage Status Scrutinizer Code Quality

This library will fetch information about all the tagged services

Installation and configuration

Get the lib

php composer.phar require egulias/tags-debug

Use

Basic usage

<?php

use Egulias\TagDebug\Tag\TagFetcher;
use Egulias\TagDebug\Tag\FilterList;
use Symfony\Component\DependencyInjection\ContainerBuilder;

$containerBuilder = new ContainerBuilder;
$fetcher = new TagFetcher($containerBuilder);

$filters = new FilterList();
$tags = $fetcher->fetch($filters);

$tags will have one key for each tag name:

$tags['tag-name']['Class\Name\Of\Service']['tag'] = Egulias\TagDebug\Tag\Tag
$tags['tag-name']['Class\Name\Of\Service']['definition'] = Symfony\Component\DependencyInjection\Definition

Filtering

Currently filters work in an "AND" fashion, which means that the Tag must comply every filter.

<?php

use Egulias\TagDebug\Tag\TagFetcher;
use Egulias\TagDebug\Tag\FilterList;
use Egulias\TagDebug\Tag\Filter\Name;
use Symfony\Component\DependencyInjection\ContainerBuilder;

$containerBuilder = new ContainerBuilder;
$fetcher = new TagFetcher($containerBuilder);

$filters = new FilterList();
$filters->addFilter(new Name("nameToFilterFor"));
$tags = $fetcher->fetch($filters);

You can implement your own filters by implementing Egulias\TagDebug\Tag\Filter and then adding it to the filter list.

About

This library will fetch information about all the tagged services in the Symfony DIC

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages