Skip to content

Commit

Permalink
Replaces $1 from generated readme with actual clients (matomo-org#7663)
Browse files Browse the repository at this point in the history
* Replaces $1 from readme with actual clients
* Improve code
  • Loading branch information
liviuconcioiu authored Oct 31, 2024
1 parent 6b6167f commit 727ac23
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Parser/Client/AbstractClientParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,27 @@ public static function getAvailableClients(): array
$names = [];

foreach ($regexes as $regex) {
if ('$1' === $regex['name']) {
if (false !== \strpos($regex['name'], '$1')) {
continue;
}

$names[] = $regex['name'];
}

if (static::class === MobileApp::class) {
$names = \array_merge($names, [
// Microsoft Office $1
'Microsoft Office Access', 'Microsoft Office Excel', 'Microsoft Office OneDrive for Business',
'Microsoft Office OneNote', 'Microsoft Office PowerPoint', 'Microsoft Office Project',
'Microsoft Office Publisher', 'Microsoft Office Visio', 'Microsoft Office Word',
// Podkicker$1
'Podkicker', 'Podkicker Pro', 'Podkicker Classic',
// radio.$1
'radio.at', 'radio.de', 'radio.dk', 'radio.es', 'radio.fr',
'radio.it', 'radio.pl', 'radio.pt', 'radio.se', 'radio.net',
]);
}

\natcasesort($names);

return \array_unique($names);
Expand Down

0 comments on commit 727ac23

Please sign in to comment.