Skip to content

Commit 901c9d9

Browse files
briedisoscarotero
authored andcommitted
Fix when max() fails if array is empty. (#185)
1 parent 3c5b135 commit 901c9d9

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Extractors/VueJs.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ private static function getTemplateAttributeFakeJs(array $options, DOMElement $d
141141
{
142142
$expressionsByLine = self::getVueAttributeExpressions($options['attributePrefixes'], $dom);
143143

144+
if (empty($expressionsByLine)) {
145+
return '';
146+
}
147+
144148
$maxLines = max(array_keys($expressionsByLine));
145149
$fakeJs = '';
146150

0 commit comments

Comments
 (0)