diff --git a/src/App.php b/src/App.php index cef71b1..3a01f64 100644 --- a/src/App.php +++ b/src/App.php @@ -27,7 +27,6 @@ use think\Model as ThinkModel; use InvalidArgumentException; use Psr\Container\ContainerExceptionInterface; -use Psr\Container\ContainerInterface; use Psr\Container\NotFoundExceptionInterface; use ReflectionClass; use ReflectionException; diff --git a/src/Container.php b/src/Container.php index ef39377..f722a88 100644 --- a/src/Container.php +++ b/src/Container.php @@ -2,7 +2,6 @@ namespace Webman; -use Psr\Container\ContainerInterface; use Webman\Exception\NotFoundException; use function array_key_exists; use function class_exists; @@ -75,7 +74,7 @@ public function make(string $name, array $constructor = []) * @param array $definitions * @return $this */ - public function addDefinitions(array $definitions): Container + public function addDefinitions(array $definitions): static { $this->definitions = array_merge($this->definitions, $definitions); return $this; diff --git a/src/ContainerInterface.php b/src/ContainerInterface.php new file mode 100644 index 0000000..94eaaa6 --- /dev/null +++ b/src/ContainerInterface.php @@ -0,0 +1,39 @@ + + * @copyright walkor + * @link http://www.workerman.net/ + * @license http://www.opensource.org/licenses/mit-license.php MIT License + */ + +namespace Webman; + +use Webman\Exception\NotFoundException; +use Psr\Container\ContainerInterface as PsrInterface; + +interface ContainerInterface extends PsrInterface +{ + /** + * Make. + * @param string $name + * @param array $constructor + * @return mixed + * @throws NotFoundException + */ + public function make(string $name, array $constructor = []); + + + /** + * AddDefinitions. + * @param array $definitions + * @return $this + */ + public function addDefinitions(array $definitions): static; + +}