krak / symfony-util
Symfony Utilities for various components
Installs: 6 984
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires (Dev)
- symfony/dependency-injection: ^4.0
- symfony/kernel: ^4.0
This package is auto-updated.
Last update: 2024-11-29 06:01:35 UTC
README
Symfony util provides common utilies and extensions that promote certain styles of developing symfony apps.
Installation
Install with composer at krak/symfony-util
.
Usage
DependencyInjection
createLoader
Creates a fully featured delegating loader similar to the default loader created in the root Kernel class. This is useful simplifying the configuration and imports for Apps with multiple bundles.
registerTaggedServiceLocator
Performs the boiler plate of registering a service locator of a specific for a specific service.
createServiceReferenceMapFromTaggedIds
Creates a reference map to be used for a ServiceLocator from a set of taggedIds and an optional keyAttribute to search the tags and use as the key. If no keyAttribute is provided or if no tags contain that key, then it just defaults to use the id as the reference map keys.
pickLastAttributeFromTags
When finding registered tags, symfony will return an array of tags per id. There are times when you just want to pick out one attribute from the tags, but you need to do it from the last defined tag. This method handles that for you.