This repository was archived by the owner on Jul 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 11 files changed +161
-18
lines changed Expand file tree Collapse file tree 11 files changed +161
-18
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: pipeline
22on : pull_request
33
44jobs :
5- pipeline :
5+ tests :
66 runs-on : ubuntu-latest
77 strategy :
88 matrix :
2828 - name : Install PHP Dependencies
2929 run : composer install --no-scripts
3030
31+ - name : Tests
32+ run : vendor/bin/phpunit
33+
34+ qa :
35+ runs-on : ubuntu-latest
36+ steps :
37+ - name : Checkout
38+ uses : actions/checkout@v4
39+
40+ - name : Setup PHP
41+ uses : shivammathur/setup-php@v2
42+ with :
43+ php-version : ' 8.2'
44+
45+ - name : Install Composer
46+ uses : " ramsey/composer-install@v3"
47+
48+ - name : Composer Validation
49+ run : composer validate --strict
50+
51+ - name : Install PHP Dependencies
52+ run : composer install --no-scripts
53+
3154 - name : Code Style PHP
3255 run : vendor/bin/php-cs-fixer fix --dry-run
3356
Original file line number Diff line number Diff line change 11vendor
22composer.lock
33.php-cs-fixer.cache
4+ .phpunit.cache
5+ coverage
Original file line number Diff line number Diff line change 22 composer update --prefer-stable
33 vendor/bin/php-cs-fixer fix
44 vendor/bin/phpstan
5+ vendor/bin/phpunit
56
67qa-lowest :
78 composer update --prefer-lowest
89 vendor/bin/php-cs-fixer fix
910 vendor/bin/phpstan
11+ vendor/bin/phpunit
12+
13+ qa-dev :
14+ composer require php-llm/llm-chain:dev-main
15+ vendor/bin/php-cs-fixer fix
16+ vendor/bin/phpstan
17+ vendor/bin/phpunit
18+ # revert
19+ git restore composer.json
20+
21+ coverage :
22+ XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html=coverage
Original file line number Diff line number Diff line change 11{
22 "name" : " php-llm/llm-chain-bundle" ,
3+ "type" : " symfony-bundle" ,
34 "description" : " Symfony integration bundle for php-llm/llm-chain" ,
45 "license" : " MIT" ,
5- "type" : " symfony-bundle" ,
66 "authors" : [
77 {
88 "name" : " Christopher Hertel" ,
1818 },
1919 "require-dev" : {
2020 "php-cs-fixer/shim" : " ^3.64" ,
21- "phpstan/phpstan" : " ^1.12"
21+ "phpstan/phpstan" : " ^1.12" ,
22+ "phpunit/phpunit" : " ^11.3"
23+ },
24+ "config" : {
25+ "sort-packages" : true
2226 },
23- "minimum-stability" : " dev" ,
24- "prefer-stable" : true ,
2527 "autoload" : {
2628 "psr-4" : {
2729 "PhpLlm\\ LlmChainBundle\\ " : " src/"
2830 }
29- }
31+ },
32+ "autoload-dev" : {
33+ "psr-4" : {
34+ "PhpLlm\\ LlmChainBundle\\ Tests\\ " : " tests/"
35+ }
36+ },
37+ "minimum-stability" : " dev" ,
38+ "prefer-stable" : true
3039}
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/11.3/phpunit.xsd"
4+ bootstrap =" vendor/autoload.php"
5+ cacheDirectory =" .phpunit.cache"
6+ executionOrder =" depends,defects"
7+ shortenArraysForExportThreshold =" 10"
8+ requireCoverageMetadata =" true"
9+ beStrictAboutCoverageMetadata =" true"
10+ beStrictAboutOutputDuringTests =" true"
11+ colors =" true"
12+ displayDetailsOnPhpunitDeprecations =" true"
13+ failOnPhpunitDeprecation =" true"
14+ failOnRisky =" true"
15+ failOnWarning =" true" >
16+ <testsuites >
17+ <testsuite name =" default" >
18+ <directory >tests</directory >
19+ </testsuite >
20+ </testsuites >
21+
22+ <source ignoreIndirectDeprecations =" true" restrictNotices =" true" restrictWarnings =" true" >
23+ <include >
24+ <directory >src</directory >
25+ </include >
26+ </source >
27+ </phpunit >
Original file line number Diff line number Diff line change 1818use PhpLlm \LlmChain \Store \StoreInterface ;
1919use PhpLlm \LlmChain \Store \VectorStoreInterface ;
2020use PhpLlm \LlmChain \ToolBox \AsTool ;
21- use PhpLlm \LlmChainBundle \DataCollector ;
22- use PhpLlm \LlmChainBundle \TraceableLanguageModel ;
23- use PhpLlm \LlmChainBundle \TraceableToolBox ;
21+ use PhpLlm \LlmChainBundle \Profiler \ DataCollector ;
22+ use PhpLlm \LlmChainBundle \Profiler \ TraceableLanguageModel ;
23+ use PhpLlm \LlmChainBundle \Profiler \ TraceableToolBox ;
2424use Symfony \Component \Config \FileLocator ;
2525use Symfony \Component \DependencyInjection \ChildDefinition ;
2626use Symfony \Component \DependencyInjection \ContainerBuilder ;
Original file line number Diff line number Diff line change 22
33declare (strict_types=1 );
44
5- namespace PhpLlm \LlmChainBundle ;
5+ namespace PhpLlm \LlmChainBundle \ Profiler ;
66
77use PhpLlm \LlmChain \ToolBox \Metadata ;
88use Symfony \Bundle \FrameworkBundle \DataCollector \AbstractDataCollector ;
1717final class DataCollector extends AbstractDataCollector
1818{
1919 /**
20- * @var list< TraceableLanguageModel>
20+ * @var TraceableLanguageModel[]
2121 */
2222 private readonly array $ llms ;
2323
@@ -27,7 +27,7 @@ final class DataCollector extends AbstractDataCollector
2727 public function __construct (
2828 #[AutowireIterator('llm_chain.traceable_llm ' )]
2929 iterable $ llms ,
30- private TraceableToolBox $ toolBox ,
30+ private readonly TraceableToolBox $ toolBox ,
3131 ) {
3232 $ this ->llms = $ llms instanceof \Traversable ? iterator_to_array ($ llms ) : $ llms ;
3333 }
Original file line number Diff line number Diff line change 22
33declare (strict_types=1 );
44
5- namespace PhpLlm \LlmChainBundle ;
5+ namespace PhpLlm \LlmChainBundle \ Profiler ;
66
77use PhpLlm \LlmChain \LanguageModel ;
88use PhpLlm \LlmChain \Message \MessageBag ;
Original file line number Diff line number Diff line change 22
33declare (strict_types=1 );
44
5- namespace PhpLlm \LlmChainBundle ;
5+ namespace PhpLlm \LlmChainBundle \ Profiler ;
66
77use PhpLlm \LlmChain \Response \ToolCall ;
8- use PhpLlm \LlmChain \ToolBox \ToolBox ;
98use PhpLlm \LlmChain \ToolBox \ToolBoxInterface ;
109
1110/**
@@ -22,7 +21,7 @@ final class TraceableToolBox implements ToolBoxInterface
2221 public array $ calls = [];
2322
2423 public function __construct (
25- private ToolBox $ toolRegistry ,
24+ private ToolBoxInterface $ toolRegistry ,
2625 ) {
2726 }
2827
Original file line number Diff line number Diff line change 2525use PhpLlm \LlmChain \ToolBox \ToolAnalyzer ;
2626use PhpLlm \LlmChain \ToolBox \ToolBox ;
2727use PhpLlm \LlmChain \ToolBox \ToolBoxInterface ;
28- use PhpLlm \LlmChainBundle \DataCollector ;
29- use PhpLlm \LlmChainBundle \TraceableToolBox ;
28+ use PhpLlm \LlmChainBundle \Profiler \ DataCollector ;
29+ use PhpLlm \LlmChainBundle \Profiler \ TraceableToolBox ;
3030
3131return static function (ContainerConfigurator $ container ) {
3232 $ container ->services ()
You can’t perform that action at this time.
0 commit comments