Signed-off-by: dartcafe <github@dartcafe.de>
This commit is contained in:
Родитель
71d6ed9a19
Коммит
e1987ac3be
|
@ -69,7 +69,7 @@ class Share extends Entity implements JsonSerializable {
|
|||
public const TYPE_CIRCLE = 'circle';
|
||||
public const TYPE_CONTACTGROUP = 'contactGroup';
|
||||
|
||||
public const TYPE_SORT_ARRAY = array(
|
||||
public const TYPE_SORT_ARRAY = [
|
||||
self::TYPE_PUBLIC,
|
||||
self::TYPE_ADMIN,
|
||||
self::TYPE_GROUP,
|
||||
|
@ -79,7 +79,7 @@ class Share extends Entity implements JsonSerializable {
|
|||
self::TYPE_EXTERNAL,
|
||||
self::TYPE_CIRCLE,
|
||||
self::TYPE_CONTACTGROUP,
|
||||
);
|
||||
];
|
||||
|
||||
/** @var string $token */
|
||||
protected $token = '';
|
||||
|
|
|
@ -134,7 +134,7 @@ class ShareService {
|
|||
private function sortByCategory() : void {
|
||||
$sortedShares = [];
|
||||
foreach (Share::TYPE_SORT_ARRAY as $shareType) {
|
||||
$filteredShares = array_filter($this->shares, function($share) use ($shareType) {
|
||||
$filteredShares = array_filter($this->shares, function ($share) use ($shareType) {
|
||||
return $share->getType() === $shareType;
|
||||
});
|
||||
$sortedShares = array_merge($sortedShares, $filteredShares);
|
||||
|
|
Загрузка…
Ссылка в новой задаче