original_string: private function base64Encode($uri) {
  
          if (null === $uri) {
              return null;
          }
  
          $splFileObject = new SplFileObject($uri);
  
          if (30100 < Kernel::VERSION_ID) {
              return (new DataUriNormalizer())->normalize($splFileObject);
          }
  
          $data = "";
          while (false === $splFileObject->eof()) {
              $data .= $splFileObject->fgets();
          }
  
          return sprintf("data:%s;base64,%s", mime_content_type($uri), base64_encode($data));
      }
code: private function base64Encode($uri) {
  
          if (null === $uri) {
              return null;
          }
  
          $splFileObject = new SplFileObject($uri);
  
          if (30100 < Kernel::VERSION_ID) {
              return (new DataUriNormalizer())->normalize($splFileObject);
          }
  
          $data = "";
          while (false === $splFileObject->eof()) {
              $data .= $splFileObject->fgets();
          }
  
          return sprintf("data:%s;base64,%s", mime_content_type($uri), base64_encode($data));
      }
code_tokens: private function base64Encode ( $ uri ) { if ( null === $ uri ) { return null ; } $ splFileObject = new SplFileObject ( $ uri ) ; if ( 30100 < Kernel :: VERSION_ID ) { return ( new DataUriNormalizer ( ) ) -> normalize ( $ splFileObject ) ; } $ data = "" ; while ( false === $ splFileObject -> eof ( ) ) { $ data .= $ splFileObject -> fgets ( ) ; } return sprintf ( "data:%s;base64,%s" , mime_content_type ( $ uri ) , base64_encode ( $ data ) ) ; }
docstring: Encode an URI into base 64.
  
  @param string $uri The URI.
  @return string Returns the URI encoded into base 64.
  @throws ExceptionInterface Throws an exception if an error occurs
docstring_tokens: Encode an URI into base 64 .