We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 961c848 commit b5f319bCopy full SHA for b5f319b
src/MenuItem/AsciiArtItem.php
@@ -44,7 +44,7 @@ public function __construct(string $text, string $position = self::POSITION_CENT
44
$this->setText($text);
45
$this->position = $position;
46
$this->alternateText = $alt;
47
- $this->artLength = max(array_map('mb_strlen', explode("\n", $text)));
+ $this->calculateArtLength();
48
}
49
50
/**
@@ -111,6 +111,14 @@ public function setText(string $text) : void
111
}, explode("\n", $text)));
112
113
114
+ /**
115
+ * Calculate the length of the art
116
+ */
117
+ private function calculateArtLength() : void
118
+ {
119
+ $this->artLength = max(array_map('mb_strlen', explode("\n", $this->text)));
120
+ }
121
+
122
123
* Return the length of the art
124
*/
0 commit comments