Skip to content

Commit ce46d16

Browse files
committed
feat: ajout de l'interface du conteneur
1 parent 45bb2f1 commit ce46d16

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Container/ContainerInterface.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
/**
4+
* This file is part of Blitz PHP framework.
5+
*
6+
* (c) 2022 Dimitri Sitchet Tomkeu <devcode.dst@gmail.com>
7+
*
8+
* For the full copyright and license information, please view
9+
* the LICENSE file that was distributed with this source code.
10+
*/
11+
12+
namespace BlitzPHP\Contracts\Container;
13+
14+
use Psr\Container\ContainerInterface as PsrContainerInterface;
15+
16+
interface ContainerInterface extends PsrContainerInterface
17+
{
18+
/**
19+
* Détermine si le type abstrait donné a été lié.
20+
*/
21+
public function bound(string $abstract): bool;
22+
23+
/**
24+
* Résoudre le type donné à partir du conteneur.
25+
*
26+
* @template T
27+
* @param string|class-string<T> $absstract
28+
* @param array $parameters
29+
*/
30+
public function make(string $abstract, array $parameters = []): mixed;
31+
32+
/**
33+
* Appeler la Closure / class::method donnée et injecter ses dépendances.
34+
*/
35+
public function call(callable|string $callback, array $parameters = []): mixed;
36+
}

0 commit comments

Comments
 (0)