original_string: public static function lastChange($dirs, Cache $cache = NULL, &$cache_key = "") {
          $files = call_user_func_array("array_merge", array_map(function($dir) {
              if(!is_dir($dir)) return [];
              return iterator_to_array(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir)));
          }, (array)$dirs));
  
          if(!$files) {
              return NULL;
          }
  
          $files = array_filter($files, function($file) { return !is_link($file); });
  
          usort($files, function($a, $b) { return $b->getMTime() - $a->getMTime(); });
  
          if(!$cache) {
              return $files[0];
          }
  
          $lastchange = $files[0]->getMTime();
  
          $cache_key = "Loops-Misc-filesChanged-".implode("-", $dirs);
  
          if($cache->contains($cache_key)) {
              $mtime = $cache->fetch($cache_key);
          }
          else {
              $mtime = FALSE;
          }
  
          $cache->save($cache_key, $lastchange);
  
          if($mtime != $lastchange) {
              return $files[0];
          }
  
          return NULL;
      }
code: public static function lastChange($dirs, Cache $cache = NULL, &$cache_key = "") {
          $files = call_user_func_array("array_merge", array_map(function($dir) {
              if(!is_dir($dir)) return [];
              return iterator_to_array(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir)));
          }, (array)$dirs));
  
          if(!$files) {
              return NULL;
          }
  
          $files = array_filter($files, function($file) { return !is_link($file); });
  
          usort($files, function($a, $b) { return $b->getMTime() - $a->getMTime(); });
  
          if(!$cache) {
              return $files[0];
          }
  
          $lastchange = $files[0]->getMTime();
  
          $cache_key = "Loops-Misc-filesChanged-".implode("-", $dirs);
  
          if($cache->contains($cache_key)) {
              $mtime = $cache->fetch($cache_key);
          }
          else {
              $mtime = FALSE;
          }
  
          $cache->save($cache_key, $lastchange);
  
          if($mtime != $lastchange) {
              return $files[0];
          }
  
          return NULL;
      }
code_tokens: public static function lastChange ( $ dirs , Cache $ cache = NULL , & $ cache_key = "" ) { $ files = call_user_func_array ( "array_merge" , array_map ( function ( $ dir ) { if ( ! is_dir ( $ dir ) ) return [ ] ; return iterator_to_array ( new RecursiveIteratorIterator ( new RecursiveDirectoryIterator ( $ dir ) ) ) ; } , ( array ) $ dirs ) ) ; if ( ! $ files ) { return NULL ; } $ files = array_filter ( $ files , function ( $ file ) { return ! is_link ( $ file ) ; } ) ; usort ( $ files , function ( $ a , $ b ) { return $ b -> getMTime ( ) - $ a -> getMTime ( ) ; } ) ; if ( ! $ cache ) { return $ files [ 0 ] ; } $ lastchange = $ files [ 0 ] -> getMTime ( ) ; $ cache_key = "Loops-Misc-filesChanged-" . implode ( "-" , $ dirs ) ; if ( $ cache -> contains ( $ cache_key ) ) { $ mtime = $ cache -> fetch ( $ cache_key ) ; } else { $ mtime = FALSE ; } $ cache -> save ( $ cache_key , $ lastchange ) ; if ( $ mtime != $ lastchange ) { return $ files [ 0 ] ; } return NULL ; }
docstring: Finds the lastest change in a directory since the last call, if there were any.
  
  To implement this feature across requests, the last change time is stored into a Doctrine\Common\Cache\Cache.
  
  @params array<string>|string $dirs A single directories or an array of multiple directories that are going to be checked for changes
  @params Doctrine\Common\Cache\Cache $cache A Doctrine cache object
  @params string $cache_key The key that has been used to store the last modification time
  @params DateTime The last modification time or NULL if no file has been changed since the last call of Misc::lastChange
docstring_tokens: Finds the lastest change in a directory since the last call if there were any .