Skip to content

Commit ae1d19c

Browse files
committed
wip
1 parent 49f0e6b commit ae1d19c

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

packages/view/src/Elements/ElementFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ private function makeElement(Token $token, ?Element $parent): ?Element
8989
}
9090

9191
if ($viewComponentClass === AnonymousViewComponent::class) {
92-
throw new \Exception($token->tag . ' not resolved');
92+
$attributes = implode(' ', $attributes);
93+
throw new \Exception($token->tag . ' ' . $attributes . ' not resolved');
9394
}
9495

9596
if (! ($viewComponentClass instanceof ViewComponent)) {

packages/view/src/ViewComponentDiscovery.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,10 @@ public function discoverPath(DiscoveryLocation $location, string $path): void
4949

5050
preg_match('/(?<header>(.|\n)*?)<x-component name="(?<name>[\w\-]+)">/', $contents->toString(), $matches);
5151

52-
if (isset($matches['name'])) {
53-
$view = $contents
54-
->replaceRegex('/^(.|\n)*?<x-component.*>/', '')
55-
->replaceRegex('/<\/x-component>$/', '')
56-
->toString();
57-
} else {
58-
$view = $contents->toString();
59-
}
52+
$view = $contents
53+
->replaceRegex('/^(.|\n)*?<x-component.*>/', '')
54+
->replaceRegex('/<\/x-component>$/', '')
55+
->toString();
6056

6157
if ($fileName->startsWith('x-') && ! isset($matches['name'])) {
6258
$this->discoveryItems->add($location, [

0 commit comments

Comments
 (0)