diff options
author | hopleus <hopleus@gmail.com> | 2024-03-12 17:23:59 +0300 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-03-14 14:54:58 +0000 |
commit | c834200b486ff40b19e9c9491dea9c902920af4f (patch) | |
tree | d917aa5c9ad29c27efc3636b065d21d7f703d44e /lib | |
parent | abb30aae11f17ed281a0642515fd41909e6b85c4 (diff) | |
download | nextcloud-server-c834200b486ff40b19e9c9491dea9c902920af4f.tar.gz nextcloud-server-c834200b486ff40b19e9c9491dea9c902920af4f.zip |
Refactoring getName function
Signed-off-by: hopleus <hopleus@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/FileInfo.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/private/Files/FileInfo.php b/lib/private/Files/FileInfo.php index 1471ba971f1..979ceacda66 100644 --- a/lib/private/Files/FileInfo.php +++ b/lib/private/Files/FileInfo.php @@ -178,11 +178,9 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { * @return string */ public function getName() { - if (isset($this->data['name']) && !empty($this->data['name'])) { - return $this->data['name']; - } - - return basename($this->getPath()); + return empty($this->data['name']) + ? basename($this->getPath()) + : $this->data['name']; } /** |