Skip to content

Commit bde85d5

Browse files
feat: Run setup checks by category or class
Signed-off-by: Josh <josh.t.richards@gmail.com>
1 parent d5b6ce4 commit bde85d5

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

lib/private/SetupCheck/SetupCheckManager.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,31 @@ public function __construct(
2222
private LoggerInterface $logger,
2323
) {
2424
}
25-
25+
26+
public function runClass(): array {
27+
if (str_starts_with($limitClass, '\\')) {
28+
$limitClass = substr($limitClass, 1);
29+
}
30+
return $this->run($limitClass);
31+
}
32+
33+
public function runCategory(): array {
34+
return $this->run($limitCategory);
35+
}
36+
2637
public function runAll(): array {
38+
return $this->run();
39+
}
40+
41+
private function run(?string $limit = null): array {
2742
$results = [];
2843
$setupChecks = $this->coordinator->getRegistrationContext()->getSetupChecks();
2944
foreach ($setupChecks as $setupCheck) {
3045
/** @var ISetupCheck $setupCheckObject */
3146
$setupCheckObject = Server::get($setupCheck->getService());
47+
if (isset($limit) && $limit !== $setupCheckObject->getCategory() && $limit !== get_class($setupCheckObject)) {
48+
continue;
49+
}
3250
$this->logger->debug('Running check ' . get_class($setupCheckObject));
3351
try {
3452
$setupResult = $setupCheckObject->run();

0 commit comments

Comments
 (0)