aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-shim/src/stream.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-09 07:47:48 +0900
committernsfisis <nsfisis@gmail.com>2026-08-09 07:48:16 +0900
commit20a876d44a7f7fe8f5d4cc77eb79a9a359aaf150 (patch)
tree2501c7f9b94e0bb2f47f1b2295583c543b52e76b /crates/shirabe-php-shim/src/stream.rs
parent627aaead32dcf38bed255012fcf7965d9553f52e (diff)
downloadphp-shirabe-20a876d44a7f7fe8f5d4cc77eb79a9a359aaf150.tar.gz
php-shirabe-20a876d44a7f7fe8f5d4cc77eb79a9a359aaf150.tar.zst
php-shirabe-20a876d44a7f7fe8f5d4cc77eb79a9a359aaf150.zip
refactor(php-shim): remove shim functions with no callers
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-php-shim/src/stream.rs')
-rw-r--r--crates/shirabe-php-shim/src/stream.rs28
1 files changed, 1 insertions, 27 deletions
diff --git a/crates/shirabe-php-shim/src/stream.rs b/crates/shirabe-php-shim/src/stream.rs
index 50f984b5..daf4c0af 100644
--- a/crates/shirabe-php-shim/src/stream.rs
+++ b/crates/shirabe-php-shim/src/stream.rs
@@ -20,14 +20,6 @@ pub fn stream_resolve_include_path(filename: impl AsRef<std::path::Path>) -> Opt
todo!()
}
-/// PHP `stream_get_contents()` with an explicit max length.
-pub fn stream_get_contents_with_max(
- stream: &PhpResource,
- max_length: Option<i64>,
-) -> Option<String> {
- stream_read_remaining(stream, max_length)
-}
-
// Reads from the stream's current position: all remaining bytes, or up to `max_length` when given
// (a negative max means "until end").
fn stream_read_remaining(stream: &PhpResource, max_length: Option<i64>) -> Option<String> {
@@ -64,7 +56,7 @@ fn stream_read_remaining(stream: &PhpResource, max_length: Option<i64>) -> Optio
// A stream context is modeled as an object holding the two arrays PHP keeps for it: the per-wrapper
// `options` and the `params`. This is a self-contained value, so it round-trips through the
-// accessors below without any registry.
+// accessor below without any registry.
pub fn stream_context_create(
options: &IndexMap<String, PhpMixed>,
params: Option<&IndexMap<String, PhpMixed>>,
@@ -89,24 +81,6 @@ pub fn stream_context_get_options(stream_or_context: &PhpMixed) -> IndexMap<Stri
}
}
-pub fn stream_context_get_params(stream_or_context: &PhpMixed) -> IndexMap<String, PhpMixed> {
- let (options, params) = match stream_or_context {
- PhpMixed::Object(context) | PhpMixed::Array(context) => (
- context.get("options").cloned().unwrap_or_default(),
- context
- .get("params")
- .and_then(PhpMixed::as_array)
- .cloned()
- .unwrap_or_default(),
- ),
- _ => (PhpMixed::default(), IndexMap::new()),
- };
- // PHP exposes the wrapper options under an "options" key alongside the params.
- let mut result = params;
- result.insert("options".to_string(), options);
- result
-}
-
pub fn stream_isatty(stream: PhpResource) -> bool {
stream_isatty_resource(&stream)
}