$this->retention, 'password' => $this->password, 'duplicate' => $this->duplicate, 'completion' => $this->completion, 'disabledCategory' => $this->disabledCategory, 'categoryMinSize' => $this->categoryMinSize, 'disabledGenre' => $this->disabledGenre, 'miscOther' => $this->miscOther, 'miscHashed' => $this->miscHashed, ]; if (isset($values[$field])) { $values[$field]++; } return new self(...$values); } /** * Get the total number of deleted releases. */ public function total(): int { return $this->retention + $this->password + $this->duplicate + $this->completion + $this->disabledCategory + $this->categoryMinSize + $this->disabledGenre + $this->miscOther + $this->miscHashed; } /** * Convert to array representation. * * @return array */ public function toArray(): array { return [ 'retention' => $this->retention, 'password' => $this->password, 'duplicate' => $this->duplicate, 'completion' => $this->completion, 'disabledCategory' => $this->disabledCategory, 'categoryMinSize' => $this->categoryMinSize, 'disabledGenre' => $this->disabledGenre, 'miscOther' => $this->miscOther, 'miscHashed' => $this->miscHashed, ]; } /** * Create from an array of values. * * @param array $data */ public static function fromArray(array $data): self { return new self( retention: $data['retention'] ?? 0, password: $data['password'] ?? 0, duplicate: $data['duplicate'] ?? 0, completion: $data['completion'] ?? 0, disabledCategory: $data['disabledCategory'] ?? 0, categoryMinSize: $data['categoryMinSize'] ?? 0, disabledGenre: $data['disabledGenre'] ?? 0, miscOther: $data['miscOther'] ?? 0, miscHashed: $data['miscHashed'] ?? 0, ); } }