1
0
Fork 0

Fix a few type errors, update baseline (2170, 104)

pull/10637/head
Jordi Boggiano 2022-03-18 10:14:18 +01:00
parent e63e15aea8
commit bbf2e94579
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
8 changed files with 15 additions and 70 deletions

View File

@ -3800,11 +3800,6 @@ parameters:
count: 1
path: ../src/Composer/Platform/Runtime.php
-
message: "#^Method Composer\\\\Platform\\\\Runtime\\:\\:getExtensionVersion\\(\\) should return string but returns string\\|false\\.$#"
count: 1
path: ../src/Composer/Platform/Runtime.php
-
message: "#^Casting to array\\<string\\> something that's already array\\<string\\>\\.$#"
count: 1
@ -3945,11 +3940,6 @@ parameters:
count: 1
path: ../src/Composer/Repository/ComposerRepository.php
-
message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:findPackage\\(\\) should return Composer\\\\Package\\\\BasePackage\\|null but returns Composer\\\\Package\\\\BasePackage\\|false\\.$#"
count: 1
path: ../src/Composer/Repository/ComposerRepository.php
-
message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:findPackage\\(\\) should return Composer\\\\Package\\\\BasePackage\\|null but returns array\\<Composer\\\\Package\\\\BasePackage\\>\\|Composer\\\\Package\\\\BasePackage\\|null\\.$#"
count: 2
@ -4343,21 +4333,11 @@ parameters:
count: 1
path: ../src/Composer/Repository/PlatformRepository.php
-
message: "#^Parameter \\#1 \\$version of method Composer\\\\Semver\\\\VersionParser\\:\\:normalize\\(\\) expects string, string\\|null given\\.$#"
count: 1
path: ../src/Composer/Repository/PlatformRepository.php
-
message: "#^Parameter \\#2 \\$prettyVersion of method Composer\\\\Repository\\\\PlatformRepository\\:\\:addLibrary\\(\\) expects string, string\\|null given\\.$#"
count: 3
path: ../src/Composer/Repository/PlatformRepository.php
-
message: "#^Parameter \\#2 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:isMatch\\(\\) expects string, string\\|null given\\.$#"
count: 1
path: ../src/Composer/Repository/PlatformRepository.php
-
message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#"
count: 3
@ -4483,16 +4463,6 @@ parameters:
count: 10
path: ../src/Composer/Repository/Vcs/GitBitbucketDriver.php
-
message: "#^Property Composer\\\\Repository\\\\Vcs\\\\GitBitbucketDriver\\:\\:\\$branches \\(array\\<string, string\\>\\) does not accept array\\<int\\|string, mixed\\>\\.$#"
count: 1
path: ../src/Composer/Repository/Vcs/GitBitbucketDriver.php
-
message: "#^Property Composer\\\\Repository\\\\Vcs\\\\GitBitbucketDriver\\:\\:\\$tags \\(array\\<string, string\\>\\) does not accept array\\<int\\|string, mixed\\>\\.$#"
count: 1
path: ../src/Composer/Repository/Vcs/GitBitbucketDriver.php
-
message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#"
count: 2
@ -4618,11 +4588,6 @@ parameters:
count: 1
path: ../src/Composer/Repository/Vcs/GitHubDriver.php
-
message: "#^Property Composer\\\\Repository\\\\Vcs\\\\GitHubDriver\\:\\:\\$tags \\(array\\<string, string\\>\\) does not accept array\\<int\\|string, mixed\\>\\.$#"
count: 1
path: ../src/Composer/Repository/Vcs/GitHubDriver.php
-
message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#"
count: 2
@ -4658,11 +4623,6 @@ parameters:
count: 1
path: ../src/Composer/Repository/Vcs/GitLabDriver.php
-
message: "#^Only booleans are allowed in a negated boolean, array\\<string, string\\> given\\.$#"
count: 2
path: ../src/Composer/Repository/Vcs/GitLabDriver.php
-
message: "#^Only booleans are allowed in an if condition, Composer\\\\Repository\\\\Vcs\\\\GitDriver\\|null given\\.$#"
count: 8
@ -4698,16 +4658,6 @@ parameters:
count: 1
path: ../src/Composer/Repository/Vcs/HgDriver.php
-
message: "#^Property Composer\\\\Repository\\\\Vcs\\\\HgDriver\\:\\:\\$branches \\(array\\<string, string\\>\\) does not accept array\\<int\\|string, mixed\\>\\.$#"
count: 1
path: ../src/Composer/Repository/Vcs/HgDriver.php
-
message: "#^Property Composer\\\\Repository\\\\Vcs\\\\HgDriver\\:\\:\\$tags \\(array\\<string, string\\>\\) does not accept array\\<int\\|string, mixed\\>\\.$#"
count: 1
path: ../src/Composer/Repository/Vcs/HgDriver.php
-
message: "#^Cannot call method checkStream\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#"
count: 1
@ -5738,11 +5688,6 @@ parameters:
count: 1
path: ../src/Composer/Util/ProcessExecutor.php
-
message: "#^Only booleans are allowed in a negated boolean, int given\\.$#"
count: 1
path: ../src/Composer/Util/ProcessExecutor.php
-
message: "#^Property Composer\\\\Util\\\\ProcessExecutor\\:\\:\\$jobs \\(array\\<int, array\\<string, mixed\\>\\>\\) does not accept array\\<int\\|string, array\\<string, mixed\\>\\>\\.$#"
count: 1

View File

@ -24,9 +24,9 @@ use Composer\IO\IOInterface;
*/
class FossilDriver extends VcsDriver
{
/** @var array<string, string> Map of tag name to identifier */
/** @var array<int|string, string> Map of tag name to identifier */
protected $tags;
/** @var array<string, string> Map of branch name to identifier */
/** @var array<int|string, string> Map of branch name to identifier */
protected $branches;
/** @var ?string */
protected $rootIdentifier = null;

View File

@ -34,9 +34,9 @@ class GitBitbucketDriver extends VcsDriver
private $hasIssues = false;
/** @var ?string */
private $rootIdentifier;
/** @var array<string, string> Map of tag name to identifier */
/** @var array<int|string, string> Map of tag name to identifier */
private $tags;
/** @var array<string, string> Map of branch name to identifier */
/** @var array<int|string, string> Map of branch name to identifier */
private $branches;
/** @var string */
private $branchesUrl = '';

View File

@ -30,9 +30,9 @@ class GitHubDriver extends VcsDriver
protected $owner;
/** @var string */
protected $repository;
/** @var array<string, string> Map of tag name to identifier */
/** @var array<int|string, string> Map of tag name to identifier */
protected $tags;
/** @var array<string, string> Map of branch name to identifier */
/** @var array<int|string, string> Map of branch name to identifier */
protected $branches;
/** @var string */
protected $rootIdentifier;

View File

@ -50,10 +50,10 @@ class GitLabDriver extends VcsDriver
*/
private $commits = array();
/** @var array<string, string> Map of tag name to identifier */
/** @var array<int|string, string> Map of tag name to identifier */
private $tags;
/** @var array<string, string> Map of branch name to identifier */
/** @var array<int|string, string> Map of branch name to identifier */
private $branches;
/**
@ -300,7 +300,7 @@ class GitLabDriver extends VcsDriver
return $this->gitDriver->getBranches();
}
if (!$this->branches) {
if (null === $this->branches) {
$this->branches = $this->getReferences('branches');
}
@ -316,7 +316,7 @@ class GitLabDriver extends VcsDriver
return $this->gitDriver->getTags();
}
if (!$this->tags) {
if (null === $this->tags) {
$this->tags = $this->getReferences('tags');
}

View File

@ -25,9 +25,9 @@ use Composer\IO\IOInterface;
*/
class HgDriver extends VcsDriver
{
/** @var array<string, string> Map of tag name to identifier */
/** @var array<int|string, string> Map of tag name to identifier */
protected $tags;
/** @var array<string, string> Map of branch name to identifier */
/** @var array<int|string, string> Map of branch name to identifier */
protected $branches;
/** @var string */
protected $rootIdentifier;

View File

@ -31,9 +31,9 @@ class SvnDriver extends VcsDriver
{
/** @var string */
protected $baseUrl;
/** @var array<string, string> Map of tag name to identifier */
/** @var array<int|string, string> Map of tag name to identifier */
protected $tags;
/** @var array<string, string> Map of branch name to identifier */
/** @var array<int|string, string> Map of branch name to identifier */
protected $branches;
/** @var ?string */
protected $rootIdentifier;

View File

@ -44,7 +44,7 @@ abstract class VcsDriver implements VcsDriverInterface
protected $process;
/** @var HttpDownloader */
protected $httpDownloader;
/** @var array<string, mixed> */
/** @var array<int|string, mixed> */
protected $infoCache = array();
/** @var ?Cache */
protected $cache;