@@ -8,7 +8,8 @@ use crate::{
88 ffi:: zend_throw_exception_ex,
99 ffi:: zend_throw_exception_object,
1010 flags:: ClassFlags ,
11- zend:: { ce, ClassEntry } , types:: Zval ,
11+ types:: Zval ,
12+ zend:: { ce, ClassEntry } ,
1213} ;
1314
1415/// Result type with the error variant as a [`PhpException`].
@@ -38,7 +39,12 @@ impl PhpException {
3839 /// * `code` - Integer code to go inside the exception.
3940 /// * `ex` - Exception type to throw.
4041 pub fn new ( message : String , code : i32 , ex : & ' static ClassEntry ) -> Self {
41- Self { message, code, ex, object : None , }
42+ Self {
43+ message,
44+ code,
45+ ex,
46+ object : None ,
47+ }
4248 }
4349
4450 /// Creates a new default exception instance, using the default PHP
@@ -77,9 +83,7 @@ impl PhpException {
7783 /// and an error otherwise.
7884 pub fn throw ( self ) -> Result < ( ) > {
7985 match self . object {
80- Some ( object) => {
81- throw_object ( object)
82- } ,
86+ Some ( object) => throw_object ( object) ,
8387 None => throw_with_code ( self . ex , self . code , & self . message ) ,
8488 }
8589 }
@@ -166,7 +170,6 @@ pub fn throw_with_code(ex: &ClassEntry, code: i32, message: &str) -> Result<()>
166170 Ok ( ( ) )
167171}
168172
169-
170173/// Throws an exception object.
171174///
172175/// Returns a result containing nothing if the exception was successfully
0 commit comments