0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-03-12 23:47:25 +00:00

Refactoring getName function

Signed-off-by: hopleus <hopleus@gmail.com>
This commit is contained in:
hopleus 2024-03-12 17:23:59 +03:00 committed by backportbot[bot]
parent fe79686255
commit 3a88438bed

View file

@ -185,11 +185,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'];
}
/**