owncloud / ocis-php-sdk

Apache License 2.0
3 stars 1 forks source link

getDisplayName always returns a string #218

Closed phil-davis closed 2 months ago

phil-davis commented 2 months ago

https://github.com/owncloud/ocis-php-sdk/blob/main/src/ShareLink.php

    public function getDisplayName(): ?string
    {
        return (string)$this->getSharingLink()->getAtLibreGraphDisplayName();
    }

This method always returns a string, but is declared to return ?string

I noticed this when doing PR #217 to tidy up unit tests. When a test case sets the display name to null and then gets the display name, the empty string is returned.

Should we remove the ? from ?string ?

individual-it commented 2 months ago

Yes, I think this can be changed. No need for the displayName to be null