getAttributes(Channel::class, \ReflectionAttribute::IS_INSTANCEOF); if ($attributes !== []) { return $attributes[0]->newInstance()->name; } if ($class->getParentClass() !== false) { return $this->getClassChannelName($class->getParentClass()); } return null; } public function getParameterChannelName(\ReflectionParameter $parameter): ?string { $attributes = $parameter->getAttributes(Channel::class, \ReflectionAttribute::IS_INSTANCEOF); if ($attributes !== []) { return $attributes[0]->newInstance()->name; } return null; } }