This commit is contained in:
wangjinlei
2022-04-06 18:24:31 +08:00
parent e0e66e5abe
commit a9bdce100c
557 changed files with 153341 additions and 6448 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace think\composer;
use Composer\Package\PackageInterface;
use Composer\Repository\InstalledRepositoryInterface;
use React\Promise\PromiseInterface;
abstract class LibraryInstaller extends \Composer\Installer\LibraryInstaller
{
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
{
return $this->makePromise(parent::install($repo, $package));
}
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
{
return $this->makePromise(parent::update($repo, $initial, $target));
}
protected function makePromise($promise)
{
if ($promise instanceof PromiseInterface) {
return $promise;
}
return new Promise();
}
}

View File

@@ -0,0 +1,11 @@
<?php
namespace think\composer;
class Promise
{
public function then($callable)
{
$callable();
}
}