Skip to content

Commit 7796e30

Browse files
authored
Merge branch 'master' into request-global
2 parents b5bde5c + e06fbaa commit 7796e30

File tree

9 files changed

+68
-14
lines changed

9 files changed

+68
-14
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: [ubuntu-latest, macos-latest, windows-latest]
18-
php: ["8.0", "8.1", "8.2", "8.3"]
18+
php: ["8.0", "8.1", "8.2", "8.3", "8.4"]
1919
rust: [stable, nightly]
2020
clang: ["15", "17"]
2121
phpts: [ts, nts]

build.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use bindgen::RustTarget;
1616
use impl_::Provider;
1717

1818
const MIN_PHP_API_VER: u32 = 20200930;
19-
const MAX_PHP_API_VER: u32 = 20230831;
19+
const MAX_PHP_API_VER: u32 = 20240924;
2020

2121
pub trait PHPProvider<'a>: Sized {
2222
/// Create a new PHP provider.
@@ -229,9 +229,13 @@ fn check_php_version(info: &PHPInfo) -> Result<()> {
229229
const PHP_82_API_VER: u32 = 20220829;
230230

231231
const PHP_83_API_VER: u32 = 20230831;
232-
233-
println!("cargo::rustc-check-cfg=cfg(php80, php81, php82, php83, php_zts, php_debug, docs)");
234-
232+
233+
const PHP_84_API_VER: u32 = 20240924;
234+
235+
println!(
236+
"cargo::rustc-check-cfg=cfg(php80, php81, php82, php83, php84, php_zts, php_debug, docs)"
237+
);
238+
235239
if version < PHP_81_API_VER {
236240
println!("cargo:rustc-cfg=php80");
237241
}
@@ -244,10 +248,14 @@ fn check_php_version(info: &PHPInfo) -> Result<()> {
244248
println!("cargo:rustc-cfg=php82");
245249
}
246250

247-
if version >= PHP_83_API_VER {
251+
if (PHP_83_API_VER..PHP_84_API_VER).contains(&version) {
248252
println!("cargo:rustc-cfg=php83");
249253
}
250254

255+
if version >= PHP_84_API_VER {
256+
println!("cargo:rustc-cfg=php84");
257+
}
258+
251259
Ok(())
252260
}
253261

crates/cli/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

crates/cli/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/target
2+
Cargo.lock
3+
/.vscode
4+
/.idea
5+
/tmp
6+
expand.rs

crates/macros/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

crates/macros/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/target
2+
Cargo.lock
3+
/.vscode
4+
/.idea
5+
/tmp
6+
expand.rs

crates/macros/src/impl_.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ pub fn parse_attribute(attr: &Attribute) -> Result<Option<ParsedAttribute>> {
187187
Ok(Some(match name.as_ref() {
188188
"defaults" => {
189189
let defaults = HashMap::from_meta(&meta)
190-
.map_err(|_| anyhow!("Unable to parse `#[default]` macro."))?;
190+
.map_err(|_| anyhow!("Unable to parse `#[defaults]` macro."))?;
191191
ParsedAttribute::Default(defaults)
192192
}
193193
"optional" => {

src/builders/function.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ impl<'a> FunctionBuilder<'a> {
5555
arg_info: ptr::null(),
5656
num_args: 0,
5757
flags: 0, // TBD?
58+
#[cfg(php84)]
59+
doc_comment: ptr::null(),
60+
#[cfg(php84)]
61+
frameless_function_infos: ptr::null(),
5862
},
5963
args: vec![],
6064
n_req: None,
@@ -79,6 +83,10 @@ impl<'a> FunctionBuilder<'a> {
7983
arg_info: ptr::null(),
8084
num_args: 0,
8185
flags: MethodFlags::Abstract.bits(),
86+
#[cfg(php84)]
87+
doc_comment: ptr::null(),
88+
#[cfg(php84)]
89+
frameless_function_infos: ptr::null(),
8290
},
8391
args: vec![],
8492
n_req: None,

src/zend/function.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ impl FunctionEntry {
3838
arg_info: ptr::null(),
3939
num_args: 0,
4040
flags: 0,
41+
#[cfg(php84)]
42+
doc_comment: ptr::null(),
43+
#[cfg(php84)]
44+
frameless_function_infos: ptr::null(),
4145
}
4246
}
4347

src/zend/handlers.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,18 @@ impl ZendObjectHandlers {
238238
let mut zv = Zval::new();
239239
val.get(self_, &mut zv)?;
240240

241-
#[allow(clippy::unnecessary_mut_passed)]
242-
if zend_is_true(&mut zv) == 1 {
243-
return Ok(1);
241+
cfg_if::cfg_if! {
242+
if #[cfg(php84)] {
243+
#[allow(clippy::unnecessary_mut_passed)]
244+
if zend_is_true(&mut zv) == true {
245+
return Ok(1);
246+
}
247+
} else {
248+
#[allow(clippy::unnecessary_mut_passed)]
249+
if zend_is_true(&mut zv) == 1 {
250+
return Ok(1);
251+
}
252+
}
244253
}
245254
}
246255
}

0 commit comments

Comments
 (0)