Skip to content

Commit ee773bc

Browse files
committed
-
1 parent 280929c commit ee773bc

File tree

6 files changed

+41
-10
lines changed

6 files changed

+41
-10
lines changed

demo/.php-cs-fixer.dist.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use PhpCsFixer\Config;
6+
use PhpCsFixer\Finder;
7+
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
8+
9+
return (new Config())
10+
->setParallelConfig(ParallelConfigFactory::detect()) // @TODO 4.0 no need to call this manually
11+
->setRiskyAllowed(false)
12+
->setRules([
13+
'@auto' => true
14+
])
15+
// 💡 by default, Fixer looks for `*.php` files excluding `./vendor/` - here, you can groom this config
16+
->setFinder(
17+
(new Finder())
18+
// 💡 root folder to check
19+
->in(__DIR__)
20+
// 💡 additional files, eg bin entry file
21+
// ->append([__DIR__.'/bin-entry-file'])
22+
// 💡 folders to exclude, if any
23+
// ->exclude([/* ... */])
24+
// 💡 path patterns to exclude, if any
25+
// ->notPath([/* ... */])
26+
// 💡 extra configs
27+
// ->ignoreDotFiles(false) // true by default in v3, false in v4 or future mode
28+
// ->ignoreVCSIgnored(true) // true by default
29+
)
30+
;

demo/src/Blog/Chat.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ public function __construct(
3232
public function loadMessages(): MessageBag
3333
{
3434
$messages = new MessageBag(
35-
Message::forSystem(<<<PROMPT
36-
You are an helpful assistant that knows about the latest blog content of the Symfony's framework website.
37-
To search for content you use the tool 'similarity_search' for generating the answer. Only use content
38-
that you get from searching with that tool or your previous answers. Don't make up information and if you
39-
can't find something, just say so. Also provide links to the blog posts you use as sources.
40-
PROMPT
35+
Message::forSystem(
36+
<<<PROMPT
37+
You are an helpful assistant that knows about the latest blog content of the Symfony's framework website.
38+
To search for content you use the tool 'similarity_search' for generating the answer. Only use content
39+
that you get from searching with that tool or your previous answers. Don't make up information and if you
40+
can't find something, just say so. Also provide links to the blog posts you use as sources.
41+
PROMPT
4142
)
4243
);
4344

demo/src/Mcp/ResourceTemplates/CurrentTimeResourceTemplate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CurrentTimeResourceTemplate
2222
public function getTimeByTimezone(string $timezone): array
2323
{
2424
try {
25-
$time = (new \DateTime('now', new \DateTimeZone($timezone)))->format('Y-m-d H:i:s T');
25+
$time = new \DateTime('now', new \DateTimeZone($timezone))->format('Y-m-d H:i:s T');
2626
} catch (\Exception $e) {
2727
$time = 'Invalid timezone: '.$timezone;
2828
}

demo/src/Mcp/Resources/CurrentTimeResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function getCurrentTimeResource(): array
2424
return [
2525
'uri' => 'time://current',
2626
'mimeType' => 'text/plain',
27-
'text' => (new \DateTime('now'))->format('Y-m-d H:i:s T'),
27+
'text' => new \DateTime('now')->format('Y-m-d H:i:s T'),
2828
];
2929
}
3030
}

demo/src/Mcp/Tools/CurrentTimeTool.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public function getCurrentTime(string $format = 'Y-m-d H:i:s'): string
3434
{
3535
$this->logger->info('CurrentTimeTool called', ['format' => $format]);
3636

37-
return (new \DateTime('now', new \DateTimeZone('UTC')))->format($format);
37+
return new \DateTime('now', new \DateTimeZone('UTC'))->format($format);
3838
}
3939
}

demo/tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) {
2020
require dirname(__DIR__).'/config/bootstrap.php';
2121
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
22-
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
22+
new Dotenv()->bootEnv(dirname(__DIR__).'/.env');
2323
}

0 commit comments

Comments
 (0)