message: "#^Parameter \\#3 \\$requiredPackage \\(string\\) of method Composer\\\\DependencyResolver\\\\DefaultPolicy\\:\\:selectPreferredPackages\\(\\) should be contravariant with parameter \\$requiredPackage \\(string\\|null\\) of method Composer\\\\DependencyResolver\\\\PolicyInterface\\:\\:selectPreferredPackages\\(\\)$#"
message: "#^PHPDoc type Composer\\\\Package\\\\CompletePackage of property Composer\\\\Package\\\\CompleteAliasPackage\\:\\:\\$aliasOf is not the same as PHPDoc type Composer\\\\Package\\\\BasePackage of overridden property Composer\\\\Package\\\\AliasPackage\\:\\:\\$aliasOf\\.$#"
message: "#^Method Composer\\\\Package\\\\Loader\\\\ArrayLoader\\:\\:createObject\\(\\) should return Composer\\\\Package\\\\CompletePackage but returns PackageClass of Composer\\\\Package\\\\CompletePackageInterface\\.$#"
message: "#^Parameter \\#2 \\$class \\(class\\-string\\<PackageClass of Composer\\\\Package\\\\RootPackage\\>\\) of method Composer\\\\Package\\\\Loader\\\\RootPackageLoader\\:\\:load\\(\\) should be contravariant with parameter \\$class \\(class\\-string\\<Composer\\\\Package\\\\CompletePackageInterface\\>\\) of method Composer\\\\Package\\\\Loader\\\\ArrayLoader\\:\\:load\\(\\)$#"
message: "#^Parameter \\#2 \\$class \\(class\\-string\\<PackageClass of Composer\\\\Package\\\\RootPackage\\>\\) of method Composer\\\\Package\\\\Loader\\\\RootPackageLoader\\:\\:load\\(\\) should be contravariant with parameter \\$class \\(class\\-string\\<Composer\\\\Package\\\\CompletePackageInterface\\>\\) of method Composer\\\\Package\\\\Loader\\\\LoaderInterface\\:\\:load\\(\\)$#"
message: "#^Parameter \\#2 \\$class \\(class\\-string\\<Composer\\\\Package\\\\RootPackage\\>\\) of method Composer\\\\Package\\\\Loader\\\\RootPackageLoader\\:\\:load\\(\\) should be contravariant with parameter \\$class \\(class\\-string\\<Composer\\\\Package\\\\CompletePackage\\>\\) of method Composer\\\\Package\\\\Loader\\\\ArrayLoader\\:\\:load\\(\\)$#"
message: "#^Parameter \\#2 \\$class \\(class\\-string\\<Composer\\\\Package\\\\RootPackage\\>\\) of method Composer\\\\Package\\\\Loader\\\\RootPackageLoader\\:\\:load\\(\\) should be contravariant with parameter \\$class \\(class\\-string\\<Composer\\\\Package\\\\CompletePackage\\>\\) of method Composer\\\\Package\\\\Loader\\\\LoaderInterface\\:\\:load\\(\\)$#"
message: "#^Property Composer\\\\Repository\\\\Vcs\\\\GitBitbucketDriver\\:\\:\\$branches \\(array\\<string, string\\>\\) does not accept array\\<int\\|string, mixed\\>\\.$#"
message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:ensureDirectoryExistsAndClear\\(\\)\\.$#"
count: 1
@ -6650,16 +6390,6 @@ parameters:
count: 2
path: ../tests/Composer/Test/ConfigTest.php
-
message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setProvides\\(\\)\\.$#"
message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setReplaces\\(\\)\\.$#"
message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setConflicts\\(\\)\\.$#"
message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setProvides\\(\\)\\.$#"
message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setReplaces\\(\\)\\.$#"
message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setRequires\\(\\)\\.$#"
message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setProvides\\(\\)\\.$#"
message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setRequires\\(\\)\\.$#"
message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setRequires\\(\\)\\.$#"
count: 4
path: ../tests/Composer/Test/InstallerTest.php
-
message: "#^Call to function is_array\\(\\) with array\\<Composer\\\\Repository\\\\RepositoryInterface\\> will always evaluate to true\\.$#"
count: 1
@ -7083,11 +6728,6 @@ parameters:
count: 1
path: ../tests/Composer/Test/InstallerTest.php
-
message: "#^Property Composer\\\\Test\\\\InstallerTest\\:\\:\\$prevCwd \\(string\\) does not accept string\\|false\\.$#"
count: 1
path: ../tests/Composer/Test/InstallerTest.php
-
message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#"
message: "#^Offset 'url' on array\\{url\\: string, options\\?\\: array, status\\?\\: int, body\\?\\: string, headers\\?\\: array\\<string\\>\\} on left side of \\?\\? always exists and is not nullable\\.$#"
message: "#^Composer\\\\Test\\\\Mock\\\\VersionGuesserMock\\:\\:__construct\\(\\) does not call parent constructor from Composer\\\\Package\\\\Version\\\\VersionGuesser\\.$#"
message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setProvides\\(\\)\\.$#"
message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setReplaces\\(\\)\\.$#"
message: "#^Method Composer\\\\Test\\\\TestCase\\:\\:getPackage\\(\\) should return Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage but returns PackageClass of Composer\\\\Package\\\\PackageInterface\\.$#"
count: 1
path: ../tests/Composer/Test/TestCase.php
-
message: "#^Method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\) should return string but returns string\\|false\\.$#"
count: 1
@ -7575,7 +7125,7 @@ parameters:
-
message: "#^Only booleans are allowed in an if condition, string given\\.$#"
$io->writeError("<warning>Class $class located in ".Preg::replace('{^'.preg_quote(getcwd()).'}', '.', $filePath, 1)." does not comply with $namespaceType autoloading standard. Skipping.</warning>");
$io->writeError("<warning>Class $class located in ".Preg::replace('{^'.preg_quote(Platform::getCwd()).'}', '.', $filePath, 1)." does not comply with $namespaceType autoloading standard. Skipping.</warning>");
}
}
@ -215,7 +216,7 @@ class ClassMapGenerator
* @throws \RuntimeException
* @return array<int,class-string> The found classes
*/
private static function findClasses($path): array
private static function findClasses(string $path): array
public function setRunScripts(bool $runScripts = true): self
{
$this->runScripts = (bool) $runScripts;
@ -97,7 +96,7 @@ class EventDispatcher
* @return int return code of the executed script if any, for php scripts a false return
* value is changed to 1, anything else to 0
*/
public function dispatch($eventName, Event $event = null)
public function dispatch(string $eventName, Event $event = null): int
{
if (null === $event) {
$event = new Event($eventName);
@ -116,7 +115,7 @@ class EventDispatcher
* @return int return code of the executed script if any, for php scripts a false return
* value is changed to 1, anything else to 0
*/
public function dispatchScript($eventName, $devMode = false, $additionalArgs = array(), $flags = array())
public function dispatchScript(string $eventName, bool $devMode = false, array $additionalArgs = array(), array $flags = array()): int
{
assert($this->composer instanceof Composer, new \LogicException('This should only be reached with a fully loaded Composer'));
@ -135,7 +134,7 @@ class EventDispatcher
* @return int return code of the executed script if any, for php scripts a false return
* value is changed to 1, anything else to 0
*/
public function dispatchPackageEvent($eventName, $devMode, RepositoryInterface $localRepo, array $operations, OperationInterface $operation)
public function dispatchPackageEvent(string $eventName, bool $devMode, RepositoryInterface $localRepo, array $operations, OperationInterface $operation): int
{
assert($this->composer instanceof Composer, new \LogicException('This should only be reached with a fully loaded Composer'));
@ -153,7 +152,7 @@ class EventDispatcher
* @return int return code of the executed script if any, for php scripts a false return
* value is changed to 1, anything else to 0
*/
public function dispatchInstallerEvent($eventName, $devMode, $executeOperations, Transaction $transaction)
public function dispatchInstallerEvent(string $eventName, bool $devMode, bool $executeOperations, Transaction $transaction): int
{
assert($this->composer instanceof Composer, new \LogicException('This should only be reached with a fully loaded Composer'));
@ -343,7 +342,7 @@ class EventDispatcher
*
* @return int
*/
protected function executeTty($exec)
protected function executeTty(string $exec): int
{
if ($this->io->isInteractive()) {
return $this->process->executeTty($exec);
@ -355,7 +354,7 @@ class EventDispatcher
/**
* @return string
*/
protected function getPhpExecCommand()
protected function getPhpExecCommand(): string
{
$finder = new PhpExecutableFinder();
$phpPath = $finder->find(false);
@ -378,7 +377,7 @@ class EventDispatcher
*
* @return mixed
*/
protected function executeEventPhpScript($className, $methodName, Event $event)
protected function executeEventPhpScript(string $className, string $methodName, Event $event)
public function setDevMode($devMode = true): Installer
public function setDevMode(bool $devMode = true): self
{
$this->devMode = (bool) $devMode;
@ -1203,7 +1203,7 @@ class Installer
* @param bool $dumpAutoloader
* @return Installer
*/
public function setDumpAutoloader($dumpAutoloader = true): Installer
public function setDumpAutoloader(bool $dumpAutoloader = true): self
{
$this->dumpAutoloader = (bool) $dumpAutoloader;
@ -1219,7 +1219,7 @@ class Installer
* @return Installer
* @deprecated Use setRunScripts(false) on the EventDispatcher instance being injected instead
*/
public function setRunScripts($runScripts = true): Installer
public function setRunScripts(bool $runScripts = true): self
{
$this->runScripts = (bool) $runScripts;
@ -1232,7 +1232,7 @@ class Installer
* @param Config $config
* @return Installer
*/
public function setConfig(Config $config): Installer
public function setConfig(Config $config): self
{
$this->config = $config;
@ -1245,7 +1245,7 @@ class Installer
* @param bool $verbose
* @return Installer
*/
public function setVerbose($verbose = true): Installer
public function setVerbose(bool $verbose = true): self
{
$this->verbose = (bool) $verbose;
@ -1275,7 +1275,7 @@ class Installer
*
* @deprecated use setPlatformRequirementFilter instead
*/
public function setIgnorePlatformRequirements($ignorePlatformReqs): Installer
public function setIgnorePlatformRequirements($ignorePlatformReqs): self
{
trigger_error('Installer::setIgnorePlatformRequirements is deprecated since Composer 2.2, use setPlatformRequirementFilter instead.', E_USER_DEPRECATED);