aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/command')
-rw-r--r--crates/shirabe/src/command/config_command.rs4
-rw-r--r--crates/shirabe/src/command/diagnose_command.rs12
2 files changed, 7 insertions, 9 deletions
diff --git a/crates/shirabe/src/command/config_command.rs b/crates/shirabe/src/command/config_command.rs
index 2ee6fd2..7dcd6bf 100644
--- a/crates/shirabe/src/command/config_command.rs
+++ b/crates/shirabe/src/command/config_command.rs
@@ -13,8 +13,8 @@ use shirabe_php_shim::{
InvalidArgumentException, JsonObject, PhpMixed, RuntimeException, array_filter,
array_filter_use_key, array_is_list, array_map, array_merge, array_unique, count,
escapeshellcmd, exec, explode, file_exists, file_get_contents, implode, in_array, is_array,
- is_bool, is_dir, is_numeric, is_object, is_string, json_encode, key, sort, sprintf,
- str_replace, str_starts_with, strpos, strtolower, system, touch, var_export,
+ is_bool, is_dir, is_numeric, is_object, is_string, json_encode, sort, sprintf, str_replace,
+ str_starts_with, strpos, strtolower, system, touch, var_export,
};
use std::cell::RefCell;
use std::rc::Rc;
diff --git a/crates/shirabe/src/command/diagnose_command.rs b/crates/shirabe/src/command/diagnose_command.rs
index 4b1c241..1210956 100644
--- a/crates/shirabe/src/command/diagnose_command.rs
+++ b/crates/shirabe/src/command/diagnose_command.rs
@@ -15,8 +15,8 @@ use shirabe_php_shim::{
PHP_VERSION, PHP_VERSION_ID, PHP_WINDOWS_VERSION_BUILD, PhpMixed, RuntimeException, count,
curl_version, defined, disk_free_space, extension_loaded, file_exists, filter_var_boolean,
function_exists, get_class, get_class_err, hash, implode, ini_get, ioncube_loader_iversion,
- ioncube_loader_version, is_array, is_string, key, ob_get_clean, ob_start, phpinfo, reset,
- rtrim, sprintf, str_contains, str_replace, str_starts_with, strpos, strstr, strtolower, trim,
+ ioncube_loader_version, is_array, is_string, ob_get_clean, ob_start, phpinfo, reset, rtrim,
+ sprintf, str_contains, str_replace, str_starts_with, strpos, strstr, strtolower, trim,
version_compare,
};
use std::cell::RefCell;
@@ -690,12 +690,10 @@ impl DiagnoseCommand {
let path = str_replace(
"%hash%",
hash_val.as_string().unwrap_or(""),
- &key(provider_includes
+ &provider_includes
.as_array()
- .cloned()
- .unwrap_or_default()
- .into())
- .unwrap_or_default(),
+ .and_then(|a| a.keys().next().cloned())
+ .unwrap_or_default(),
);
let response = self.http_downloader.as_ref().unwrap().borrow_mut().get(
&format!("{}://repo.packagist.org/{}", protocol, path),