code: public function detab(Text $text, array $options = array())
      {
          /** @noinspection PhpUnusedParameterInspection */
          $text->replace('/(.*?)\t/', function (Text $whole, Text $string) use ($options) {
              return $string . str_repeat(' ', $options['tabWidth'] - $string->getLength() % $options['tabWidth']);
          });
      }
docs: Convert tabs to spaces
  
  @param Text  $text
  @param array $options