aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/util')
-rw-r--r--crates/shirabe/src/util/auth_helper.rs15
-rw-r--r--crates/shirabe/src/util/bitbucket.rs7
-rw-r--r--crates/shirabe/src/util/filesystem.rs8
-rw-r--r--crates/shirabe/src/util/git.rs22
-rw-r--r--crates/shirabe/src/util/github.rs9
-rw-r--r--crates/shirabe/src/util/gitlab.rs9
-rw-r--r--crates/shirabe/src/util/http.rs (renamed from crates/shirabe/src/util/http/mod.rs)0
-rw-r--r--crates/shirabe/src/util/http/curl_downloader.rs15
-rw-r--r--crates/shirabe/src/util/http/curl_response.rs3
-rw-r--r--crates/shirabe/src/util/http/proxy_manager.rs5
-rw-r--r--crates/shirabe/src/util/http/request_proxy.rs3
-rw-r--r--crates/shirabe/src/util/http_downloader.rs22
-rw-r--r--crates/shirabe/src/util/mod.rs64
-rw-r--r--crates/shirabe/src/util/package_sorter.rs5
-rw-r--r--crates/shirabe/src/util/perforce.rs11
-rw-r--r--crates/shirabe/src/util/platform.rs8
-rw-r--r--crates/shirabe/src/util/process_executor.rs12
-rw-r--r--crates/shirabe/src/util/remote_filesystem.rs22
-rw-r--r--crates/shirabe/src/util/stream_context_factory.rs13
-rw-r--r--crates/shirabe/src/util/svn.rs14
20 files changed, 88 insertions, 179 deletions
diff --git a/crates/shirabe/src/util/auth_helper.rs b/crates/shirabe/src/util/auth_helper.rs
index 584ce69..8a89842 100644
--- a/crates/shirabe/src/util/auth_helper.rs
+++ b/crates/shirabe/src/util/auth_helper.rs
@@ -1,6 +1,13 @@
//! ref: composer/src/Composer/Util/AuthHelper.php
+use crate::config::Config;
+use crate::downloader::TransportException;
+use crate::io::IOInterface;
+use crate::io::IOInterfaceImmutable;
use crate::io::io_interface;
+use crate::util::Bitbucket;
+use crate::util::GitHub;
+use crate::util::GitLab;
use anyhow::Result;
use indexmap::IndexMap;
use shirabe_external_packages::composer::pcre::Preg;
@@ -10,14 +17,6 @@ use shirabe_php_shim::{
trim,
};
-use crate::config::Config;
-use crate::downloader::TransportException;
-use crate::io::IOInterface;
-use crate::io::IOInterfaceImmutable;
-use crate::util::Bitbucket;
-use crate::util::GitHub;
-use crate::util::GitLab;
-
#[derive(Debug)]
pub struct AuthHelper {
pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
diff --git a/crates/shirabe/src/util/bitbucket.rs b/crates/shirabe/src/util/bitbucket.rs
index 8a1127a..bba16e8 100644
--- a/crates/shirabe/src/util/bitbucket.rs
+++ b/crates/shirabe/src/util/bitbucket.rs
@@ -1,16 +1,15 @@
//! ref: composer/src/Composer/Util/Bitbucket.php
-use crate::io::io_interface;
-use indexmap::IndexMap;
-use shirabe_php_shim::{LogicException, PhpMixed, time};
-
use crate::config::Config;
use crate::downloader::TransportException;
use crate::factory::Factory;
use crate::io::IOInterface;
use crate::io::IOInterfaceImmutable;
+use crate::io::io_interface;
use crate::util::HttpDownloader;
use crate::util::ProcessExecutor;
+use indexmap::IndexMap;
+use shirabe_php_shim::{LogicException, PhpMixed, time};
fn transport_error_code(err: &anyhow::Error) -> Option<i64> {
err.downcast_ref::<TransportException>().map(|te| te.code)
diff --git a/crates/shirabe/src/util/filesystem.rs b/crates/shirabe/src/util/filesystem.rs
index b224767..d21a0e7 100644
--- a/crates/shirabe/src/util/filesystem.rs
+++ b/crates/shirabe/src/util/filesystem.rs
@@ -1,5 +1,8 @@
//! ref: composer/src/Composer/Util/Filesystem.php
+use crate::util::Platform;
+use crate::util::ProcessExecutor;
+use crate::util::Silencer;
use shirabe_external_packages::composer::pcre::Preg;
use shirabe_external_packages::symfony::filesystem::exception::IOException;
use shirabe_external_packages::symfony::finder::Finder;
@@ -12,13 +15,8 @@ use shirabe_php_shim::{
str_starts_with, strlen, strpos, strtoupper, strtr, substr, substr_count, symlink, touch,
unlink, usleep, var_export,
};
-
use std::path::Path;
-use crate::util::Platform;
-use crate::util::ProcessExecutor;
-use crate::util::Silencer;
-
#[derive(Debug)]
pub struct Filesystem {
process_executor: Option<std::rc::Rc<std::cell::RefCell<ProcessExecutor>>>,
diff --git a/crates/shirabe/src/util/git.rs b/crates/shirabe/src/util/git.rs
index f30f9f7..ee9f9e6 100644
--- a/crates/shirabe/src/util/git.rs
+++ b/crates/shirabe/src/util/git.rs
@@ -1,20 +1,9 @@
//! ref: composer/src/Composer/Util/Git.php
-use crate::io::io_interface;
-use anyhow::Result;
-use indexmap::IndexMap;
-use std::sync::Mutex;
-
-use shirabe_external_packages::composer::pcre::{CaptureKey, Preg};
-use shirabe_php_shim::{
- InvalidArgumentException, PHP_EOL, PhpMixed, RuntimeException, array_map, clearstatcache,
- explode, implode, in_array, is_callable, is_dir, preg_quote, rawurldecode, rawurlencode,
- str_contains, str_ends_with, str_replace_array, strlen, strpos, substr, trim, version_compare,
-};
-
use crate::config::Config;
use crate::io::IOInterface;
use crate::io::IOInterfaceImmutable;
+use crate::io::io_interface;
use crate::util::Bitbucket;
use crate::util::Filesystem;
use crate::util::GitHub;
@@ -24,6 +13,15 @@ use crate::util::Platform;
use crate::util::ProcessExecutor;
use crate::util::Url;
use crate::util::{AuthHelper, StoreAuth};
+use anyhow::Result;
+use indexmap::IndexMap;
+use shirabe_external_packages::composer::pcre::{CaptureKey, Preg};
+use shirabe_php_shim::{
+ InvalidArgumentException, PHP_EOL, PhpMixed, RuntimeException, array_map, clearstatcache,
+ explode, implode, in_array, is_callable, is_dir, preg_quote, rawurldecode, rawurlencode,
+ str_contains, str_ends_with, str_replace_array, strlen, strpos, substr, trim, version_compare,
+};
+use std::sync::Mutex;
#[derive(Debug)]
pub struct Git {
diff --git a/crates/shirabe/src/util/github.rs b/crates/shirabe/src/util/github.rs
index 285052e..905026a 100644
--- a/crates/shirabe/src/util/github.rs
+++ b/crates/shirabe/src/util/github.rs
@@ -1,16 +1,15 @@
//! ref: composer/src/Composer/Util/GitHub.php
-use crate::io::io_interface;
-use indexmap::IndexMap;
-use shirabe_external_packages::composer::pcre::{CaptureKey, Preg};
-use shirabe_php_shim::{PhpMixed, date, stripos, strtolower};
-
use crate::config::Config;
use crate::factory::Factory;
use crate::io::IOInterface;
use crate::io::IOInterfaceImmutable;
+use crate::io::io_interface;
use crate::util::HttpDownloader;
use crate::util::ProcessExecutor;
+use indexmap::IndexMap;
+use shirabe_external_packages::composer::pcre::{CaptureKey, Preg};
+use shirabe_php_shim::{PhpMixed, date, stripos, strtolower};
#[derive(Debug)]
pub struct GitHub {
diff --git a/crates/shirabe/src/util/gitlab.rs b/crates/shirabe/src/util/gitlab.rs
index a71c231..eae26f0 100644
--- a/crates/shirabe/src/util/gitlab.rs
+++ b/crates/shirabe/src/util/gitlab.rs
@@ -1,17 +1,16 @@
//! ref: composer/src/Composer/Util/GitLab.php
-use crate::io::io_interface;
-use indexmap::IndexMap;
-use shirabe_external_packages::composer::pcre::Preg;
-use shirabe_php_shim::{PhpMixed, RuntimeException, http_build_query, json_decode, time};
-
use crate::config::Config;
use crate::downloader::TransportException;
use crate::factory::Factory;
use crate::io::IOInterface;
use crate::io::IOInterfaceImmutable;
+use crate::io::io_interface;
use crate::util::HttpDownloader;
use crate::util::ProcessExecutor;
+use indexmap::IndexMap;
+use shirabe_external_packages::composer::pcre::Preg;
+use shirabe_php_shim::{PhpMixed, RuntimeException, http_build_query, json_decode, time};
#[derive(Debug)]
pub struct GitLab {
diff --git a/crates/shirabe/src/util/http/mod.rs b/crates/shirabe/src/util/http.rs
index 19e5a86..19e5a86 100644
--- a/crates/shirabe/src/util/http/mod.rs
+++ b/crates/shirabe/src/util/http.rs
diff --git a/crates/shirabe/src/util/http/curl_downloader.rs b/crates/shirabe/src/util/http/curl_downloader.rs
index 66ca326..019a5ab 100644
--- a/crates/shirabe/src/util/http/curl_downloader.rs
+++ b/crates/shirabe/src/util/http/curl_downloader.rs
@@ -10,15 +10,6 @@
//! is preserved. Per-request TLS/proxy/IP-resolve settings that reqwest only exposes per-Client
//! are simplified to a single default Client; see the TODOs below.
-use std::sync::atomic::{AtomicBool, Ordering};
-
-use indexmap::IndexMap;
-
-use shirabe_external_packages::composer::pcre::Preg;
-use shirabe_php_shim::{
- PhpMixed, in_array, parse_url, preg_quote, rename, strpos, substr, unlink_silent,
-};
-
use crate::config::Config;
use crate::downloader::MaxFileSizeExceededException;
use crate::downloader::TransportException;
@@ -31,6 +22,12 @@ use crate::util::http::CurlResponse;
use crate::util::http::ProxyManager;
use crate::util::http::Response;
use crate::util::{AuthHelper, PromptAuthResult, StoreAuth};
+use indexmap::IndexMap;
+use shirabe_external_packages::composer::pcre::Preg;
+use shirabe_php_shim::{
+ PhpMixed, in_array, parse_url, preg_quote, rename, strpos, substr, unlink_silent,
+};
+use std::sync::atomic::{AtomicBool, Ordering};
/// resolve callback supplied by `HttpDownloader`. Receives the final `Response` on success.
pub type ResolveCallback = Box<dyn Fn(Response) + Send + Sync>;
diff --git a/crates/shirabe/src/util/http/curl_response.rs b/crates/shirabe/src/util/http/curl_response.rs
index cc3d21b..579bba8 100644
--- a/crates/shirabe/src/util/http/curl_response.rs
+++ b/crates/shirabe/src/util/http/curl_response.rs
@@ -1,10 +1,9 @@
//! ref: composer/src/Composer/Util/Http/CurlResponse.php
+use super::Response;
use indexmap::IndexMap;
use shirabe_php_shim::PhpMixed;
-use super::Response;
-
#[derive(Debug)]
pub struct CurlResponse {
pub(crate) inner: Response,
diff --git a/crates/shirabe/src/util/http/proxy_manager.rs b/crates/shirabe/src/util/http/proxy_manager.rs
index d0ff9d9..3bc0888 100644
--- a/crates/shirabe/src/util/http/proxy_manager.rs
+++ b/crates/shirabe/src/util/http/proxy_manager.rs
@@ -1,12 +1,11 @@
//! ref: composer/src/Composer/Util/Http/ProxyManager.php
-use std::sync::atomic::{AtomicU64, Ordering};
-use std::sync::{Mutex, OnceLock};
-
use crate::downloader::TransportException;
use crate::util::NoProxyPattern;
use crate::util::http::ProxyItem;
use crate::util::http::RequestProxy;
+use std::sync::atomic::{AtomicU64, Ordering};
+use std::sync::{Mutex, OnceLock};
static INSTANCE: OnceLock<Mutex<Option<ProxyManager>>> = OnceLock::new();
diff --git a/crates/shirabe/src/util/http/request_proxy.rs b/crates/shirabe/src/util/http/request_proxy.rs
index 49aa885..1262622 100644
--- a/crates/shirabe/src/util/http/request_proxy.rs
+++ b/crates/shirabe/src/util/http/request_proxy.rs
@@ -1,13 +1,12 @@
//! ref: composer/src/Composer/Util/Http/RequestProxy.php
+use crate::downloader::TransportException;
use indexmap::IndexMap;
use shirabe_php_shim::{
CURLAUTH_BASIC, CURLOPT_NOPROXY, CURLOPT_PROXY, CURLOPT_PROXY_CAINFO, CURLOPT_PROXY_CAPATH,
CURLOPT_PROXYAUTH, CURLOPT_PROXYUSERPWD, InvalidArgumentException, PhpMixed,
};
-use crate::downloader::TransportException;
-
// contextOptions = array{http: array{proxy: string, header?: string, request_fulluri?: bool}}
type ContextOptions = IndexMap<String, IndexMap<String, PhpMixed>>;
diff --git a/crates/shirabe/src/util/http_downloader.rs b/crates/shirabe/src/util/http_downloader.rs
index a6b62d7..18e320c 100644
--- a/crates/shirabe/src/util/http_downloader.rs
+++ b/crates/shirabe/src/util/http_downloader.rs
@@ -1,17 +1,5 @@
//! ref: composer/src/Composer/Util/HttpDownloader.php
-use anyhow::Result;
-use indexmap::IndexMap;
-
-use crate::util::Silencer;
-use shirabe_external_packages::composer::pcre::{CaptureKey, Preg};
-use shirabe_php_shim::{
- InvalidArgumentException, LogicException, PhpMixed, array_replace_recursive, chr,
- extension_loaded, file_get_contents, function_exists, implode, is_numeric, rawurldecode,
- stream_context_create, stripos, strpos, substr, ucfirst,
-};
-use shirabe_semver::constraint::SimpleConstraint;
-
use crate::composer;
use crate::config::Config;
use crate::downloader::TransportException;
@@ -21,10 +9,20 @@ use crate::package::version::VersionParser;
use crate::util::GetResult;
use crate::util::Platform;
use crate::util::RemoteFilesystem;
+use crate::util::Silencer;
use crate::util::StreamContextFactory;
use crate::util::Url;
use crate::util::http::CurlDownloader;
use crate::util::http::Response;
+use anyhow::Result;
+use indexmap::IndexMap;
+use shirabe_external_packages::composer::pcre::{CaptureKey, Preg};
+use shirabe_php_shim::{
+ InvalidArgumentException, LogicException, PhpMixed, array_replace_recursive, chr,
+ extension_loaded, file_get_contents, function_exists, implode, is_numeric, rawurldecode,
+ stream_context_create, stripos, strpos, substr, ucfirst,
+};
+use shirabe_semver::constraint::SimpleConstraint;
/// @phpstan-type Request array{url: non-empty-string, options: mixed[], copyTo: string|null}
/// @phpstan-type Job array{id: int, status: int, request: Request, sync: bool, origin: string, resolve?: callable, reject?: callable, curl_id?: int, response?: Response, exception?: \Throwable}
diff --git a/crates/shirabe/src/util/mod.rs b/crates/shirabe/src/util/mod.rs
deleted file mode 100644
index bd51b66..0000000
--- a/crates/shirabe/src/util/mod.rs
+++ /dev/null
@@ -1,64 +0,0 @@
-pub mod auth_helper;
-pub mod bitbucket;
-pub mod composer_mirror;
-pub mod config_validator;
-pub mod error_handler;
-pub mod filesystem;
-pub mod forgejo;
-pub mod forgejo_repository_data;
-pub mod forgejo_url;
-pub mod git;
-pub mod github;
-pub mod gitlab;
-pub mod hg;
-pub mod http;
-pub mod http_downloader;
-pub mod ini_helper;
-pub mod r#loop;
-pub mod no_proxy_pattern;
-pub mod package_info;
-pub mod package_sorter;
-pub mod perforce;
-pub mod platform;
-pub mod process_executor;
-pub mod remote_filesystem;
-pub mod silencer;
-pub mod stream_context_factory;
-pub mod svn;
-pub mod sync_helper;
-pub mod tar;
-pub mod tls_helper;
-pub mod url;
-pub mod zip;
-
-pub use auth_helper::*;
-pub use bitbucket::*;
-pub use composer_mirror::*;
-pub use config_validator::*;
-pub use error_handler::*;
-pub use filesystem::*;
-pub use forgejo::*;
-pub use forgejo_repository_data::*;
-pub use forgejo_url::*;
-pub use git::*;
-pub use github::*;
-pub use gitlab::*;
-pub use hg::*;
-pub use http::*;
-pub use http_downloader::*;
-pub use ini_helper::*;
-pub use no_proxy_pattern::*;
-pub use package_info::*;
-pub use package_sorter::*;
-pub use perforce::*;
-pub use platform::*;
-pub use process_executor::*;
-pub use remote_filesystem::*;
-pub use silencer::*;
-pub use stream_context_factory::*;
-pub use svn::*;
-pub use sync_helper::*;
-pub use tar::*;
-pub use tls_helper::*;
-pub use url::*;
-pub use zip::*;
diff --git a/crates/shirabe/src/util/package_sorter.rs b/crates/shirabe/src/util/package_sorter.rs
index 6e0af01..4b76c2f 100644
--- a/crates/shirabe/src/util/package_sorter.rs
+++ b/crates/shirabe/src/util/package_sorter.rs
@@ -1,10 +1,9 @@
//! ref: composer/src/Composer/Util/PackageSorter.php
-use indexmap::IndexMap;
-use shirabe_php_shim::{strnatcasecmp, version_compare};
-
use crate::package::Link;
use crate::package::PackageInterfaceHandle;
+use indexmap::IndexMap;
+use shirabe_php_shim::{strnatcasecmp, version_compare};
pub struct PackageSorter;
diff --git a/crates/shirabe/src/util/perforce.rs b/crates/shirabe/src/util/perforce.rs
index d8cd39d..bd8e9e6 100644
--- a/crates/shirabe/src/util/perforce.rs
+++ b/crates/shirabe/src/util/perforce.rs
@@ -1,5 +1,10 @@
//! ref: composer/src/Composer/Util/Perforce.php
+use crate::io::IOInterface;
+use crate::io::IOInterfaceImmutable;
+use crate::util::Filesystem;
+use crate::util::Platform;
+use crate::util::ProcessExecutor;
use anyhow::Result;
use indexmap::IndexMap;
use shirabe_external_packages::composer::pcre::Preg;
@@ -11,12 +16,6 @@ use shirabe_php_shim::{
strpos, strrpos, substr, time, trim,
};
-use crate::io::IOInterface;
-use crate::io::IOInterfaceImmutable;
-use crate::util::Filesystem;
-use crate::util::Platform;
-use crate::util::ProcessExecutor;
-
/// @phpstan-type RepoConfig array{unique_perforce_client_name?: string, depot?: string, branch?: string, p4user?: string, p4password?: string}
#[derive(Debug)]
pub struct Perforce {
diff --git a/crates/shirabe/src/util/platform.rs b/crates/shirabe/src/util/platform.rs
index 889da6e..b3b7e2b 100644
--- a/crates/shirabe/src/util/platform.rs
+++ b/crates/shirabe/src/util/platform.rs
@@ -1,7 +1,7 @@
//! ref: composer/src/Composer/Util/Platform.php
-use std::sync::Mutex;
-
+use crate::util::ProcessExecutor;
+use crate::util::Silencer;
use anyhow::Result;
use shirabe_external_packages::composer::pcre::Preg;
use shirabe_php_shim::{
@@ -11,9 +11,7 @@ use shirabe_php_shim::{
posix_isatty, putenv, putenv_clear, realpath, stream_isatty, stripos, strlen, strtoupper,
substr, usleep,
};
-
-use crate::util::ProcessExecutor;
-use crate::util::Silencer;
+use std::sync::Mutex;
/// Platform helper for uniform platform-specific tests.
pub struct Platform;
diff --git a/crates/shirabe/src/util/process_executor.rs b/crates/shirabe/src/util/process_executor.rs
index 98c3186..230695a 100644
--- a/crates/shirabe/src/util/process_executor.rs
+++ b/crates/shirabe/src/util/process_executor.rs
@@ -1,10 +1,12 @@
//! ref: composer/src/Composer/Util/ProcessExecutor.php
+use crate::io::IOInterface;
+use crate::io::IOInterfaceImmutable;
use crate::io::io_interface;
+use crate::util::GitHub;
+use crate::util::Platform;
use anyhow::Result;
use indexmap::IndexMap;
-use std::sync::{LazyLock, Mutex};
-
use shirabe_external_packages::composer::pcre::{CaptureKey, Preg};
use shirabe_external_packages::seld::signal::SignalHandler;
use shirabe_external_packages::symfony::process::ExecutableFinder;
@@ -16,11 +18,7 @@ use shirabe_php_shim::{
explode, implode, in_array, is_array, is_dir, is_numeric, is_string, rtrim, sprintf,
str_replace, strcspn, strlen, strpbrk, strtolower, strtr_array, substr_replace, trim, usleep,
};
-
-use crate::io::IOInterface;
-use crate::io::IOInterfaceImmutable;
-use crate::util::GitHub;
-use crate::util::Platform;
+use std::sync::{LazyLock, Mutex};
static EXECUTABLES: LazyLock<Mutex<IndexMap<String, String>>> =
LazyLock::new(|| Mutex::new(IndexMap::new()));
diff --git a/crates/shirabe/src/util/remote_filesystem.rs b/crates/shirabe/src/util/remote_filesystem.rs
index ca818fc..aa42f6b 100644
--- a/crates/shirabe/src/util/remote_filesystem.rs
+++ b/crates/shirabe/src/util/remote_filesystem.rs
@@ -1,17 +1,5 @@
//! ref: composer/src/Composer/Util/RemoteFilesystem.php
-use indexmap::IndexMap;
-
-use shirabe_external_packages::composer::pcre::{CaptureKey, Preg};
-use shirabe_php_shim::{
- PHP_URL_HOST, PHP_URL_PATH, PHP_URL_SCHEME, PHP_VERSION_ID, PhpMixed, RuntimeException,
- STREAM_NOTIFY_FAILURE, STREAM_NOTIFY_FILE_SIZE_IS, STREAM_NOTIFY_PROGRESS,
- array_replace_recursive, base64_encode, explode, extension_loaded, file_put_contents,
- filter_var_boolean, gethostbyname, http_clear_last_response_headers,
- http_get_last_response_headers, ini_get, json_decode, parse_url, preg_quote, strpos,
- strtolower, strtr, substr, trim, zlib_decode,
-};
-
use crate::config::Config;
use crate::downloader::MaxFileSizeExceededException;
use crate::downloader::TransportException;
@@ -24,6 +12,16 @@ use crate::util::StreamContextFactory;
use crate::util::Url;
use crate::util::http::ProxyManager;
use crate::util::http::Response;
+use indexmap::IndexMap;
+use shirabe_external_packages::composer::pcre::{CaptureKey, Preg};
+use shirabe_php_shim::{
+ PHP_URL_HOST, PHP_URL_PATH, PHP_URL_SCHEME, PHP_VERSION_ID, PhpMixed, RuntimeException,
+ STREAM_NOTIFY_FAILURE, STREAM_NOTIFY_FILE_SIZE_IS, STREAM_NOTIFY_PROGRESS,
+ array_replace_recursive, base64_encode, explode, extension_loaded, file_put_contents,
+ filter_var_boolean, gethostbyname, http_clear_last_response_headers,
+ http_get_last_response_headers, ini_get, json_decode, parse_url, preg_quote, strpos,
+ strtolower, strtr, substr, trim, zlib_decode,
+};
/// Result of `RemoteFilesystem::get` — string content, `true` (for copy), or `false`.
#[derive(Debug, Clone)]
diff --git a/crates/shirabe/src/util/stream_context_factory.rs b/crates/shirabe/src/util/stream_context_factory.rs
index 0b259d7..6a40cd0 100644
--- a/crates/shirabe/src/util/stream_context_factory.rs
+++ b/crates/shirabe/src/util/stream_context_factory.rs
@@ -1,5 +1,11 @@
//! ref: composer/src/Composer/Util/StreamContextFactory.php
+use crate::composer;
+use crate::downloader::TransportException;
+use crate::repository::PlatformRepository;
+use crate::util::Filesystem;
+use crate::util::Platform;
+use crate::util::http::ProxyManager;
use indexmap::IndexMap;
use shirabe_external_packages::composer::ca_bundle::CaBundle;
use shirabe_php_shim::{
@@ -8,13 +14,6 @@ use shirabe_php_shim::{
stripos, uasort,
};
-use crate::composer;
-use crate::downloader::TransportException;
-use crate::repository::PlatformRepository;
-use crate::util::Filesystem;
-use crate::util::Platform;
-use crate::util::http::ProxyManager;
-
pub struct StreamContextFactory;
impl StreamContextFactory {
diff --git a/crates/shirabe/src/util/svn.rs b/crates/shirabe/src/util/svn.rs
index 096d8c3..5eed44d 100644
--- a/crates/shirabe/src/util/svn.rs
+++ b/crates/shirabe/src/util/svn.rs
@@ -1,8 +1,11 @@
//! ref: composer/src/Composer/Util/Svn.php
+use crate::config::Config;
+use crate::io::IOInterface;
+use crate::io::IOInterfaceImmutable;
use crate::io::io_interface;
-use std::sync::Mutex;
-
+use crate::util::Platform;
+use crate::util::ProcessExecutor;
use anyhow::Result;
use indexmap::IndexMap;
use shirabe_external_packages::composer::pcre::{CaptureKey, Preg};
@@ -10,12 +13,7 @@ use shirabe_php_shim::{
LogicException, PHP_URL_HOST, PhpMixed, RuntimeException, empty, implode, parse_url,
parse_url_all, stripos, strpos, trim,
};
-
-use crate::config::Config;
-use crate::io::IOInterface;
-use crate::io::IOInterfaceImmutable;
-use crate::util::Platform;
-use crate::util::ProcessExecutor;
+use std::sync::Mutex;
#[derive(Debug, Clone)]
pub struct SvnCredentials {