diff --git a/src/Roave/SecurityAdvisories/AdvisorySources/GetAdvisoriesFromGithubApi.php b/src/Roave/SecurityAdvisories/AdvisorySources/GetAdvisoriesFromGithubApi.php index 405dc8c4..430fcaf3 100644 --- a/src/Roave/SecurityAdvisories/AdvisorySources/GetAdvisoriesFromGithubApi.php +++ b/src/Roave/SecurityAdvisories/AdvisorySources/GetAdvisoriesFromGithubApi.php @@ -35,13 +35,15 @@ use SensitiveParameter; use UnexpectedValueException; +use function in_array; + final class GetAdvisoriesFromGithubApi implements GetAdvisories { private const IGNORED_ADVISORIES = [ 'GHSA-7q22-x757-cmgc', // @see https://phpc.social/@wouterj/113588554019692959 - 'GHSA-cg28-v4wq-whv5' // @see https://phpc.social/@wouterj/113588554019692959 + 'GHSA-cg28-v4wq-whv5', // @see https://phpc.social/@wouterj/113588554019692959 ]; - private const GRAPHQL_QUERY = 'query { + private const GRAPHQL_QUERY = 'query { securityVulnerabilities(ecosystem: COMPOSER, first: 100 %s) { edges { cursor @@ -90,6 +92,7 @@ public function __invoke(): Generator // Skip withdrawn advisories. continue; } + if (in_array($item['node']['advisory']['ghsaId'], self::IGNORED_ADVISORIES, true)) { // Skip ignored advisories. continue; diff --git a/test/RoaveTest/SecurityAdvisories/AdvisorySources/GetAdvisoriesFromGithubApiTest.php b/test/RoaveTest/SecurityAdvisories/AdvisorySources/GetAdvisoriesFromGithubApiTest.php index 66ccd0a8..c8e4e8c4 100644 --- a/test/RoaveTest/SecurityAdvisories/AdvisorySources/GetAdvisoriesFromGithubApiTest.php +++ b/test/RoaveTest/SecurityAdvisories/AdvisorySources/GetAdvisoriesFromGithubApiTest.php @@ -341,9 +341,7 @@ public function testWillSkipWithdrawnAdvisories(ResponseInterface ...$responses) ], Vec\Values($advisories())); } - /** - * @dataProvider correctResponseWithIgnoredAdvisories - */ + /** @dataProvider correctResponseWithIgnoredAdvisories */ public function testWillSkipIgnoredAdvisories(ResponseInterface ...$responses): void { $client = $this->createMock(Client::class);