This commit is contained in:
Daniel Winning 2025-05-04 12:45:48 +01:00
parent 4ba8e59f24
commit 956e25d39a
6 changed files with 19 additions and 13 deletions

View file

@ -4,12 +4,12 @@
<!-- Version Badge -->
<img src="https://img.shields.io/badge/Version-1.0.0-blue" alt="Version 1.0.0">
<!-- PHP Coverage Badge -->
<img src="https://img.shields.io/badge/PHP%20Coverage-96.36%25-green" alt="PHP Coverage 96.36%">
<img src="https://img.shields.io/badge/PHP%20Coverage-92.98%25-green" alt="PHP%20Coverage 92.98%">
<!-- License Badge -->
<img src="https://img.shields.io/badge/License-GPL--3.0--or--later-34ad9b" alt="License GPL--3.0--or--later">
</p>
A PHP package for managing dependencies and dependency injection.
<p>A PHP package for managing dependencies and dependency injection.</p>
---

View file

@ -29,6 +29,6 @@
"email": "daniel@winningsoftware.co.uk"
}
],
"version": "1.3.0",
"version": "1.0.0",
"license": "GPL-3.0-or-later"
}

6
spinner.yaml Normal file
View file

@ -0,0 +1,6 @@
options:
environment:
server:
enabled: false
database:
enabled: false

View file

@ -6,5 +6,5 @@ namespace Loom\DependencyInjectionComponent;
abstract class AbstractParameterResolver
{
abstract public function resolve(string $parameter): string|int|array;
abstract public function resolve(string $parameter): string|int|array|bool|float|null;
}

View file

@ -6,10 +6,12 @@ namespace Loom\DependencyInjectionComponent;
use Symfony\Component\Yaml\Yaml;
class DependencyManager
readonly class DependencyManager
{
public function __construct(private DependencyContainer $container, private ?AbstractParameterResolver $parameterResolver = null)
{
public function __construct(
private readonly DependencyContainer $container,
private readonly ?AbstractParameterResolver $parameterResolver = null
) {
}
/**

View file

@ -1,17 +1,15 @@
<?php
declare(strict_types=1);
namespace Loom\DependencyInjectionComponent\Exception;
use Psr\Container\NotFoundExceptionInterface;
class NotFoundException extends \Exception implements NotFoundExceptionInterface
{
public function __construct(string $message = 'Entry not found', int $code = 0, \Throwable $previous = null)
public function __construct(string $message = 'Entry not found', int $code = 0, ?\Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
}
}