qqq
This commit is contained in:
@@ -283,6 +283,49 @@ class Container implements ContainerInterface
|
||||
}
|
||||
|
||||
|
||||
// public function resolveMethodParams(ReflectionMethod|ReflectionFunction $parameters): array
|
||||
// {
|
||||
// $params = [];
|
||||
// $numOfParameters = $parameters->getNumberOfParameters();
|
||||
// if ($numOfParameters < 1) {
|
||||
// return $params;
|
||||
// }
|
||||
//
|
||||
// foreach ($parameters->getParameters() as $parameter) {
|
||||
// $value = $this->getParameterValue($parameter);
|
||||
// $params[$parameter->getName()] = $value;
|
||||
// }
|
||||
//
|
||||
// return $params;
|
||||
// }
|
||||
//
|
||||
// private function getParameterValue(ReflectionParameter $parameter)
|
||||
// {
|
||||
// $parameterAttributes = $parameter->getAttributes();
|
||||
// if (count($parameterAttributes) > 0) {
|
||||
// $attribute = $parameterAttributes[0]->newInstance();
|
||||
// return $attribute->dispatch($parameter->getDeclaringClass()->getName(), $parameter->getDeclaringFunction()->getName());
|
||||
// }
|
||||
//
|
||||
// if ($parameter->isDefaultValueAvailable()) {
|
||||
// return $parameter->getDefaultValue();
|
||||
// }
|
||||
//
|
||||
// $type = $parameter->getType();
|
||||
//
|
||||
// if ($type === null) {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// $value = $type->getName();
|
||||
// if (class_exists($value) || interface_exists($value)) {
|
||||
// return $this->get($value);
|
||||
// }
|
||||
//
|
||||
// return $this->getTypeValue($parameter);
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* @param ReflectionMethod|ReflectionFunction $parameters
|
||||
* @return array
|
||||
|
||||
+4
-2
@@ -7,7 +7,7 @@ namespace Kiri\Di;
|
||||
|
||||
use Exception;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Config\ConfigProvider;
|
||||
use Kiri\Di\Inject\Skip;
|
||||
use ReflectionException;
|
||||
|
||||
@@ -77,11 +77,12 @@ class Scanner extends Component
|
||||
/**
|
||||
* @param string $path
|
||||
* @return void
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function load_dir(string $path): void
|
||||
{
|
||||
$dir = new \DirectoryIterator($path);
|
||||
$skip = Config::get('scanner.skip', []);
|
||||
$skip = \config('scanner.skip', []);
|
||||
foreach ($dir as $value) {
|
||||
if ($value->isDot() || str_starts_with($value->getFilename(), '.')) {
|
||||
continue;
|
||||
@@ -101,6 +102,7 @@ class Scanner extends Component
|
||||
/**
|
||||
* @param string $path
|
||||
* @return void
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function load_file(string $path): void
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user