From 4befbc4b95e09c2c6deeaaa6640b72a2d0f421f4 Mon Sep 17 00:00:00 2001 From: Ruslan Baidan Date: Tue, 12 Jul 2016 12:24:22 +0200 Subject: [PATCH] Added the additional condition to make possible skipping the validation if in a sniff would be cleaned up the listeners and tokens lists. --- CodeSniffer/File.php | 1 + 1 file changed, 1 insertion(+) diff --git a/CodeSniffer/File.php b/CodeSniffer/File.php index 36cc44f89e..d9a04d6701 100644 --- a/CodeSniffer/File.php +++ b/CodeSniffer/File.php @@ -532,6 +532,7 @@ public function start($contents=null) if (isset($this->_ignoredListeners[$listenerData['class']]) === true || (isset($listenerIgnoreTo[$listenerData['class']]) === true && $listenerIgnoreTo[$listenerData['class']] > $stackPtr) + || empty($this->_listeners) === true ) { // This sniff is ignoring past this token, or the whole file. continue;