*/ public array $labels = [], public bool $isGoodFirstIssue = false, public bool $isHelpWanted = false, public ?string $author = null, public ?string $assignee = null, public int $comments = 0, public ?CarbonImmutable $createdAt = null, public ?CarbonImmutable $updatedAt = null, ) {} /** * Decide whether a label set marks an issue as newcomer-friendly, using * the spellings configured in config/git.php. * * @param array $labels */ public static function matchesLabelGroup(array $labels, string $group): bool { $wanted = array_map('mb_strtolower', config("git.labels.{$group}", [])); $present = array_map('mb_strtolower', $labels); return array_intersect($wanted, $present) !== []; } /** * @return array */ public function toAttributes(): array { return [ 'number' => $this->number, 'title' => $this->title, 'html_url' => $this->htmlUrl, 'labels' => $this->labels, 'is_good_first_issue' => $this->isGoodFirstIssue, 'is_help_wanted' => $this->isHelpWanted, 'author' => $this->author, 'assignee' => $this->assignee, 'comments' => $this->comments, 'issue_created_at' => $this->createdAt, 'issue_updated_at' => $this->updatedAt, ]; } }