Skip to content

Commit 2622249

Browse files
committed
refactor: update imports to include ZArray in multiple files and remove unused Drop implementation
1 parent 5230fb1 commit 2622249

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

examples/hello/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
99
// See the Mulan PSL v2 for more details.
1010

11-
use phper::{echo, functions::Argument, modules::Module, php_get_module, values::ZVal};
11+
use phper::{
12+
arrays::ZArray, echo, functions::Argument, modules::Module, php_get_module, values::ZVal,
13+
};
1214

1315
/// The php function, receive arguments with type `ZVal`.
1416
fn say_hello(arguments: &mut [ZVal]) -> phper::Result<()> {

examples/http-server/src/server.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use axum::{
1717
};
1818
use phper::{
1919
alloc::ToRefOwned,
20+
arrays::ZArray,
2021
classes::{ClassEntity, Visibility},
2122
functions::Argument,
2223
values::ZVal,

examples/http-server/tests/integration.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use std::{
1717
thread::sleep,
1818
time::Duration,
1919
};
20+
use hyper::StatusCode;
2021

2122
#[test]
2223
fn test_php() {
@@ -39,6 +40,7 @@ fn test_php() {
3940
let client = Client::new();
4041
for _ in 0..5 {
4142
let response = client.get("http://127.0.0.1:9000/").send().unwrap();
43+
assert_eq!(response.status(), StatusCode::OK);
4244
let content_type = response.headers().get(CONTENT_TYPE).unwrap();
4345
assert_eq!(content_type, "text/plain");
4446
let body = response.text().unwrap();

phper/src/objects.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -407,14 +407,6 @@ impl<T: 'static> StateObj<T> {
407407
}
408408
}
409409

410-
impl<T> Drop for StateObj<T> {
411-
fn drop(&mut self) {
412-
unsafe {
413-
phper_zend_object_release(self.as_mut_ptr());
414-
}
415-
}
416-
}
417-
418410
impl<T> Deref for StateObj<T> {
419411
type Target = ZObj;
420412

0 commit comments

Comments
 (0)