Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
abstract class ServiceProvider implements DefinitionSource
{
/**
* @return array
*/
abstract protected function definitions(): array;
/**
* {@inheritdoc}
*/
public function getDefinition($name): ?Definition
{
static $definitionArray;
if (!$definitionArray) {
$definitionArray = new DefinitionArray($this->definitions());
}
return $definitionArray->getDefinition($name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment