chore: Аннотации к типам
This commit is contained in:
parent
530a3b931d
commit
730a608f9b
27 changed files with 491 additions and 134 deletions
|
|
@ -60,7 +60,7 @@ class Drawing
|
|||
$max_height,
|
||||
$align,
|
||||
$valign
|
||||
) {
|
||||
): float {
|
||||
// echo $left,"\n", $top, "\n";
|
||||
// echo $max_width,"\n", $max_height, "\n";
|
||||
// self::drawrectnagle($image, $left, $top, $max_width, $max_height, array(0xFF,0,0));
|
||||
|
|
@ -136,7 +136,7 @@ class Drawing
|
|||
return $largest_line_height * count($lines);
|
||||
}
|
||||
|
||||
function imagettftextSp(GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font, string $text, int $spacing = 0)
|
||||
function imagettftextSp(GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font, string $text, int $spacing = 0): void
|
||||
{
|
||||
if ($spacing == 0) {
|
||||
imagettftext($image, $size, $angle, $x, $y, $color, $font, $text);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue