Code Duplication    Length = 7-10 lines in 2 locations

src/app/Balloon.App.Notification/AttributeDecorator.php 1 location

@@ 105-111 (lines=7) @@
102
            'id' => (string) $message['_id'],
103
            'message' => (string) $message['body'],
104
            'subject' => (string) $message['subject'],
105
            'sender' => function ($message) use ($server, $role_decorator) {
106
                try {
107
                    return $role_decorator->decorate($server->getUserById($message['sender']), ['_links', 'id', 'username']);
108
                } catch (\Exception $e) {
109
                    return null;
110
                }
111
            },
112
        ];
113
    }
114

src/lib/Filesystem/Node/AttributeDecorator.php 1 location

@@ 195-204 (lines=10) @@
192
                    return null;
193
                }
194
            },
195
            'owner' => function ($node) use ($server, $decorator) {
196
                try {
197
                    return $decorator->decorate(
198
                        $server->getUserById($node->getOwner()),
199
                        ['id', 'name', '_links']
200
                    );
201
                } catch (\Exception $e) {
202
                    return null;
203
                }
204
            },
205
        ];
206
    }
207