aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/L10N
diff options
context:
space:
mode:
authorHamid Dehnavi <hamid.dev.pro@gmail.com>2023-07-07 04:54:20 +0330
committerHamid Dehnavi <hamid.dev.pro@gmail.com>2023-07-07 04:54:20 +0330
commitd0b20534b94d0295472ab22157a2bc4c2c9fb703 (patch)
tree11778f60be448d4a2eb9e0d66d2cd1a164898c01 /lib/private/L10N
parent56402460121080cb0d63e4c4d4ec51e5b409fed2 (diff)
downloadnextcloud-server-d0b20534b94d0295472ab22157a2bc4c2c9fb703.tar.gz
nextcloud-server-d0b20534b94d0295472ab22157a2bc4c2c9fb703.zip
Refactor "substr" calls to improve code readability
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
Diffstat (limited to 'lib/private/L10N')
-rw-r--r--lib/private/L10N/Factory.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php
index 778124c4c38..f7d3fec4ff6 100644
--- a/lib/private/L10N/Factory.php
+++ b/lib/private/L10N/Factory.php
@@ -358,7 +358,7 @@ class Factory implements IFactory {
$files = scandir($dir);
if ($files !== false) {
foreach ($files as $file) {
- if (substr($file, -5) === '.json' && substr($file, 0, 4) !== 'l10n') {
+ if (str_ends_with($file, '.json') && !str_starts_with($file, 'l10n')) {
$available[] = substr($file, 0, -5);
}
}
@@ -374,7 +374,7 @@ class Factory implements IFactory {
$files = scandir($themeDir);
if ($files !== false) {
foreach ($files as $file) {
- if (substr($file, -5) === '.json' && substr($file, 0, 4) !== 'l10n') {
+ if (str_ends_with($file, '.json') && !str_starts_with($file, 'l10n')) {
$available[] = substr($file, 0, -5);
}
}