aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-12 03:36:17 +0900
committernsfisis <nsfisis@gmail.com>2026-05-12 03:40:35 +0900
commit8bf5275831a38880c8e85cca6d7b1e3fe5e23991 (patch)
tree400effb824cef711e7e3b365e5905d7bcabee9b5 /crates/shirabe/src
parent4211106824cd8c1beab56d2bfd0e52288ed07361 (diff)
downloadphp-shirabe-8bf5275831a38880c8e85cca6d7b1e3fe5e23991.tar.gz
php-shirabe-8bf5275831a38880c8e85cca6d7b1e3fe5e23991.tar.zst
php-shirabe-8bf5275831a38880c8e85cca6d7b1e3fe5e23991.zip
feat(port): port CurlResponse.php
Diffstat (limited to 'crates/shirabe/src')
-rw-r--r--crates/shirabe/src/util/http/curl_response.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/crates/shirabe/src/util/http/curl_response.rs b/crates/shirabe/src/util/http/curl_response.rs
index 81af5af..97b9a4a 100644
--- a/crates/shirabe/src/util/http/curl_response.rs
+++ b/crates/shirabe/src/util/http/curl_response.rs
@@ -1 +1,31 @@
//! ref: composer/src/Composer/Util/Http/CurlResponse.php
+
+use indexmap::IndexMap;
+use shirabe_php_shim::PhpMixed;
+
+use super::response::Response;
+
+#[derive(Debug)]
+pub struct CurlResponse {
+ inner: Response,
+ curl_info: IndexMap<String, PhpMixed>,
+}
+
+impl CurlResponse {
+ pub fn new(
+ request: IndexMap<String, PhpMixed>,
+ code: Option<i64>,
+ headers: Vec<String>,
+ body: Option<String>,
+ curl_info: IndexMap<String, PhpMixed>,
+ ) -> Self {
+ Self {
+ inner: Response::new(request, code, headers, body),
+ curl_info,
+ }
+ }
+
+ pub fn get_curl_info(&self) -> &IndexMap<String, PhpMixed> {
+ &self.curl_info
+ }
+}