| 1 |
<?php |
| 2 |
namespace Dompdf\Css\Content; |
| 3 |
|
| 4 |
final class Attr extends ContentPart |
| 5 |
{ |
| 6 |
/** |
| 7 |
* @var string |
| 8 |
*/ |
| 9 |
public $attribute; |
| 10 |
|
| 11 |
public function __construct(string $attribute) |
| 12 |
{ |
| 13 |
$this->attribute = $attribute; |
| 14 |
} |
| 15 |
|
| 16 |
public function equals(ContentPart $other): bool |
| 17 |
{ |
| 18 |
return $other instanceof self |
| 19 |
&& $other->attribute === $this->attribute; |
| 20 |
} |
| 21 |
|
| 22 |
public function __toString(): string |
| 23 |
{ |
| 24 |
return "attr($this->attribute)"; |
| 25 |
} |
| 26 |
} |
| 27 |
|