This commit is contained in:
2023-12-12 15:35:35 +08:00
parent ef3555eca1
commit 1d3c255be8
3 changed files with 31 additions and 33 deletions
+10 -10
View File
@@ -87,7 +87,7 @@ class Container implements ContainerInterface
/**
* @param string $id
* @return mixed
* @throws Exception
* @throws
*/
public function get(string $id): object
{
@@ -103,7 +103,7 @@ class Container implements ContainerInterface
/**
* @param string $id
* @return object
* @throws ReflectionException
* @throws
*/
public function parse(string $id): object
{
@@ -140,7 +140,7 @@ class Container implements ContainerInterface
/**
* @param string $className
* @return ReflectionClass
* @throws ReflectionException
* @throws
*/
public function getReflectionClass(string $className): ReflectionClass
{
@@ -156,7 +156,7 @@ class Container implements ContainerInterface
* @param array $construct
* @param array $config
* @return object|null
* @throws ReflectionException
* @throws
*/
public function make(string $className, array $construct = [], array $config = []): ?object
{
@@ -253,7 +253,7 @@ class Container implements ContainerInterface
* @param string $className
* @param string $method
* @return ReflectionMethod
* @throws ReflectionException
* @throws
*/
public function getMethod(string $className, string $method): ReflectionMethod
{
@@ -266,7 +266,7 @@ class Container implements ContainerInterface
/**
* @param string $className
* @return ReflectionMethod[]
* @throws ReflectionException
* @throws
*/
public function getMethods(string $className): array
{
@@ -279,7 +279,7 @@ class Container implements ContainerInterface
/**
* @param ReflectionMethod $parameters
* @return array
* @throws ReflectionException
* @throws
*/
public function getMethodParams(ReflectionMethod $parameters): array
{
@@ -297,7 +297,7 @@ class Container implements ContainerInterface
/**
* @param Closure $parameters
* @return array
* @throws ReflectionException
* @throws
*/
public function getFunctionParams(Closure $parameters): array
{
@@ -308,7 +308,7 @@ class Container implements ContainerInterface
/**
* @param ReflectionMethod|ReflectionFunction $parameters
* @return array
* @throws ReflectionException|Exception
* @throws
*/
public function resolveMethodParams(ReflectionMethod|ReflectionFunction $parameters): array
{
@@ -335,7 +335,7 @@ class Container implements ContainerInterface
/**
* @param $parameter
* @return bool|int|mixed|object|string|null
* @throws Exception
* @throws
*/
protected function contractParams($parameter): mixed
{
+2 -3
View File
@@ -4,7 +4,6 @@ declare(strict_types=1);
namespace Kiri\Di\Inject;
use Exception;
use Kiri\Di\Interface\InjectPropertyInterface;
use Kiri\Di\Container as DContainer;
@@ -16,7 +15,7 @@ class Container implements InjectPropertyInterface
/**
* @param string $service
* @param mixed|null $default
* @throws Exception
* @throws
*/
public function __construct(readonly public string $service, public mixed $default = null)
{
@@ -27,7 +26,7 @@ class Container implements InjectPropertyInterface
* @param object $class
* @param string $property
* @return void
* @throws Exception
* @throws
*/
public function dispatch(object $class, string $property): void
{
+3 -4
View File
@@ -9,7 +9,6 @@ use Kiri\Di\Inject\Container;
use Kiri\Abstracts\Component;
use Kiri\Di\Inject\Skip;
use Psr\Container\ContainerInterface;
use ReflectionException;
use ReflectionMethod;
class Scanner extends Component
@@ -26,7 +25,7 @@ class Scanner extends Component
/**
* @param string $path
* @return void
* @throws ReflectionException
* @throws
*/
public function load_directory(string $path): void
{
@@ -67,7 +66,7 @@ class Scanner extends Component
/**
* @param string $path
* @return void
* @throws ReflectionException
* @throws
*/
private function load_file(string $path): void
{
@@ -85,7 +84,7 @@ class Scanner extends Component
/**
* @param $file
* @return void
* @throws ReflectionException
* @throws
*/
protected function parseFile($file): void
{