mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
refactor: remove unnecessary comments
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
3b3a04877f
commit
74a4ae19ee
+1
-1
@@ -133,7 +133,7 @@ class Update extends Action
|
||||
$prFiles = $github->getPullRequestFiles($owner, $providerRepositoryName, $providerPullRequestId);
|
||||
$providerAffectedFiles = [
|
||||
...array_column($prFiles, 'filename'),
|
||||
...array_filter(array_column($prFiles, 'previous_filename')) // Filter out null values
|
||||
...array_filter(array_column($prFiles, 'previous_filename'))
|
||||
];
|
||||
|
||||
$this->createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, $providerBranchUrl, $providerRepositoryName, $providerRepositoryUrl, $providerRepositoryOwner, $providerCommitHash, $providerCommitAuthor, $providerCommitAuthorUrl, $providerCommitMessage, $providerCommitUrl, $providerPullRequestId, $providerAffectedFiles, true, $dbForPlatform, $authorization, $publisherForBuilds, $getProjectDB, $platform);
|
||||
|
||||
@@ -215,7 +215,7 @@ class Create extends Action
|
||||
$prFiles = $github->getPullRequestFiles($providerRepositoryOwner, $providerRepositoryName, $providerPullRequestId);
|
||||
$providerAffectedFiles = [
|
||||
...array_column($prFiles, 'filename'),
|
||||
...array_filter(array_column($prFiles, 'previous_filename')) // Filter out null values
|
||||
...array_filter(array_column($prFiles, 'previous_filename'))
|
||||
];
|
||||
|
||||
$repositories = $authorization->skip(fn () => $dbForPlatform->find('repositories', [
|
||||
|
||||
@@ -24,7 +24,6 @@ class BuildTrigger extends Validator
|
||||
$exclude = array_filter($this->patterns, fn ($p) => str_starts_with($p, '!'));
|
||||
|
||||
if (empty($include)) {
|
||||
// Only exclusions: pass everything unless excluded.
|
||||
foreach ($exclude as $pattern) {
|
||||
if ($this->matchGlob($value, substr($pattern, 1))) {
|
||||
return false;
|
||||
@@ -33,31 +32,26 @@ class BuildTrigger extends Validator
|
||||
return true;
|
||||
}
|
||||
|
||||
// A pattern is "specific" when it contains no wildcard characters.
|
||||
$isSpecific = fn ($pattern) => !str_contains($pattern, '*') && !str_contains($pattern, '?');
|
||||
|
||||
// 1. Specific inclusion always wins — an explicit exact match is never blocked.
|
||||
foreach ($include as $pattern) {
|
||||
if ($isSpecific($pattern) && $this->matchGlob($value, $pattern)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Any exclusion (specific or wildcard) overrides a wildcard inclusion — refines broad patterns.
|
||||
foreach ($exclude as $pattern) {
|
||||
if ($this->matchGlob($value, substr($pattern, 1))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Wildcard inclusion — no exclusion blocked it.
|
||||
foreach ($include as $pattern) {
|
||||
if (!$isSpecific($pattern) && $this->matchGlob($value, $pattern)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// No inclusion matched.
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user