chore: Аннотации к типам

This commit is contained in:
origami11@yandex.ru 2025-10-23 15:54:14 +03:00
parent 530a3b931d
commit 730a608f9b
27 changed files with 491 additions and 134 deletions

View file

@ -9,7 +9,9 @@ use GdImage;
class TemplateImage
{
/** @var array<string, string> */
static array $listfiles = array('jpg' => 'jpeg', 'gif' => 'gif', 'png' => 'png', 'bmp' => 'wbmp');
/** @var array<string, string> */
static array $listfonts = array(
'georgia' => 'georgia.ttf',
'georgiabd' => 'georgiab.ttf',
@ -68,7 +70,7 @@ class TemplateImage
$this->base = $path;
}
function set(string $name, $value)
function set(string $name, $value): void
{
$this->context['['.$name.']'] = $value;
}
@ -79,6 +81,11 @@ class TemplateImage
$this->image = $this->imagefromfile($name);
}
/**
* Создает пустое изображение
* @param int $width
* @param int $height
*/
function setEmptyImage($width, $height): void
{
$this->image = imagecreatetruecolor($width, $height);
@ -86,6 +93,8 @@ class TemplateImage
/**
* Создает изображение из файла
* @param string $file
* @return GdImage|null
*/
function imagefromfile(string $file)
{