@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class DiffusionExternalSymbolQuery extends Phobject {
4
5 private $languages = array();
6 private $types = array();
7 private $names = array();
8 private $contexts = array();
9 private $paths = array();
10 private $lines = array();
11 private $repositories = array();
12 private $characterPositions = array();
13
14 public function withLanguages(array $languages) {
15 $this->languages = $languages;
16 return $this;
17 }
18
19 public function withTypes(array $types) {
20 $this->types = $types;
21 return $this;
22 }
23
24 public function withNames(array $names) {
25 $this->names = $names;
26 return $this;
27 }
28
29 public function withContexts(array $contexts) {
30 $this->contexts = $contexts;
31 return $this;
32 }
33
34 public function withPaths(array $paths) {
35 $this->paths = $paths;
36 return $this;
37 }
38
39 public function withLines(array $lines) {
40 $this->lines = $lines;
41 return $this;
42 }
43
44 public function withCharacterPositions(array $positions) {
45 $this->characterPositions = $positions;
46 return $this;
47 }
48
49 /**
50 * @param array<PhabricatorRepository> $repositories
51 */
52 public function withRepositories(array $repositories) {
53 assert_instances_of($repositories, PhabricatorRepository::class);
54 $this->repositories = $repositories;
55 return $this;
56 }
57
58 public function getLanguages() {
59 return $this->languages;
60 }
61
62 public function getTypes() {
63 return $this->types;
64 }
65
66 public function getNames() {
67 return $this->names;
68 }
69
70 public function getContexts() {
71 return $this->contexts;
72 }
73
74 public function getPaths() {
75 return $this->paths;
76 }
77
78 public function getLines() {
79 return $this->lines;
80 }
81
82 public function getRepositories() {
83 return $this->repositories;
84 }
85
86 public function getCharacterPositions() {
87 return $this->characterPositions;
88 }
89
90 public function matchesAnyLanguage(array $languages) {
91 return (!$this->languages) || array_intersect($languages, $this->languages);
92 }
93
94 public function matchesAnyType(array $types) {
95 return (!$this->types) || array_intersect($types, $this->types);
96 }
97}