Code Duplication    Length = 5-5 lines in 2 locations

src/helpers.php 1 location

@@ 15-19 (lines=5) @@
12
     */
13
    function get_id($var, $key = 'id')
14
    {
15
        if (is_object($var)) {
16
            return $var->{$key};
17
        } elseif (is_array($var)) {
18
            return $var[$key];
19
        }
20
21
        return $var;
22
    }

src/Services/XgPush/XgPusher.php 1 location

@@ 243-247 (lines=5) @@
240
            return $user;
241
        }
242
243
        if (is_object($user)) {
244
            $user = $user->id;
245
        } elseif (is_array($user)) {
246
            $user = $user['id'];
247
        }
248
249
        return $this->accountPrefix.$user;
250
    }