Skip to content

Commit 03dd01f

Browse files
committed
add nette di utils
1 parent 20c9161 commit 03dd01f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Doctrine/EntityFinderByPrimary.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function addValidator(callable $validator): self
8181
}
8282

8383
/**
84-
* @template T
84+
* @template T of object
8585
* @param class-string<T> $class
8686
* @param mixed[] $checkParameters
8787
* @return T|null
@@ -96,7 +96,7 @@ public function getEntityIfParameterPresented(string $class): ?object
9696
}
9797

9898
/**
99-
* @template T
99+
* @template T of object
100100
* @param class-string<T> $class
101101
* @param mixed[] $checkParameters
102102
* @return T|null
@@ -145,7 +145,7 @@ public function getNullableEntity(string $class): ?object
145145
}
146146

147147
/**
148-
* @template T
148+
* @template T of object
149149
* @param class-string<T> $class
150150
* @param mixed[] $checkParameters
151151
* @return T

src/Strict/NetteDIStrict.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ public static function getServiceDefinitionByType(ContainerBuilder $builder, str
1818
{
1919
return Strict::instanceOf($builder->getDefinitionByType($type), ServiceDefinition::class);
2020
}
21+
public static function addServiceDefinition(ContainerBuilder $builder, string $name): ServiceDefinition
22+
{
23+
return Strict::instanceOf($builder->addDefinition($name), ServiceDefinition::class);
24+
}
2125

2226
public static function getFactoryDefinitionByType(ContainerBuilder $builder, string $type): FactoryDefinition
2327
{

0 commit comments

Comments
 (0)