aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/platform/runtime.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-29 00:03:00 +0900
committernsfisis <nsfisis@gmail.com>2026-06-29 00:03:00 +0900
commit9be0f98f71fe8071ab839ac1036b4064ac3172b4 (patch)
tree66a2f4feba752f4761c40449e0827ad74fc9b02c /crates/shirabe/src/platform/runtime.rs
parenta84d531548efa678d4021cea891826e59f8fb462 (diff)
downloadphp-shirabe-9be0f98f71fe8071ab839ac1036b4064ac3172b4.tar.gz
php-shirabe-9be0f98f71fe8071ab839ac1036b4064ac3172b4.tar.zst
php-shirabe-9be0f98f71fe8071ab839ac1036b4064ac3172b4.zip
chore(lint): ban bare `use anyhow::Result` and fully qualify it
Add a no_banned_use linter that forbids importing anyhow::Result, and update all call sites to reference it via its fully-qualified path so it is never confused with std::result::Result. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/platform/runtime.rs')
-rw-r--r--crates/shirabe/src/platform/runtime.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/shirabe/src/platform/runtime.rs b/crates/shirabe/src/platform/runtime.rs
index fcee930..255aa9d 100644
--- a/crates/shirabe/src/platform/runtime.rs
+++ b/crates/shirabe/src/platform/runtime.rs
@@ -1,6 +1,5 @@
//! ref: composer/src/Composer/Platform/Runtime.php
-use anyhow::Result;
use indexmap::IndexMap;
use shirabe_external_packages::composer::pcre::{CaptureKey, Preg};
use shirabe_php_shim::{
@@ -19,10 +18,10 @@ pub trait RuntimeInterface: std::fmt::Debug {
/// `[class, method]` list), matching PHP `invoke($callable, $arguments)`.
fn invoke(&self, callable: PhpMixed, arguments: Vec<PhpMixed>) -> PhpMixed;
fn has_class(&self, class: &str) -> bool;
- fn construct(&self, class: &str, arguments: Vec<PhpMixed>) -> Result<PhpMixed>;
+ fn construct(&self, class: &str, arguments: Vec<PhpMixed>) -> anyhow::Result<PhpMixed>;
fn get_extensions(&self) -> Vec<String>;
fn get_extension_version(&self, extension: &str) -> String;
- fn get_extension_info(&self, extension: &str) -> Result<String>;
+ fn get_extension_info(&self, extension: &str) -> anyhow::Result<String>;
}
#[derive(Debug)]
@@ -54,7 +53,7 @@ impl RuntimeInterface for Runtime {
class_exists(class)
}
- fn construct(&self, class: &str, arguments: Vec<PhpMixed>) -> Result<PhpMixed> {
+ fn construct(&self, class: &str, arguments: Vec<PhpMixed>) -> anyhow::Result<PhpMixed> {
if arguments.is_empty() {
Ok(instantiate_class(class, vec![]))
} else {
@@ -71,7 +70,7 @@ impl RuntimeInterface for Runtime {
version.unwrap_or_else(|| "0".to_string())
}
- fn get_extension_info(&self, extension: &str) -> Result<String> {
+ fn get_extension_info(&self, extension: &str) -> anyhow::Result<String> {
// Depends on \ReflectionExtension::info() and output buffering; no shim equivalent exists.
let _ = extension;
todo!()