🎉 initial commit
This commit is contained in:
23
classes/Application/Generator/Image.php
Normal file
23
classes/Application/Generator/Image.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Application\Generator;
|
||||
|
||||
use Application\Generator\WebsiteObjectGenerator;
|
||||
|
||||
class Image extends WebsiteObjectGenerator
|
||||
{
|
||||
public function __construct(protected readonly string $seed)
|
||||
{
|
||||
parent::__construct($seed);
|
||||
}
|
||||
|
||||
public function getImage(int $width = 1280, int $height = 720): array
|
||||
{
|
||||
return [
|
||||
'src' => 'https://picsum.photos/seed/' . $this->seed . "/$width/$height",
|
||||
'width' => $width,
|
||||
'height' => $height,
|
||||
'alt' => $this->getGenerator()->sentence(),
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user