spreadsheet = $condition; return $this; } public function isSpreadsheet(): bool { return $this->evaluate($this->spreadsheet) ?? false; } protected function setUp(): void { parent::setUp(); $this->extraAttributes(function (): array { $attributes = []; if ($this->isSpreadsheet()) { $attributes['class'] = 'is-spreadsheet'; } return $attributes; }); } }