Skip to content

Commit 149fb4e

Browse files
committed
Apply fixes from StyleCI
1 parent ce5b2b1 commit 149fb4e

File tree

1 file changed

+32
-33
lines changed

1 file changed

+32
-33
lines changed

src/InitialAvatar.php

+32-33
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace LasseRafn\InitialAvatarGenerator;
44

5-
use Intervention\Image\AbstractFont;
65
use Intervention\Image\Image;
76
use Intervention\Image\ImageManager;
87
use LasseRafn\InitialAvatarGenerator\Translator\Base;
@@ -636,43 +635,43 @@ protected function getTranslator()
636635
*
637636
* @return Image
638637
*/
639-
protected function makeAvatar($image)
640-
{
641-
$width = $this->getWidth();
642-
$height = $this->getHeight();
643-
$bgColor = $this->getBackgroundColor();
644-
$name = $this->getInitials();
645-
$fontFile = $this->findFontFile();
646-
$color = $this->getColor();
647-
$fontSize = $this->getFontSize();
638+
protected function makeAvatar($image)
639+
{
640+
$width = $this->getWidth();
641+
$height = $this->getHeight();
642+
$bgColor = $this->getBackgroundColor();
643+
$name = $this->getInitials();
644+
$fontFile = $this->findFontFile();
645+
$color = $this->getColor();
646+
$fontSize = $this->getFontSize();
648647

649-
if ($this->getRounded() && $this->getSmooth()) {
650-
$width *= 5;
651-
$height *= 5;
652-
}
648+
if ($this->getRounded() && $this->getSmooth()) {
649+
$width *= 5;
650+
$height *= 5;
651+
}
653652

654-
$avatar = $image->canvas($width, $height, !$this->getRounded() ? $bgColor : null);
653+
$avatar = $image->canvas($width, $height, !$this->getRounded() ? $bgColor : null);
655654

656-
if ($this->getRounded()) {
657-
$avatar = $avatar->circle($width - 2, $width / 2, $height / 2, function ($draw) use ($bgColor) {
658-
return $draw->background($bgColor);
659-
});
660-
}
655+
if ($this->getRounded()) {
656+
$avatar = $avatar->circle($width - 2, $width / 2, $height / 2, function ($draw) use ($bgColor) {
657+
return $draw->background($bgColor);
658+
});
659+
}
661660

662-
if ($this->getRounded() && $this->getSmooth()) {
663-
$width /= 5;
664-
$height /= 5;
665-
$avatar->resize($width, $height);
666-
}
661+
if ($this->getRounded() && $this->getSmooth()) {
662+
$width /= 5;
663+
$height /= 5;
664+
$avatar->resize($width, $height);
665+
}
667666

668-
return $avatar->text($name, $width / 2, $height / 2, function ($draw) use ($width, $color, $fontFile, $fontSize) {
669-
$draw->file($fontFile);
670-
$draw->size($width * $fontSize);
671-
$draw->color($color);
672-
$draw->align('center');
673-
$draw->valign('center');
674-
});
675-
}
667+
return $avatar->text($name, $width / 2, $height / 2, function ($draw) use ($width, $color, $fontFile, $fontSize) {
668+
$draw->file($fontFile);
669+
$draw->size($width * $fontSize);
670+
$draw->color($color);
671+
$draw->align('center');
672+
$draw->valign('center');
673+
});
674+
}
676675

677676
/**
678677
* @return SVG

0 commit comments

Comments
 (0)