You will need an associative array where each key is associated with an array of files, to achieve this, try this:
public static function groupByOwners($files)
{
foreach($files as $file => $name) {
if (isset($newArray[$name])) {
array_push($newArray[$name], $file);
} else {
$newArray[$name] = array($file);
}
}
return $newArray;
}