Skip to content

Commit ab99086

Browse files
authored
Moving calculateArtLength inside setText
1 parent b5f319b commit ab99086

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/MenuItem/AsciiArtItem.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public function __construct(string $text, string $position = self::POSITION_CENT
4444
$this->setText($text);
4545
$this->position = $position;
4646
$this->alternateText = $alt;
47-
$this->calculateArtLength();
4847
}
4948

5049
/**
@@ -109,6 +108,8 @@ public function setText(string $text) : void
109108
$this->text = implode("\n", array_map(function (string $line) {
110109
return rtrim($line, ' ');
111110
}, explode("\n", $text)));
111+
112+
$this->calculateArtLength();
112113
}
113114

114115
/**

0 commit comments

Comments
 (0)