mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-06-15 21:54:54 +02:00
19 lines
369 B
PHP
19 lines
369 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DesignPatterns\More\EAV;
|
|
|
|
class Value implements \Stringable
|
|
{
|
|
public function __construct(private Attribute $attribute, private string $name)
|
|
{
|
|
$attribute->addValue($this);
|
|
}
|
|
|
|
public function __toString(): string
|
|
{
|
|
return sprintf('%s: %s', (string) $this->attribute, $this->name);
|
|
}
|
|
}
|