-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed: Refactoring and housekeeping
- Loading branch information
Showing
7 changed files
with
423 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
parameters: | ||
phpVersion: 80100 | ||
level: 8 | ||
paths: | ||
- src | ||
parallel: | ||
maximumNumberOfProcesses: 1 | ||
checkGenericClassInNonGenericObjectType: false | ||
ignoreErrors: | ||
- | ||
message: '%Template type T of method Zaphyr\\Container\\Container::(get\(\)) is not referenced in a parameter.%' | ||
path: src/Container.php | ||
- | ||
message: '%Template type T of method Zaphyr\\Container\\Contracts\\ContainerInterface::(resolve\(\)) is not referenced in a parameter.%' | ||
path: src/Contracts/ContainerInterface.php | ||
- | ||
message: '%Cannot call method getName\(\) on ReflectionClass\|null.%' | ||
path: src/Utils/Reflector.php | ||
- | ||
message: '%Parameter \\#1 \\$objectOrClass of class ReflectionClass constructor expects class\\-string\\<T of object\\>\\|T of object, string given.%' | ||
path: src/Utils/Reflector.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Zaphyr\Container\Contracts; | ||
|
||
use Closure; | ||
use Psr\Container\ContainerInterface as PsrContainerInterface; | ||
use Zaphyr\Container\Exceptions\ContainerException; | ||
|
||
/** | ||
* @author merloxx <merloxx@zaphyr.org> | ||
*/ | ||
interface ContainerInterface extends PsrContainerInterface | ||
{ | ||
/** | ||
* @param string $alias | ||
* @param Closure|string|null $concrete | ||
* @param bool $shared | ||
* | ||
* @return void | ||
*/ | ||
public function bind(string $alias, Closure|string|null $concrete = null, bool $shared = false): void; | ||
|
||
/** | ||
* @template T | ||
* | ||
* @param class-string<T>|string $alias | ||
* | ||
* @throws ContainerException | ||
* @return mixed | ||
*/ | ||
public function resolve(string $alias): mixed; | ||
|
||
/** | ||
* @param string $alias | ||
* | ||
* @return bool | ||
*/ | ||
public function isShared(string $alias): bool; | ||
|
||
/** | ||
* @param array<mixed>|string|Closure $callable | ||
* @param array<mixed> $parameters | ||
* | ||
* @throws ContainerException | ||
* @return mixed | ||
*/ | ||
public function call(array|string|Closure $callable, array $parameters = []): mixed; | ||
|
||
/** | ||
* @param string[]|string $aliases | ||
* @param string[] $tags | ||
* | ||
* @return void | ||
*/ | ||
public function tag(array|string $aliases, array $tags): void; | ||
|
||
/** | ||
* @param string $tag | ||
* | ||
* @throws ContainerException | ||
* @return iterable<mixed> | ||
*/ | ||
public function tagged(string $tag): iterable; | ||
|
||
/** | ||
* @param string $alias | ||
* @param Closure $closure | ||
* | ||
* @return void | ||
*/ | ||
public function extend(string $alias, Closure $closure): void; | ||
} |
Oops, something went wrong.