Symfony\Component\DependencyInjection\ContainerBuilder::findTags PHP Method

findTags() public method

Returns all tags the defined services use.
public findTags ( ) : array
return array An array of tags
    public function findTags()
    {
        $tags = array();
        foreach ($this->getDefinitions() as $id => $definition) {
            $tags = array_merge(array_keys($definition->getTags()), $tags);
        }

        return array_unique($tags);
    }

Usage Example

 public function testServicesDefinitionTest()
 {
     $this->createFullConfiguration();
     $tags = $this->configuration->findTags();
     $this->assertEquals('form.type', $tags[0]);
     $taggedServices = $this->configuration->findTaggedServiceIds($tags[0]);
     $this->assertTrue(isset($taggedServices['acme_cart.cart.form.type']));
     $this->assertEquals('leaphly_cart', $taggedServices['acme_cart.cart.form.type'][0]['alias']);
     $this->assertTrue(isset($taggedServices['acme_cart.cart.limited.form.type']));
     $this->assertEquals('leaphly_cart_limited', $taggedServices['acme_cart.cart.limited.form.type'][0]['alias']);
 }
All Usage Examples Of Symfony\Component\DependencyInjection\ContainerBuilder::findTags