Skip to content

Commit c3a8b88

Browse files
author
Andrei Onita
committed
ConfigProviderTest updated and blocks of comments removed
1 parent ec1ea50 commit c3a8b88

5 files changed

Lines changed: 8 additions & 17 deletions

File tree

src/Annotation/Inject.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,14 @@
1313
*/
1414
class Inject
1515
{
16-
/** @var array */
17-
private $services = [];
16+
private array $services = [];
1817

19-
/**
20-
* @param array $values
21-
*/
2218
public function __construct(array $values)
2319
{
2420
$this->services = $values['value'] ?? [];
2521
}
2622

27-
/**
28-
* @return array
29-
*/
30-
public function getServices(): array
23+
public function getServices()
3124
{
3225
return $this->services;
3326
}

src/Factory/AbstractAnnotatedFactory.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
abstract class AbstractAnnotatedFactory
1717
{
1818
protected const CACHE_SERVICE = 'Dot\AnnotatedServices\Cache';
19-
20-
/** @var Reader */
21-
protected $annotationReader;
19+
protected ?Reader $annotationReader;
2220

2321
public function setAnnotationReader(Reader $annotationReader): void
2422
{

src/Factory/AnnotatedServiceAbstractFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public function canCreate(ContainerInterface $container, $requestedName): bool
3939

4040
/**
4141
* @param string $requestedName
42-
* @param array|null $options
4342
*/
4443
public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null): object
4544
{

src/Factory/AnnotatedServiceFactory.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public function createObject(ContainerInterface $container, string $requestedNam
8484
}
8585

8686
/**
87-
* @return array
8887
* @throws ContainerExceptionInterface
8988
* @throws NotFoundExceptionInterface
9089
*/
@@ -115,9 +114,6 @@ protected function getServicesToInject(ContainerInterface $container, Inject $in
115114
return $services;
116115
}
117116

118-
/**
119-
* @param array $keys
120-
*/
121117
protected function readKeysFromArray(array $keys, mixed $array): mixed
122118
{
123119
$key = array_shift($keys);

test/ConfigProviderTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace DotTest\AnnotatedServices;
66

77
use Dot\AnnotatedServices\ConfigProvider;
8+
use Dot\AnnotatedServices\Factory\AnnotatedServiceAbstractFactory;
89
use PHPUnit\Framework\TestCase;
910

1011
class ConfigProviderTest extends TestCase
@@ -24,5 +25,9 @@ public function testHasDependencies(): void
2425
public function testDependenciesHasFactories(): void
2526
{
2627
$this->assertArrayHasKey('abstract_factories', $this->config['dependencies']);
28+
$this->assertContainsEquals(
29+
AnnotatedServiceAbstractFactory::class,
30+
$this->config['dependencies']['abstract_factories']
31+
);
2732
}
2833
}

0 commit comments

Comments
 (0)