PhpCsFixer\Tokenizer\Tokens::isChanged PHP Method

isChanged() public method

Check if collection was change: collection itself (like insert new tokens) or any of collection's elements.
public isChanged ( ) : boolean
return boolean
    public function isChanged()
    {
        if ($this->changed) {
            return true;
        }
        foreach ($this as $token) {
            if ($token->isChanged()) {
                return true;
            }
        }
        return false;
    }

Usage Example

 private function runHelperFixers(\SplFileInfo $file, Tokens $tokens)
 {
     /** @var AbstractAlignFixerHelper $helper */
     foreach ($this->alignFixerHelpers as $helper) {
         if ($tokens->isChanged()) {
             $tokens->clearEmptyTokens();
         }
         $helper->fix($file, $tokens);
     }
 }