Skip to content

Commit 2d8bdbc

Browse files
SychO9StyleCIBot
andauthored
feat(mentions,tags): tag mentions (#3769)
* feat: add tag search Signed-off-by: Sami Mazouz <[email protected]> * feat(mentions): tag mentions backend Signed-off-by: Sami Mazouz <[email protected]> * feat: tag mention design Signed-off-by: Sami Mazouz <[email protected]> * refactor: revamp mentions autocomplete Signed-off-by: Sami Mazouz <[email protected]> * fix: unauthorized mention of hidden groups Signed-off-by: Sami Mazouz <[email protected]> * feat(mentions,tags): use hash format for tag mentions Signed-off-by: Sami Mazouz <[email protected]> * refactor: frontend mention format API with mentionable models Signed-off-by: Sami Mazouz <[email protected]> * feat: implement tag search on the frontend Signed-off-by: Sami Mazouz <[email protected]> * fix: tag color contrast Signed-off-by: Sami Mazouz <[email protected]> * fix: tag suggestions styling Signed-off-by: Sami Mazouz <[email protected]> * test: works with disabled tags extension Signed-off-by: Sami Mazouz <[email protected]> * chore: move `MentionFormats` to `formats` Signed-off-by: Sami Mazouz <[email protected]> * fix: mentions preview bad styling Signed-off-by: Sami Mazouz <[email protected]> * docs: further migration location clarification Signed-off-by: Sami Mazouz <[email protected]> * Apply fixes from StyleCI * fix: bad test namespace Signed-off-by: Sami Mazouz <[email protected]> * fix: phpstan Signed-off-by: Sami Mazouz <[email protected]> * fix: conditionally add tag related extenders Signed-off-by: Sami Mazouz <[email protected]> * Apply fixes from StyleCI * feat(phpstan): evaluate conditional extenders Signed-off-by: Sami Mazouz <[email protected]> * feat: use mithril routing for tag mentions Signed-off-by: Sami Mazouz <[email protected]> --------- Signed-off-by: Sami Mazouz <[email protected]> Co-authored-by: StyleCI Bot <[email protected]>
1 parent 04af6c4 commit 2d8bdbc

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/Extender/Resolver.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ private function resolveExtenders(): array
6868
}
6969

7070
/**
71+
* Retrieves all extenders from a given `extend.php` file.
72+
*
7173
* @return Extender[]
7274
* @throws ParserErrorsException
7375
* @throws \Exception
@@ -90,7 +92,22 @@ private function resolveExtendersFromFile($extenderFile): array
9092
if ($expression instanceof Array_) {
9193
foreach ($expression->items as $item) {
9294
if ($item->value instanceof MethodCall) {
93-
$extenders[] = $this->resolveExtender($item->value);
95+
// Conditional extenders
96+
if ($item->value->name->toString() === 'whenExtensionEnabled') {
97+
$conditionalExtenders = $item->value->args[1] ?? null;
98+
99+
if ($conditionalExtenders->value instanceof Array_) {
100+
foreach ($conditionalExtenders->value->items as $conditionalExtender) {
101+
if ($conditionalExtender->value instanceof MethodCall) {
102+
$extenders[] = $this->resolveExtender($conditionalExtender->value);
103+
}
104+
}
105+
}
106+
}
107+
// Normal extenders
108+
else {
109+
$extenders[] = $this->resolveExtender($item->value);
110+
}
94111
}
95112
}
96113
}

0 commit comments

Comments
 (0)