namespace App;
use MV\ServiceRegistryBundle\Registry\ServiceRegistryInterface;
class ClassUsingRegistry {
/**
* @param ServiceRegistryInterface<SomeInterface> $serviceRegistry
*/
public function __construct(
private ServiceRegistryInterface $serviceRegistry,
)
public function useAllFromRegistry(): void
{
foreach ($this->serviceRegistry->all() as $service) {
/* some logic here */
}
}
public function useCertainFromRegistry(): void
{
$service = $this->serviceRegistry->get(App\SomeClass::class);
/* some logic here */
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.