The service the `\Drupal::service('x')->method()` on this reference's line asks for.
(ref: UnresolvedRef, method: string, context: ResolutionContext)
| 683 | |
| 684 | /** The service the `\Drupal::service('x')->method()` on this reference's line asks for. */ |
| 685 | function serviceOnLine(ref: UnresolvedRef, method: string, context: ResolutionContext): string | null { |
| 686 | const line = context.getFileLines?.(ref.filePath)?.[ref.line - 1] ?? ''; |
| 687 | for (const m of line.matchAll(/Drupal::service\(\s*['"]([\w.\\-]+)['"]\s*\)\s*->\s*(\w+)/g)) { |
| 688 | if (m[2] === method) return m[1]!; |
| 689 | } |
| 690 | return null; |
| 691 | } |
| 692 | |
| 693 | // --------------------------------------------------------------------------- |
| 694 | // Resolver |