aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/repository/composer_repository.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-22 23:14:27 +0900
committernsfisis <nsfisis@gmail.com>2026-05-23 15:48:00 +0900
commit5adc4e467f01865ba2d4f519334ee1b0496b8ebf (patch)
treef6970f181793c0f8b9b67b2af54c09ae13a25c4b /crates/shirabe/src/repository/composer_repository.rs
parent2a1696906344cb4da768a940bf8b1f89bbc82b47 (diff)
downloadphp-shirabe-5adc4e467f01865ba2d4f519334ee1b0496b8ebf.tar.gz
php-shirabe-5adc4e467f01865ba2d4f519334ee1b0496b8ebf.tar.zst
php-shirabe-5adc4e467f01865ba2d4f519334ee1b0496b8ebf.zip
refactor(promise): change functions returning PromiseInterface to async fn
Diffstat (limited to 'crates/shirabe/src/repository/composer_repository.rs')
-rw-r--r--crates/shirabe/src/repository/composer_repository.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/shirabe/src/repository/composer_repository.rs b/crates/shirabe/src/repository/composer_repository.rs
index 624c4a2..7601117 100644
--- a/crates/shirabe/src/repository/composer_repository.rs
+++ b/crates/shirabe/src/repository/composer_repository.rs
@@ -3,7 +3,6 @@
use indexmap::IndexMap;
use shirabe_external_packages::composer::metadata_minifier::MetadataMinifier;
use shirabe_external_packages::composer::pcre::{CaptureKey, Preg};
-use shirabe_external_packages::react::promise::PromiseInterface;
use shirabe_php_shim::{
Countable, InvalidArgumentException, JSON_UNESCAPED_SLASHES, JSON_UNESCAPED_UNICODE,
LogicException, PHP_EOL, PhpMixed, RuntimeException, UnexpectedValueException,
@@ -2087,11 +2086,11 @@ impl ComposerRepository {
})
}
- fn start_cached_async_download(
+ async fn start_cached_async_download(
&mut self,
file_name: &str,
package_name: Option<&str>,
- ) -> anyhow::Result<Box<dyn PromiseInterface>> {
+ ) -> anyhow::Result<PhpMixed> {
if self.lazy_providers_url.is_none() {
return Err(LogicException {
message: "startCachedAsyncDownload only supports v2 protocol composer repos with a metadata-url".to_string(),
@@ -3277,12 +3276,12 @@ impl ComposerRepository {
}
}
- fn async_fetch_file(
+ async fn async_fetch_file(
&mut self,
filename: &str,
cache_key: &str,
last_modified_time: Option<&str>,
- ) -> anyhow::Result<Box<dyn PromiseInterface>> {
+ ) -> anyhow::Result<PhpMixed> {
if filename.is_empty() {
return Err(InvalidArgumentException {
message: "$filename should not be an empty string".to_string(),