private function detectIndent(Tokens $tokens, $index) { if (!$tokens[$index - 1]->isWhitespace()) { return ''; // cannot detect indent } $explodedContent = explode("\n", $tokens[$index - 1]->getContent()); return end($explodedContent); }