code: private function handleString($str): string
      {
          return is_string($str) &&
              strlen($str) > 0
              && $str !== null ? $str : '';
      }
docs: Handle string when it will throw exception
  @param  mixed $str