bridges: add context to detectParameters (#3607)

* bridges: add context to detectParameters

Some bridges did not return the context parameter but they used it in
the parameters

* bridges: add context to detectParameters

Fix test for InstagramBridge
This commit is contained in:
sysadminstory 2023-08-09 22:40:24 +02:00 committed by GitHub
parent 6cc4cf24dc
commit 52d3cce59d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 115 additions and 80 deletions

View file

@ -277,6 +277,7 @@ class GithubIssueBridge extends BridgeAbstract
case 2: // Project issues
[$user, $project] = $path_segments;
$show_comments = 'off';
$context = 'Project Issues';
break;
case 3: // Project issues with issue comments
if ($path_segments[2] !== static::URL_PATH) {
@ -284,15 +285,18 @@ class GithubIssueBridge extends BridgeAbstract
}
[$user, $project] = $path_segments;
$show_comments = 'on';
$context = 'Project Issues';
break;
case 4: // Issue comments
[$user, $project, /* issues */, $issue] = $path_segments;
$context = 'Issue comments';
break;
default:
return null;
}
return [
'context' => $context,
'u' => $user,
'p' => $project,
'c' => $show_comments ?? null,