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

Commit 7556162

Browse files
committed
refactor: use imported Pattern class instead of FQCN
1 parent c013d01 commit 7556162

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

examples/fabric/summarize.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
declare(strict_types=1);
44

5+
use PhpLlm\FabricPattern\Pattern;
56
use PhpLlm\LlmChain\Chain\Chain;
67
use PhpLlm\LlmChain\Platform\Bridge\OpenAI\GPT;
78
use PhpLlm\LlmChain\Platform\Bridge\OpenAI\PlatformFactory;
@@ -15,7 +16,7 @@
1516
exit(1);
1617
}
1718

18-
if (!class_exists(\PhpLlm\FabricPattern\Pattern::class)) {
19+
if (!class_exists(Pattern::class)) {
1920
echo 'Fabric patterns are not installed. Please install them with: composer require php-llm/fabric-pattern'.\PHP_EOL;
2021
exit(1);
2122
}

examples/fabric/with-processor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
declare(strict_types=1);
44

5+
use PhpLlm\FabricPattern\Pattern;
56
use PhpLlm\LlmChain\Chain\Chain;
67
use PhpLlm\LlmChain\Platform\Bridge\OpenAI\GPT;
78
use PhpLlm\LlmChain\Platform\Bridge\OpenAI\PlatformFactory;
@@ -16,7 +17,7 @@
1617
exit(1);
1718
}
1819

19-
if (!class_exists(\PhpLlm\FabricPattern\Pattern::class)) {
20+
if (!class_exists(Pattern::class)) {
2021
echo 'Fabric patterns are not installed. Please install them with: composer require php-llm/fabric-pattern'.\PHP_EOL;
2122
exit(1);
2223
}

src/Platform/Fabric/FabricRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace PhpLlm\LlmChain\Platform\Fabric;
66

7+
use PhpLlm\FabricPattern\Pattern;
78
use PhpLlm\LlmChain\Platform\Fabric\Exception\PatternNotFoundException;
89

910
/**
@@ -22,7 +23,7 @@ public function __construct(?string $patternsPath = null)
2223
{
2324
if (null === $patternsPath) {
2425
// Check if Fabric patterns package is installed
25-
if (!class_exists(\PhpLlm\FabricPattern\Pattern::class)) {
26+
if (!class_exists(Pattern::class)) {
2627
throw new \RuntimeException('Fabric patterns not found. Please install the "php-llm/fabric-pattern" package: composer require php-llm/fabric-pattern');
2728
}
2829

0 commit comments

Comments
 (0)