Skip to content

Commit

Permalink
Merge pull request #10701 from nanaya/helper-cleanup
Browse files Browse the repository at this point in the history
Remove unused helper functions
  • Loading branch information
notbakaneko authored Nov 2, 2023
2 parents bc3cdb0 + 5808d36 commit 97d7355
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -1448,24 +1448,6 @@ function get_class_namespace($className)
return substr($className, 0, strrpos($className, '\\'));
}

function ci_file_search($fileName)
{
if (file_exists($fileName)) {
return is_file($fileName) ? $fileName : false;
}

$directoryName = dirname($fileName);
$fileArray = glob($directoryName.'/*', GLOB_NOSORT);
$fileNameLowerCase = strtolower($fileName);
foreach ($fileArray as $file) {
if (strtolower($file) === $fileNameLowerCase) {
return is_file($file) ? $file : false;
}
}

return false;
}

function sanitize_filename($file)
{
$file = mb_ereg_replace('[^\w\s\d\-_~,;\[\]\(\).]', '', $file);
Expand Down Expand Up @@ -1732,24 +1714,6 @@ function format_percentage($number, $precision = 2)
return i18n_number_format($number / 100, NumberFormatter::PERCENT, null, $precision);
}

function group_users_by_online_state($users)
{
$online = $offline = [];

foreach ($users as $user) {
if ($user->isOnline()) {
$online[] = $user;
} else {
$offline[] = $user;
}
}

return [
'online' => $online,
'offline' => $offline,
];
}

// shorthand to return the filename of an open stream/handle
function get_stream_filename($handle)
{
Expand Down

0 comments on commit 97d7355

Please sign in to comment.