Skip to content

Commit ac0242f

Browse files
committed
Use alias instead of __host__ in selector
1 parent 47b9850 commit ac0242f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Selector/Selector.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public static function apply(?array $conditions, Host $host): bool
4444
}
4545

4646
$labels = $host->get('labels', []);
47-
$labels['__host__'] = $host->getAlias();
48-
$labels['__all__'] = 'yes';
47+
$labels['alias'] = $host->getAlias();
48+
$labels['true'] = 'true';
4949
$isTrue = function ($value) {
5050
return $value;
5151
};
@@ -94,13 +94,13 @@ public static function parse(string $expression): array
9494
foreach (explode('&', $sub) as $part) {
9595
$part = trim($part);
9696
if ($part === 'all') {
97-
$conditions[] = ['=', '__all__', 'yes'];
97+
$conditions[] = ['=', 'true', 'true'];
9898
continue;
9999
}
100100
if (preg_match('/(?<var>.+?)(?<op>!?=)(?<value>.+)/', $part, $match)) {
101101
$conditions[] = [$match['op'], trim($match['var']), trim($match['value'])];
102102
} else {
103-
$conditions[] = ['=', '__host__', trim($part)];
103+
$conditions[] = ['=', 'alias', trim($part)];
104104
}
105105
}
106106
$all[] = $conditions;

0 commit comments

Comments
 (0)