original_string: protected static function getDirectoriesFoundButNotExpected()
      {
          static $cache = null;
          if(!is_null($cache)) {
              return $cache;
          }
  
          $pluginsInManifest = self::getPluginsFoundInManifest();
          $directoriesInManifest = self::getDirectoriesFoundInManifest();
          $directoriesFoundButNotExpected = array();
  
          foreach (self::getPathsToInvestigate() as $file) {
              $file = substr($file, strlen(PIWIK_DOCUMENT_ROOT)); // remove piwik path to match format in manifest.inc.php
              $file = ltrim($file, "\\/");
              $directory = dirname($file);
  
              if(in_array($directory, $directoriesInManifest)) {
                  continue;
              }
  
              if (self::isFileNotInManifestButExpectedAnyway($file)) {
                  continue;
              }
              if (self::isFileFromPluginNotInManifest($file, $pluginsInManifest)) {
                  continue;
              }
  
              if (!in_array($directory, $directoriesFoundButNotExpected)) {
                  $directoriesFoundButNotExpected[] = $directory;
              }
          }
  
          $cache = self::getParentDirectoriesFromListOfDirectories($directoriesFoundButNotExpected);
          return $cache;
      }
code: protected static function getDirectoriesFoundButNotExpected()
      {
          static $cache = null;
          if(!is_null($cache)) {
              return $cache;
          }
  
          $pluginsInManifest = self::getPluginsFoundInManifest();
          $directoriesInManifest = self::getDirectoriesFoundInManifest();
          $directoriesFoundButNotExpected = array();
  
          foreach (self::getPathsToInvestigate() as $file) {
              $file = substr($file, strlen(PIWIK_DOCUMENT_ROOT)); // remove piwik path to match format in manifest.inc.php
              $file = ltrim($file, "\\/");
              $directory = dirname($file);
  
              if(in_array($directory, $directoriesInManifest)) {
                  continue;
              }
  
              if (self::isFileNotInManifestButExpectedAnyway($file)) {
                  continue;
              }
              if (self::isFileFromPluginNotInManifest($file, $pluginsInManifest)) {
                  continue;
              }
  
              if (!in_array($directory, $directoriesFoundButNotExpected)) {
                  $directoriesFoundButNotExpected[] = $directory;
              }
          }
  
          $cache = self::getParentDirectoriesFromListOfDirectories($directoriesFoundButNotExpected);
          return $cache;
      }
code_tokens: protected static function getDirectoriesFoundButNotExpected ( ) { static $ cache = null ; if ( ! is_null ( $ cache ) ) { return $ cache ; } $ pluginsInManifest = self :: getPluginsFoundInManifest ( ) ; $ directoriesInManifest = self :: getDirectoriesFoundInManifest ( ) ; $ directoriesFoundButNotExpected = array ( ) ; foreach ( self :: getPathsToInvestigate ( ) as $ file ) { $ file = substr ( $ file , strlen ( PIWIK_DOCUMENT_ROOT ) ) ; // remove piwik path to match format in manifest.inc.php $ file = ltrim ( $ file , "\\/" ) ; $ directory = dirname ( $ file ) ; if ( in_array ( $ directory , $ directoriesInManifest ) ) { continue ; } if ( self :: isFileNotInManifestButExpectedAnyway ( $ file ) ) { continue ; } if ( self :: isFileFromPluginNotInManifest ( $ file , $ pluginsInManifest ) ) { continue ; } if ( ! in_array ( $ directory , $ directoriesFoundButNotExpected ) ) { $ directoriesFoundButNotExpected [ ] = $ directory ; } } $ cache = self :: getParentDirectoriesFromListOfDirectories ( $ directoriesFoundButNotExpected ) ; return $ cache ; }
docstring: Look for whole directories which are in the filesystem, but should not be
  
  @return array
docstring_tokens: Look for whole directories which are in the filesystem but should not be