(
&self, class_name: Option<&str>, function_name: &str,
)
| 53 | } |
| 54 | |
| 55 | fn hook( |
| 56 | &self, class_name: Option<&str>, function_name: &str, |
| 57 | ) -> Option<( |
| 58 | Box<crate::execute::BeforeExecuteHook>, |
| 59 | Box<crate::execute::AfterExecuteHook>, |
| 60 | )> { |
| 61 | match (class_name, function_name) { |
| 62 | (Some("PDO"), "__construct") => Some(self.hook_pdo_construct()), |
| 63 | (Some("PDO"), f) |
| 64 | if [ |
| 65 | "exec", |
| 66 | "query", |
| 67 | "prepare", |
| 68 | "commit", |
| 69 | "begintransaction", |
| 70 | "rollback", |
| 71 | ] |
| 72 | .contains(&f) => |
| 73 | { |
| 74 | Some(self.hook_pdo_methods(function_name)) |
| 75 | } |
| 76 | (Some("PDOStatement"), f) |
| 77 | if ["execute", "fetch", "fetchAll", "fetchColumn", "fetchObject"].contains(&f) => |
| 78 | { |
| 79 | Some(self.hook_pdo_statement_methods(function_name)) |
| 80 | } |
| 81 | _ => None, |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | impl PdoPlugin { |
no test coverage detected