This commit adds an Image interface and implementation that will be used in the Captcha generation process. The Image object includes methods for manipulating an image, such as adding text, inserting a background, and adding a line. These methods will provide the necessary functionalities for generating a Captcha.

This commit is contained in:
kor-elf committed 2023-06-28 17:22:19 +06:00
1 parent f6669e93dc
commit f2ecdfcf97
2 files changed
+155

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
<?php declare(strict_types=1);
namespace App\Captcha\Contracts;
use App\Captcha\Dto\Coordinators;
interface Image
{
public function __construct(int $width, int $height);
public function getWidth(): int;
public function getHeight(): int;
public function insertBackground(string $pathToFile): self;
public function addText(string $text, int $x, int $y, float $size, float $angle, string $hexColor, string $fontName): Coordinators;
public function addLine(int $x1, int $y1, int $x2, int $y2, string $hexColor): self;
public function encode(): string;
public function __destruct();
}