Revert "改名"

This reverts commit fdf58326
This commit is contained in:
2022-01-06 19:05:15 +08:00
parent 45319c3733
commit f867f4be9e
4 changed files with 131 additions and 31 deletions
+12
View File
@@ -0,0 +1,12 @@
<?php
namespace Kiri\Abstracts;
abstract class AbstractServer extends Component
{
public string $name = 'http';
}
+13 -3
View File
@@ -9,9 +9,7 @@ declare(strict_types=1);
namespace Kiri\Abstracts;
use Exception;
use Kiri\Exception\ConfigException;
use Kiri\Kiri;
/**
@@ -95,7 +93,19 @@ class Config extends Component
*/
public static function set($key, $value): mixed
{
return static::setData($key, $value);
$explode = explode('.', $key);
$parent = &static::$data;
foreach ($explode as $item) {
if (!isset($parent[$item])) {
$parent[$item] = [];
}
$parent = &$parent[$item];
}
$parent = $value;
unset($parent);
return static::$data;
}
/**
+1 -3
View File
@@ -9,7 +9,6 @@ declare(strict_types=1);
namespace Kiri\Di;
use Kiri\Abstracts\Component;
use Note\Inject;
use Closure;
use Exception;
@@ -79,8 +78,7 @@ class Container implements ContainerInterface
* @param array $constrict
* @param array $config
* @return mixed
* @throws ReflectionException
* @throws Exception
* @throws
*/
public function make($class, array $constrict = [], array $config = []): mixed
{