feat : Proxy Subject and Database

This commit is contained in:
2025-09-07 11:37:13 +08:00
parent 7d489eecc4
commit 14ba4674ee
11 changed files with 367 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<?php
/**
* This service file is part of item.
*
* @author ctexthuang
* @contact ctexthuang@qq.com
* @web_site https://ctexthuang.com
*/
declare(strict_types=1);
namespace App\Service\Test\Proxy\Dynamic;
use App\Interface\Test\Decorator\LoggerInterface;
use App\Interface\Test\Proxy\DatabaseQueryInterface;
use Hyperf\Di\Annotation\Inject;
class RealDatabaseQueryService implements DatabaseQueryInterface
{
/**
* @var LoggerInterface
*/
#[Inject]
protected LoggerInterface $logger;
/**
* @param string $query
* @return string[]
*/
public function execute(string $query): array
{
$this->logger->log('Executing query: ' . $query . PHP_EOL);
return [
'result' => 'data',
'query' => $query,
];
}
}