From 556ca1e6c0c2fc0d8526b2d4180e8a08ceb72c08 Mon Sep 17 00:00:00 2001 From: Xenira <1288524+Xenira@users.noreply.github.com> Date: Sun, 1 Dec 2024 23:14:04 +0100 Subject: [PATCH] chore: fix typos --- allowed_bindings.rs | 4 ++-- guide/src/macros/function.md | 2 +- src/embed/mod.rs | 6 +++--- src/macros.rs | 2 +- src/types/array.rs | 2 +- src/zend/globals.rs | 2 +- src/zend/try_catch.rs | 2 +- tests/src/integration/_utils.php | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/allowed_bindings.rs b/allowed_bindings.rs index c6a593808c..ba628ff470 100644 --- a/allowed_bindings.rs +++ b/allowed_bindings.rs @@ -45,8 +45,8 @@ bind! { // ext_php_rs_zend_object_release, // ext_php_rs_zend_string_init, // ext_php_rs_zend_string_release, - // ext_php_rs_is_kown_valid_utf8, - // ext_php_rs_set_kown_valid_utf8, + // ext_php_rs_is_known_valid_utf8, + // ext_php_rs_set_known_valid_utf8, object_properties_init, php_error_docref, php_info_print_table_end, diff --git a/guide/src/macros/function.md b/guide/src/macros/function.md index 4538180f86..d961f5f27b 100644 --- a/guide/src/macros/function.md +++ b/guide/src/macros/function.md @@ -99,7 +99,7 @@ pub fn greet(name: String, age: Option, description: Option) -> Str ## Variadic Functions Variadic functions can be implemented by specifying the last argument in the Rust -function to the type `&[&Zval]`. This is the equivelant of a PHP function using +function to the type `&[&Zval]`. This is the equivalent of a PHP function using the `...$args` syntax. ```rust,no_run diff --git a/src/embed/mod.rs b/src/embed/mod.rs index d91aa70ff1..3d3258d0e3 100644 --- a/src/embed/mod.rs +++ b/src/embed/mod.rs @@ -54,7 +54,7 @@ impl Embed { /// # Returns /// /// * `Ok(())` - The script was executed successfully - /// * `Err(EmbedError)` - An error occured during the execution of the + /// * `Err(EmbedError)` - An error occurred during the execution of the /// script /// /// # Example @@ -154,7 +154,7 @@ impl Embed { match unsafe { *Box::from_raw(panic as *mut std::thread::Result) } { Ok(r) => r, Err(err) => { - // we resume the panic here so it can be catched correctly by the test framework + // we resume the panic here so it can be caught correctly by the test framework resume_unwind(err); } } @@ -168,7 +168,7 @@ impl Embed { /// # Returns /// /// * `Ok(Zval)` - The result of the evaluation - /// * `Err(EmbedError)` - An error occured during the evaluation + /// * `Err(EmbedError)` - An error occurred during the evaluation /// /// # Example /// diff --git a/src/macros.rs b/src/macros.rs index 47f255bed9..49641e6da5 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -1,5 +1,5 @@ //! Macros for interacting with PHP, mainly when the function takes variadic -//! arguments. Unforutunately, this is the best way to handle these. +//! arguments. Unfortunately, this is the best way to handle these. //! Note that most of these will introduce unsafe into your code base. /// Starts the PHP extension information table displayed when running diff --git a/src/types/array.rs b/src/types/array.rs index fae667f946..907e9d0568 100644 --- a/src/types/array.rs +++ b/src/types/array.rs @@ -91,7 +91,7 @@ impl ZendHashTable { /// Panics if memory for the hashtable could not be allocated. pub fn with_capacity(size: u32) -> ZBox { unsafe { - // SAFETY: PHP allocater handles the creation of the array. + // SAFETY: PHP allocator handles the creation of the array. let ptr = _zend_new_array(size); // SAFETY: `as_mut()` checks if the pointer is null, and panics if it is not. diff --git a/src/zend/globals.rs b/src/zend/globals.rs index 21ba29c8c6..17e360ee82 100644 --- a/src/zend/globals.rs +++ b/src/zend/globals.rs @@ -286,7 +286,7 @@ impl ProcessGlobals { /// /// # Panics /// There is an outstanding issue with the implementation of this function. - /// Untill resolved, this function will allways panic. + /// Until resolved, this function will always panic. /// /// - /// - diff --git a/src/zend/try_catch.rs b/src/zend/try_catch.rs index 5d3f56889b..3af511b0e7 100644 --- a/src/zend/try_catch.rs +++ b/src/zend/try_catch.rs @@ -79,7 +79,7 @@ fn do_try_catch R + RefUnwindSafe>(func: F, first: bool) -> Res match unsafe { *Box::from_raw(panic as *mut std::thread::Result) } { Ok(r) => Ok(r), Err(err) => { - // we resume the panic here so it can be catched correctly by the test framework + // we resume the panic here so it can be caught correctly by the test framework resume_unwind(err); } } diff --git a/tests/src/integration/_utils.php b/tests/src/integration/_utils.php index 2201e1f4f0..15d5d3f1d8 100644 --- a/tests/src/integration/_utils.php +++ b/tests/src/integration/_utils.php @@ -7,5 +7,5 @@ function assert_exception_thrown(callable $callback): void } catch (\Throwable $th) { return; } - throw new Exception("Excption was not thrown", 255); + throw new Exception("Exception was not thrown", 255); }