Skip to content

Commit eca437f

Browse files
committed
Fix some issues reported by scrutinizer
1 parent aca37bf commit eca437f

File tree

6 files changed

+5
-30
lines changed

6 files changed

+5
-30
lines changed

modules/admin/src/Controller/Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function main(Request $request, string $as = null): Response
171171
* @param \Symfony\Component\HttpFoundation\Request $request
172172
* @return \SimpleSAML\XHTML\Template
173173
*/
174-
public function logout(Request $request): Template
174+
public function logout(/** @scrutinizer-ignore-unused*/Request $request): Template
175175
{
176176
return new Template($this->config, 'admin:logout.twig');
177177
}

src/SimpleSAML/Error/Error.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ public function show(): void
246246
&& $config->getOptionalString('technicalcontact_email', '[email protected]') !== '[email protected]'
247247
) {
248248
// enable error reporting
249-
$httpUtils = new Utils\HTTP();
250249
$data['errorReportAddress'] = Module::getModuleURL('core/errorReport');
251250
}
252251

src/SimpleSAML/Kernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ private function registerModuleControllers(ContainerBuilder $container): void
171171
$controllerDir . '/*'
172172
);
173173
} catch (FileLocatorFileNotFoundException $e) {
174+
// fall through
174175
}
175176
}
176177
}

src/SimpleSAML/Metadata/MetaDataStorageSource.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -325,27 +325,4 @@ protected function lookupIndexFromEntityId(string $entityId, array $metadataSet)
325325

326326
return null;
327327
}
328-
329-
330-
/**
331-
* @param string $set
332-
* @throws \Exception
333-
* @return string
334-
*/
335-
private function getDynamicHostedUrl(string $set): string
336-
{
337-
// get the configuration
338-
$httpUtils = new Utils\HTTP();
339-
$baseUrl = $httpUtils->getBaseURL();
340-
341-
if ($set === 'saml20-idp-hosted') {
342-
return $baseUrl . 'saml2/idp/metadata.php';
343-
} elseif ($set === 'saml20-sp-hosted') {
344-
return $baseUrl . 'saml2/sp/metadata.php';
345-
} elseif ($set === 'adfs-idp-hosted') {
346-
return 'urn:federation:' . $httpUtils->getSelfHost() . ':idp';
347-
} else {
348-
throw new \Exception('Can not generate dynamic EntityID for metadata of this type: [' . $set . ']');
349-
}
350-
}
351328
}

src/SimpleSAML/Metadata/Sources/MDQ.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public function getMetaData(string $entityId, string $set): ?array
287287
if (isset($data)) {
288288
if (array_key_exists('expire', $data) && $data['expire'] < time()) {
289289
// metadata has expired
290-
$data = null;
290+
unset($data);
291291
} else {
292292
// metadata found in cache and not expired
293293
Logger::debug(sprintf('%s: using cached metadata for: %s.', __CLASS__, $entityId));

src/SimpleSAML/XHTML/Template.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -567,12 +567,10 @@ public function getContents(): string
567567
/**
568568
* Send this template as a response.
569569
*
570-
* @return $this This response.
570+
* @return \Symfony\Component\HttpFoundation\Response This response.
571571
* @throws \Exception if the template cannot be found.
572-
*
573-
* Note: No return type possible due to upstream limitations
574572
*/
575-
public function send(): static
573+
public function send(): Response
576574
{
577575
$this->content = $this->getContents();
578576
return parent::send();

0 commit comments

Comments
 (0)