original_string: public function getContent(string $filename, array $options = []): ?string
      {
          if (!empty($options)) {
              $this->validateOptions($options);
          }
          $urlOptions = [];
          if (isset($options['width'])) {
              $urlOptions['width'] = $options['width'];
          }
          if (isset($options['height'])) {
              $urlOptions['height'] = $options['height'];
          }
          if (isset($options['outputType'])) {
              $urlOptions['outputType'] = $options['outputType'];
          }
          $url = $this->getURL($filename, $urlOptions);
          $path = substr($url, strlen($this->app->request->base));
  
          $request = new \BearFramework\App\Request();
          $request->path->set($path);
          $response = $this->getResponse($request);
          if ($response === null) {
              return null;
          }
          $content = file_get_contents($response->filename);
          if (isset($options['encoding'])) {
              if ($options['encoding'] === 'base64') {
                  return base64_encode($content);
              } elseif ($options['encoding'] === 'data-uri') {
                  $mimeType = $this->getMimeType($filename);
                  return 'data:' . $mimeType . ',' . $content;
              } elseif ($options['encoding'] === 'data-uri-base64') {
                  $mimeType = $this->getMimeType($filename);
                  return 'data:' . $mimeType . ';base64,' . base64_encode($content);
              } else {
                  throw new \InvalidArgumentException('Unsupported encoding type (' . $options['encoding'] . ')');
              }
          }
          return $content;
      }
code: public function getContent(string $filename, array $options = []): ?string
      {
          if (!empty($options)) {
              $this->validateOptions($options);
          }
          $urlOptions = [];
          if (isset($options['width'])) {
              $urlOptions['width'] = $options['width'];
          }
          if (isset($options['height'])) {
              $urlOptions['height'] = $options['height'];
          }
          if (isset($options['outputType'])) {
              $urlOptions['outputType'] = $options['outputType'];
          }
          $url = $this->getURL($filename, $urlOptions);
          $path = substr($url, strlen($this->app->request->base));
  
          $request = new \BearFramework\App\Request();
          $request->path->set($path);
          $response = $this->getResponse($request);
          if ($response === null) {
              return null;
          }
          $content = file_get_contents($response->filename);
          if (isset($options['encoding'])) {
              if ($options['encoding'] === 'base64') {
                  return base64_encode($content);
              } elseif ($options['encoding'] === 'data-uri') {
                  $mimeType = $this->getMimeType($filename);
                  return 'data:' . $mimeType . ',' . $content;
              } elseif ($options['encoding'] === 'data-uri-base64') {
                  $mimeType = $this->getMimeType($filename);
                  return 'data:' . $mimeType . ';base64,' . base64_encode($content);
              } else {
                  throw new \InvalidArgumentException('Unsupported encoding type (' . $options['encoding'] . ')');
              }
          }
          return $content;
      }
code_tokens: public function getContent ( string $ filename , array $ options = [ ] ) : ? string { if ( ! empty ( $ options ) ) { $ this -> validateOptions ( $ options ) ; } $ urlOptions = [ ] ; if ( isset ( $ options [ 'width' ] ) ) { $ urlOptions [ 'width' ] = $ options [ 'width' ] ; } if ( isset ( $ options [ 'height' ] ) ) { $ urlOptions [ 'height' ] = $ options [ 'height' ] ; } if ( isset ( $ options [ 'outputType' ] ) ) { $ urlOptions [ 'outputType' ] = $ options [ 'outputType' ] ; } $ url = $ this -> getURL ( $ filename , $ urlOptions ) ; $ path = substr ( $ url , strlen ( $ this -> app -> request -> base ) ) ; $ request = new \ BearFramework \ App \ Request ( ) ; $ request -> path -> set ( $ path ) ; $ response = $ this -> getResponse ( $ request ) ; if ( $ response === null ) { return null ; } $ content = file_get_contents ( $ response -> filename ) ; if ( isset ( $ options [ 'encoding' ] ) ) { if ( $ options [ 'encoding' ] === 'base64' ) { return base64_encode ( $ content ) ; } elseif ( $ options [ 'encoding' ] === 'data-uri' ) { $ mimeType = $ this -> getMimeType ( $ filename ) ; return 'data:' . $ mimeType . ',' . $ content ; } elseif ( $ options [ 'encoding' ] === 'data-uri-base64' ) { $ mimeType = $ this -> getMimeType ( $ filename ) ; return 'data:' . $ mimeType . ';base64,' . base64_encode ( $ content ) ; } else { throw new \ InvalidArgumentException ( 'Unsupported encoding type (' . $ options [ 'encoding' ] . ')' ) ; } } return $ content ; }
docstring: Returns the content of the file specified.
  
  @param string $filename The filename.
  @param array $options List of options. You can resize the file by providing "width", "height" or both. You can specify encoding too (base64, data-uri, data-uri-base64).
  @throws \InvalidArgumentException
  @return string|null The content of the file or null if file does not exists.
docstring_tokens: Returns the content of the file specified .