make ACLFormatter::expand() nullable and return an empty array

- optimize tests
This commit is contained in:
Philipp Holzer 2019-11-01 15:43:16 +01:00
parent aa7be41728
commit f4ad82bcfb
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
2 changed files with 93 additions and 146 deletions

View file

@ -14,13 +14,13 @@ final class ACLFormatter
*
* @param string|null $ids A angle-bracketed list of IDs
*
* @return array|null The array based on the IDs (null in case there is no list)
* @return array The array based on the IDs (empty in case there is no list)
*/
public function expand(string $ids = null)
{
// In case there is no ID list, return null (=> no ACL set)
// In case there is no ID list, return empty array (=> no ACL set)
if (!isset($ids)) {
return null;
return [];
}
// turn string array of angle-bracketed elements into numeric array