Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit 862d3ae

Browse files
committed
fix: check for Pattern class existence instead of directory structure
1 parent 35c00e9 commit 862d3ae

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Platform/Fabric/FabricRepository.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@ class FabricRepository
2121
public function __construct(?string $patternsPath = null)
2222
{
2323
if (null === $patternsPath) {
24-
// Check if fabric-pattern package is installed
24+
// Check if fabric-pattern package is installed by checking for its Pattern class
25+
if (!class_exists(\PhpLlm\FabricPattern\Pattern::class)) {
26+
throw new \RuntimeException('Fabric patterns not found. Please install the "php-llm/fabric-pattern" package: composer require php-llm/fabric-pattern');
27+
}
28+
2529
$fabricPatternPath = \dirname(__DIR__, 4).'/fabric-pattern/patterns';
2630
if (is_dir($fabricPatternPath)) {
2731
$this->patternsPath = $fabricPatternPath;
2832
} else {
29-
throw new \RuntimeException('Fabric patterns not found. Please install the "php-llm/fabric-pattern" package: composer require php-llm/fabric-pattern');
33+
throw new \RuntimeException('Fabric patterns directory not found at expected location');
3034
}
3135
} else {
3236
$this->patternsPath = $patternsPath;

0 commit comments

Comments
 (0)