Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generic/DuplicateClassName: performance fix
As things were, the sniff would unconditionally walk a complete file, making it one of the top 15 slowest sniffs. However, OO structures in PHP cannot be nested, so once we've found an OO declaration, we can skip to the end of it before continuing the token walking. See: https://3v4l.org/pbSTG This small tweak makes a significant difference in the sniff performance without any impact on the sniff results.
- Loading branch information