name] = ['class' => $item['class'], 'property' => $item['property'], 'transform' => $item['annotation']->transform]; } $records = []; foreach ($names as $name) { if (isset($properties[$name])) { $property = $properties[$name]; $items = $property['class']::${$property['property']}; if ($property['transform']) { foreach ($items as $key => $value) { $records[$name][] = ['key' => $key, 'value' => $value]; } } else { $records[$name] = $items; } } } return $records; } private static function getFromMethods(array $names, int $language): array { $items = AnnotationCollector::getMethodsByAnnotation(DictAnnotation::class); $methods = []; foreach ($items as $item) { $methods[$item['annotation']->name] = ['class' => $item['class'], 'method' => $item['method']]; } $records = []; foreach ($names as $name) { if (isset($methods[$name])) { $method = $methods[$name]; $object = make($method['class']); if ($language > 0) { $records[$name] = $object->{$method['method']}($language); } else { $records[$name] = $object->{$method['method']}(); } } } return $records; } }