}> */ private array $groups; /** @var string[] */ private array $paragraphs; /** * CreditsSection object constructor. * * @param array{'title': string, 'anchor': string, 'subsection'?: array, * 'group'?: array, * 'name': string}>, * 'paragraph'?: string[]} $data */ public function __construct(array $data) { parent::__construct($data); $this->groups = []; $this->paragraphs = []; if (isset($data['group'])) { foreach ($data['group'] as $value) { $persons = []; foreach ($value['person'] as $args) { $persons[] = new Person($args); } if (count($persons) > 0) { $this->groups[] = array( 'name' => $value['name'], 'persons' => $persons, ); } } } if (isset($data['paragraph'])) { $this->paragraphs = $data['paragraph']; } } /** * Get the optional list of groups. * * @return array}> */ public function getGroups(): array { return $this->groups; } /** * Get the optional list of paragraphs. * * @return string[] */ public function getParagraphs(): array { return $this->paragraphs; } }