1
0
Fork 0

Fix phpstan warnings

pull/10514/head
Jordi Boggiano 2022-02-04 13:01:48 +01:00
parent 3d82719b70
commit 39cb505d69
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 3 additions and 4 deletions

View File

@ -135,7 +135,7 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
$this->setPushUrl($path, $url); $this->setPushUrl($path, $url);
} }
if ($newRef = $this->updateToCommit($package, $path, $ref, $package->getPrettyVersion(), $package->getReleaseDate())) { if ($newRef = $this->updateToCommit($package, $path, (string) $ref, $package->getPrettyVersion(), $package->getReleaseDate())) {
if ($package->getDistReference() === $package->getSourceReference()) { if ($package->getDistReference() === $package->getSourceReference()) {
$package->setDistReference($newRef); $package->setDistReference($newRef);
} }
@ -186,7 +186,7 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
}; };
$this->gitUtil->runCommand($commandCallable, $url, $path); $this->gitUtil->runCommand($commandCallable, $url, $path);
if ($newRef = $this->updateToCommit($target, $path, $ref, $target->getPrettyVersion(), $target->getReleaseDate())) { if ($newRef = $this->updateToCommit($target, $path, (string) $ref, $target->getPrettyVersion(), $target->getReleaseDate())) {
if ($target->getDistReference() === $target->getSourceReference()) { if ($target->getDistReference() === $target->getSourceReference()) {
$target->setDistReference($newRef); $target->setDistReference($newRef);
} }
@ -435,11 +435,10 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
* @param string $path * @param string $path
* @param string $reference * @param string $reference
* @param string $prettyVersion * @param string $prettyVersion
* @param \DateTime $date
* @throws \RuntimeException * @throws \RuntimeException
* @return null|string if a string is returned, it is the commit reference that was checked out if the original could not be found * @return null|string if a string is returned, it is the commit reference that was checked out if the original could not be found
*/ */
protected function updateToCommit(PackageInterface $package, $path, $reference, $prettyVersion, $date) protected function updateToCommit(PackageInterface $package, $path, $reference, $prettyVersion)
{ {
$force = !empty($this->hasDiscardedChanges[$path]) || !empty($this->hasStashedChanges[$path]) ? '-f ' : ''; $force = !empty($this->hasDiscardedChanges[$path]) || !empty($this->hasStashedChanges[$path]) ? '-f ' : '';