Code Duplication    Length = 12-12 lines in 2 locations

src/Devices.php 1 location

@@ 59-70 (lines=12) @@
56
     *
57
     * @return array
58
     */
59
    public function getAll($limit = self::DEVICES_LIMIT, $offset = 0)
60
    {
61
        $query = [
62
            'limit' => max(1, min(self::DEVICES_LIMIT, filter_var($limit, FILTER_VALIDATE_INT))),
63
            'offset' => max(0, filter_var($offset, FILTER_VALIDATE_INT)),
64
            'app_id' => $this->api->getConfig()->getApplicationId(),
65
        ];
66
67
        return $this->api->request('GET', '/players?'.http_build_query($query), [
68
            'Authorization' => 'Basic '.$this->api->getConfig()->getApplicationAuthKey(),
69
        ]);
70
    }
71
72
    /**
73
     * Register a device for your application.

src/Notifications.php 1 location

@@ 49-60 (lines=12) @@
46
     *
47
     * @return array
48
     */
49
    public function getAll($limit = self::NOTIFICATIONS_LIMIT, $offset = 0)
50
    {
51
        $query = [
52
            'limit' => max(1, min(self::NOTIFICATIONS_LIMIT, filter_var($limit, FILTER_VALIDATE_INT))),
53
            'offset' => max(0, filter_var($offset, FILTER_VALIDATE_INT)),
54
            'app_id' => $this->api->getConfig()->getApplicationId(),
55
        ];
56
57
        return $this->api->request('GET', '/notifications?'.http_build_query($query), [
58
            'Authorization' => 'Basic '.$this->api->getConfig()->getApplicationAuthKey(),
59
        ]);
60
    }
61
62
    /**
63
     * Send new notification with provided data.