From d2cfb40689b32c975214c8f15357219f2336b76d Mon Sep 17 00:00:00 2001 From: GitHub Actions <> Date: Wed, 18 Oct 2023 10:50:37 +0000 Subject: [PATCH] Update src from PHP Codesniffer --- src/Service/EnrichPubliccodeService.php | 3 ++- src/Service/GithubPubliccodeService.php | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Service/EnrichPubliccodeService.php b/src/Service/EnrichPubliccodeService.php index 2193ddde..2ed8a2c6 100644 --- a/src/Service/EnrichPubliccodeService.php +++ b/src/Service/EnrichPubliccodeService.php @@ -99,7 +99,7 @@ public function getPubliccodeFromUrl(string $publiccodeUrl): ?array { // Get the path from the url to make the call. $endpoint = \Safe\parse_url($publiccodeUrl)['path']; - $source = $this->resourceService->getSource($this->configuration['usercontentSource'], 'open-catalogi/open-catalogi-bundle'); + $source = $this->resourceService->getSource($this->configuration['usercontentSource'], 'open-catalogi/open-catalogi-bundle'); try { $response = $this->callService->call($source, $endpoint); @@ -108,6 +108,7 @@ public function getPubliccodeFromUrl(string $publiccodeUrl): ?array } return $this->callService->decodeResponse($source, $response, 'text/yaml'); + }//end getPubliccodeFromUrl() diff --git a/src/Service/GithubPubliccodeService.php b/src/Service/GithubPubliccodeService.php index 806a23d8..2c2a6314 100644 --- a/src/Service/GithubPubliccodeService.php +++ b/src/Service/GithubPubliccodeService.php @@ -166,14 +166,14 @@ public function getRepositories(): ?array // Find on publiccode.yaml. $repositories = $this->callService->getAllResults($source, '/search/code', $queryConfig); - + $this->pluginLogger->debug('Found '.count($repositories).' repositories.', ['plugin' => 'open-catalogi/open-catalogi-bundle']); $repositoriesMapping = $this->resourceService->getMapping($this->configuration['repositoriesMapping'], 'open-catalogi/open-catalogi-bundle'); foreach ($repositories as $repository) { // Get the ref query from the url. This way we can get the publiccode file with the raw.gitgubusercontent - $publiccodeUrlQuery = \Safe\parse_url($repository['url'])['query']; - $repository['urlReference'] = explode('ref=', $publiccodeUrlQuery)[1]; + $publiccodeUrlQuery = \Safe\parse_url($repository['url'])['query']; + $repository['urlReference'] = explode('ref=', $publiccodeUrlQuery)[1]; $repository['repository']['name'] = str_replace('-', ' ', $repository['repository']['name']); $result[] = $this->importRepository($repository, $repository['repository']['id'], $repositoriesMapping); @@ -605,7 +605,8 @@ public function parsePubliccode(string $repositoryUrl, $response, Source $source $publiccode = \Safe\base64_decode($publiccode['content']); }//end if - var_dump($publiccode);die(); + var_dump($publiccode); + die(); // @TODO Use decodeResponse from the callService. try { $parsedPubliccode = $this->yaml->parse($publiccode);