Code Duplication    Length = 12-12 lines in 2 locations

src/Devices.php 1 location

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

src/Notifications.php 1 location

@@ 61-72 (lines=12) @@
58
     *
59
     * @return array
60
     */
61
    public function getAll($limit = self::NOTIFICATIONS_LIMIT, $offset = 0)
62
    {
63
        $query = [
64
            'limit' => max(1, min(self::NOTIFICATIONS_LIMIT, filter_var($limit, FILTER_VALIDATE_INT))),
65
            'offset' => max(0, filter_var($offset, FILTER_VALIDATE_INT)),
66
            'app_id' => $this->api->getConfig()->getApplicationId(),
67
        ];
68
69
        return $this->api->request('GET', '/notifications?'.http_build_query($query), [
70
            'Authorization' => 'Basic '.$this->api->getConfig()->getApplicationAuthKey(),
71
        ]);
72
    }
73
74
    /**
75
     * Send new notification with provided data.