Skip to content

Conversation

@glaubinix
Copy link
Contributor

$auditConfig = $this->config->get('audit');

return $auditor->audit($this->io, $repoSet, $packages, $this->auditFormat, true, $auditConfig['ignore'] ?? [], $auditConfig['abandoned'] ?? Auditor::ABANDONED_FAIL, [], $auditConfig['ignore-abandoned'] ?? []) > 0 && $this->errorOnAudit ? self::ERROR_AUDIT_FAILED : 0;
return $auditor->audit($this->io, $repoSet, $packages, $this->auditFormat, true, $auditConfig['ignore'] ?? [], $auditConfig['abandoned'] ?? Auditor::ABANDONED_FAIL, [], false, $auditConfig['ignore-abandoned'] ?? []) > 0 && $this->errorOnAudit ? self::ERROR_AUDIT_FAILED : 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why this error was not detected by PHPStan. does this file miss PHPStan analysis?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHPStan thinks that

\PHPStan\dumpType($auditConfig['ignore-abandoned'] ?? []);

is

 ------ ---------------------------- 
  Line   src/Composer/Installer.php  
 ------ ---------------------------- 
  436    Dumped type: mixed~null     
 ------ ----------------------------

Copy link
Contributor

@staabm staabm Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh I see. too much mixed involved :).

maybe its worth narrowing the type of $auditConfig and/or its offsets

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Seldaek Seldaek merged commit 686161e into composer:main Oct 28, 2025
21 checks passed
@Seldaek
Copy link
Member

Seldaek commented Oct 28, 2025

Thanks and thanks @PhilETaylor for the quick report, definitely always good :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants