Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
| MultiListItem | |
0.00% |
0 / 5 |
|
0.00% |
0 / 4 |
20 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| __toString | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getPrefix | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace CirrusSearch\Extra\MultiList; |
| 4 | |
| 5 | /** |
| 6 | * Item of a `super_detect_noop`-handled `multilist`. |
| 7 | * |
| 8 | * @see https://gerrit.wikimedia.org/r/plugins/gitiles/search/extra/+/refs/heads/master/docs/super_detect_noop.md |
| 9 | */ |
| 10 | class MultiListItem { |
| 11 | |
| 12 | public const DELIMITER = '/'; |
| 13 | |
| 14 | private string $prefix; |
| 15 | |
| 16 | private string $name; |
| 17 | |
| 18 | /** |
| 19 | * @param string $prefix Prefix |
| 20 | * @param string $name Name |
| 21 | */ |
| 22 | public function __construct( string $prefix, string $name ) { |
| 23 | $this->prefix = $prefix; |
| 24 | $this->name = $name; |
| 25 | } |
| 26 | |
| 27 | public function __toString() { |
| 28 | return $this->prefix . self::DELIMITER . $this->name; |
| 29 | } |
| 30 | |
| 31 | public function getPrefix(): string { |
| 32 | return $this->prefix; |
| 33 | } |
| 34 | |
| 35 | public function getName(): string { |
| 36 | return $this->name; |
| 37 | } |
| 38 | |
| 39 | } |