AnalysisResultRawPtr BlockScope::getContainingProgram() { BlockScope *bs = this; while (bs) { if (bs->is(BlockScope::ProgramScope)) { break; } bs = bs->getOuterScope().get(); } return AnalysisResultRawPtr((AnalysisResult*)bs); }
FileScopeRawPtr BlockScope::getContainingFile() { BlockScope *bs = this; while (bs) { if (bs->is(BlockScope::FileScope)) { break; } bs = bs->getOuterScope().get(); } return FileScopeRawPtr((HPHP::FileScope*)bs); }