Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Webman;

use Psr\Container\ContainerInterface;
use Webman\Exception\NotFoundException;
use function array_key_exists;
use function class_exists;
Expand Down Expand Up @@ -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;
Expand Down
39 changes: 39 additions & 0 deletions src/ContainerInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @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;

}