private function isRewritable(\PHPParser_Node $startNode, AbstractToken $token, array &$imports, AbstractToken &$lastToken = null, &$writeMultiple = false)
 {
     $namespaceNode = \Scrutinizer\PhpAnalyzer\PhpParser\NodeUtil::findParent($startNode, 'PHPParser_Node_Stmt_Namespace') ?: $this->fixedFile->getAst();
     $preserveMultiple = $this->getSetting('preserve_multiple');
     $matchedAtLeastOne = false;
     $writeMultiple = false;
     while ($token->matches(T_USE)) {
         $currentImports = array();
         $currentLastToken = null;
         $currentMultiple = false;
         if (!$this->isSafeToRewrite($token, $currentImports, $currentLastToken, $currentMultiple)) {
             break;
         }
         // If we are supposed to preserve multiples, and we already matched
         // some single use statements, bail out here. We will come back when
         // reaching the T_USE of the multiple import statement.
         if ($currentMultiple && $matchedAtLeastOne && $preserveMultiple) {
             break;
         }
         $this->removeUnused($namespaceNode, $currentImports);
         $matchedAtLeastOne = true;
         $imports = array_merge($imports, $currentImports);
         $lastToken = $currentLastToken;
         // If we scanned a multiple imports use statement, and we are supposed
         // to preserve it, bail out here as we have already reached its end.
         if ($currentMultiple && $preserveMultiple) {
             $writeMultiple = true;
             return true;
         }
         $token = $lastToken->findNextToken('NO_WHITESPACE')->get();
     }
     return $matchedAtLeastOne;
 }