parent
0e05c2c68a
commit
45977c7cb1
|
@ -4933,21 +4933,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../src/Composer/Util/Svn.php
|
||||
|
||||
-
|
||||
message: "#^Only booleans are allowed in a ternary operator condition, Composer\\\\Package\\\\PackageInterface\\|null given\\.$#"
|
||||
count: 1
|
||||
path: ../src/Composer/Util/SyncHelper.php
|
||||
|
||||
-
|
||||
message: "#^Only booleans are allowed in an if condition, React\\\\Promise\\\\PromiseInterface\\|null given\\.$#"
|
||||
count: 1
|
||||
path: ../src/Composer/Util/SyncHelper.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$target of method Composer\\\\Downloader\\\\DownloaderInterface\\:\\:update\\(\\) expects Composer\\\\Package\\\\PackageInterface, Composer\\\\Package\\\\PackageInterface\\|null given\\.$#"
|
||||
count: 1
|
||||
path: ../src/Composer/Util/SyncHelper.php
|
||||
|
||||
-
|
||||
message: "#^Only booleans are allowed in &&, array\\<int\\|string, true\\> given on the left side\\.$#"
|
||||
count: 1
|
||||
|
|
|
@ -31,14 +31,14 @@ class SyncHelper
|
|||
*/
|
||||
public static function downloadAndInstallPackageSync(Loop $loop, DownloaderInterface $downloader, string $path, PackageInterface $package, ?PackageInterface $prevPackage = null): void
|
||||
{
|
||||
$type = $prevPackage ? 'update' : 'install';
|
||||
$type = $prevPackage !== null ? 'update' : 'install';
|
||||
|
||||
try {
|
||||
self::await($loop, $downloader->download($package, $path, $prevPackage));
|
||||
|
||||
self::await($loop, $downloader->prepare($type, $package, $path, $prevPackage));
|
||||
|
||||
if ($type === 'update') {
|
||||
if ($type === 'update' && $prevPackage !== null) {
|
||||
self::await($loop, $downloader->update($package, $prevPackage, $path));
|
||||
} else {
|
||||
self::await($loop, $downloader->install($package, $path));
|
||||
|
@ -58,7 +58,7 @@ class SyncHelper
|
|||
*/
|
||||
public static function await(Loop $loop, ?PromiseInterface $promise = null): void
|
||||
{
|
||||
if ($promise) {
|
||||
if ($promise !== null) {
|
||||
$loop->wait([$promise]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue