| Total Complexity | 5 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class Registry implements RegistryInterface |
||
| 13 | { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var Generator[] |
||
| 17 | */ |
||
| 18 | protected $generators = []; |
||
| 19 | |||
| 20 | 50 | public function getGeneratorForField(FieldMetadata $fieldMetadata) |
|
| 21 | { |
||
| 22 | 50 | return $this->getGeneratorForLocale($fieldMetadata->configuration->locale); |
|
| 23 | } |
||
| 24 | |||
| 25 | 70 | public function getGeneratorForLocale(?string $locale = null): Generator |
|
| 26 | { |
||
| 27 | |||
| 28 | 70 | $locale = $locale ?? Factory::DEFAULT_LOCALE; |
|
| 29 | |||
| 30 | 70 | if(empty($this->generators[$locale])){ |
|
| 31 | 70 | $this->generators[$locale] = $this->instantiate($locale); |
|
| 32 | } |
||
| 33 | |||
| 34 | 70 | return $this->generators[$locale]; |
|
| 35 | |||
| 36 | } |
||
| 37 | |||
| 38 | 26 | public function getGuesserForLocale(?string $locale = null): Name{ |
|
| 43 | |||
| 44 | } |
||
| 45 | |||
| 46 | 70 | protected function instantiate($locale = null){ |
|
| 48 | } |
||
| 49 | |||
| 50 | } |