File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -86,8 +86,10 @@ the `count` parameter is no longer long, but a reference.
8686Arguments can have type-hints, nullability and default values applied. Here we define a function that accepts
8787a nullable class (in this case, an interface), and a string with a default value:
8888
89- ``` rust,no-run
89+ ``` rust,no_run
9090use phper::{modules::Module, php_get_module, functions::Argument, echo};
91+ use phper::types::ArgumentTypeHint;
92+ use std::ffi::CString;
9193
9294#[php_get_module]
9395pub fn get_module() -> Module {
Original file line number Diff line number Diff line change @@ -106,10 +106,10 @@ foo.add_static_method(
106106
107107Methods may add argument and return typehints as per functions. For example:
108108
109- ``` rust,no-run
109+ ``` rust,no_run
110110use phper::classes::{ClassEntity, ClassEntry, Visibility};
111- use phper::functions::Argument;
112- use phper::types::{ArgumentTypeHint, ReturnTypeHint},
111+ use phper::functions::{ Argument, ReturnType} ;
112+ use phper::types::{ArgumentTypeHint, ReturnTypeHint};
113113
114114let mut foo = ClassEntity::new("Foo");
115115foo.add_method(
@@ -120,7 +120,7 @@ foo.add_method(
120120 },
121121)
122122.argument(Argument::by_val("a_string").with_type_hint(ArgumentTypeHint::String))
123- .argument(Argument::by_val("an_interface").with_type_hint(ArgumentTypeHint::ClassEntry(String::from(r"\MyNamespace\MyInterface")))))
123+ .argument(Argument::by_val("an_interface").with_type_hint(ArgumentTypeHint::ClassEntry(String::from(r"\MyNamespace\MyInterface"))))
124124.return_type(ReturnType::by_val(ReturnTypeHint::Bool).allow_null());
125125```
126126
You can’t perform that action at this time.
0 commit comments