src/FileSystem/Folder.php
public static function findCommonPath($directories)
  {
    while(count($directories) !== 1) {
      usort($directories, function($a, $b) {
        return strlen($b) - strlen($a);
      });
      $directories[0] = dirname($directories[0]);
      $directories = array_unique($directories);
    }
    return reset($directories);
  }
public static function findCommonPath($directories)
  {
    while(count($directories) !== 1) {
      usort($directories, function($a, $b) {
        return strlen($b) - strlen($a);
      });
      $directories[0] = dirname($directories[0]);
      $directories = array_unique($directories);
    }
    return reset($directories);
  }
public static function findCommonPath ( $ directories ) { while ( count ( $ directories ) !== 1 ) { usort ( $ directories , function ( $ a , $ b ) { return strlen ( $ b ) - strlen ( $ a ) ; } ) ; $ directories [ 0 ] = dirname ( $ directories [ 0 ] ) ; $ directories = array_unique ( $ directories ) ; } return reset ( $ directories ) ; }
Retourne la partie commune des chemins de plusieurs dossiers

@param  array $directories  Liste de dossiers
@return string              Partie commune des paths
Retourne la partie commune des chemins de plusieurs dossiers