Member predicate Statement::Stmt::getEnclosingCallable

Gets the immediately enclosing callable (method or constructor) whose body contains this statement.

Callable getEnclosingCallable()