original_string: private function getExampleFileContents($filename)
      {
          $normalizedPath = null;
  
          foreach ($this->exampleDirectories as $directory) {
              $exampleFileFromConfig = $this->constructExamplePath($directory, $filename);
              if (is_readable($exampleFileFromConfig)) {
                  $normalizedPath = $exampleFileFromConfig;
                  break;
              }
          }
  
          if (! $normalizedPath) {
              if (is_readable($this->getExamplePathFromSource($filename))) {
                  $normalizedPath = $this->getExamplePathFromSource($filename);
              } elseif (is_readable($this->getExamplePathFromExampleDirectory($filename))) {
                  $normalizedPath = $this->getExamplePathFromExampleDirectory($filename);
              } elseif (is_readable($filename)) {
                  $normalizedPath = $filename;
              }
          }
  
          return $normalizedPath && is_readable($normalizedPath) ? file($normalizedPath) : null;
      }
code: private function getExampleFileContents($filename)
      {
          $normalizedPath = null;
  
          foreach ($this->exampleDirectories as $directory) {
              $exampleFileFromConfig = $this->constructExamplePath($directory, $filename);
              if (is_readable($exampleFileFromConfig)) {
                  $normalizedPath = $exampleFileFromConfig;
                  break;
              }
          }
  
          if (! $normalizedPath) {
              if (is_readable($this->getExamplePathFromSource($filename))) {
                  $normalizedPath = $this->getExamplePathFromSource($filename);
              } elseif (is_readable($this->getExamplePathFromExampleDirectory($filename))) {
                  $normalizedPath = $this->getExamplePathFromExampleDirectory($filename);
              } elseif (is_readable($filename)) {
                  $normalizedPath = $filename;
              }
          }
  
          return $normalizedPath && is_readable($normalizedPath) ? file($normalizedPath) : null;
      }
code_tokens: private function getExampleFileContents ( $ filename ) { $ normalizedPath = null ; foreach ( $ this -> exampleDirectories as $ directory ) { $ exampleFileFromConfig = $ this -> constructExamplePath ( $ directory , $ filename ) ; if ( is_readable ( $ exampleFileFromConfig ) ) { $ normalizedPath = $ exampleFileFromConfig ; break ; } } if ( ! $ normalizedPath ) { if ( is_readable ( $ this -> getExamplePathFromSource ( $ filename ) ) ) { $ normalizedPath = $ this -> getExamplePathFromSource ( $ filename ) ; } elseif ( is_readable ( $ this -> getExamplePathFromExampleDirectory ( $ filename ) ) ) { $ normalizedPath = $ this -> getExamplePathFromExampleDirectory ( $ filename ) ; } elseif ( is_readable ( $ filename ) ) { $ normalizedPath = $ filename ; } } return $ normalizedPath && is_readable ( $ normalizedPath ) ? file ( $ normalizedPath ) : null ; }
docstring: Attempts to find the requested example file and returns its contents or null if no file was found.
  
  This method will try several methods in search of the given example file, the first one it encounters is
  returned:
  
  1. Iterates through all examples folders for the given filename
  2. Checks the source folder for the given filename
  3. Checks the 'examples' folder in the current working directory for examples
  4. Checks the path relative to the current working directory for the given filename
  
  @param string $filename
  
  @return string|null
docstring_tokens: Attempts to find the requested example file and returns its contents or null if no file was found .