File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55namespace Ock \DependencyInjection \Inspector ;
66
77use Ock \ClassDiscovery \Inspector \FactoryInspectorInterface ;
8- use Ock \ClassDiscovery \Reflection \FactoryReflectionInterface ;
8+ use Ock \ClassDiscovery \Reflection \ClassReflection ;
9+ use Ock \ClassDiscovery \Reflection \MethodReflection ;
910use Ock \DependencyInjection \Attribute \ServiceConditionAttributeInterface ;
1011use Symfony \Component \DependencyInjection \ContainerBuilder ;
1112
@@ -39,7 +40,7 @@ public static function create(FactoryInspectorInterface $decorated): static {
3940 /**
4041 * {@inheritdoc}
4142 */
42- public function findInFactory (FactoryReflectionInterface $ reflector ): \Iterator {
43+ public function findInFactory (ClassReflection | MethodReflection $ reflector ): \Iterator {
4344 $ attributes = $ reflector ->getAttributeInstances (ServiceConditionAttributeInterface::class);
4445 if ($ attributes ) {
4546 $ result = null ;
Original file line number Diff line number Diff line change 55namespace Ock \DependencyInjection ;
66
77use Ock \ClassDiscovery \Reflection \ClassReflection ;
8- use Ock \ClassDiscovery \Reflection \FactoryReflectionInterface ;
98use Ock \ClassDiscovery \Reflection \MethodReflection ;
109use Symfony \Component \DependencyInjection \Definition ;
1110use function Ock \Helpers \is_valid_qcn ;
@@ -23,10 +22,10 @@ class ServiceDefinitionUtil {
2322 * @param \Symfony\Component\DependencyInjection\Definition $definition
2423 * Service definition.
2524 *
26- * @return \Ock\ClassDiscovery\Reflection\FactoryReflectionInterface |null
27- * Factory reflection, or NULL if not applicable.
25+ * @return \Ock\ClassDiscovery\Reflection\ClassReflection|\Ock\ClassDiscovery\Reflection\MethodReflection |null
26+ * Class or method reflection, or NULL if not applicable.
2827 */
29- public static function getFactoryReflection (Definition $ definition ): ? FactoryReflectionInterface {
28+ public static function getFactoryReflection (Definition $ definition ): null | ClassReflection | MethodReflection {
3029 if ($ factory = $ definition ->getFactory ()) {
3130 if (!\is_array ($ factory )
3231 || \array_keys ($ factory ) !== [0 , 1 ]
You can’t perform that action at this time.
0 commit comments