Code Duplication    Length = 11-11 lines in 2 locations

src/Devices.php 1 location

@@ 45-55 (lines=11) @@
42
     *
43
     * @return array
44
     */
45
    public function getAll($limit = self::DEVICES_LIMIT, $offset = 0)
46
    {
47
        return $this->api->request('GET', '/players?' . http_build_query([
48
            'limit' => max(0, min(self::DEVICES_LIMIT, filter_var($limit, FILTER_VALIDATE_INT))),
49
            'offset' => max(0, min(self::DEVICES_LIMIT, filter_var($offset, FILTER_VALIDATE_INT))),
50
        ]), [
51
            'Authorization' => 'Basic ' . $this->api->getConfig()->getApplicationAuthKey(),
52
        ], json_encode([
53
            'app_id' => $this->api->getConfig()->getApplicationId(),
54
        ]));
55
    }
56
57
    /**
58
     * Register a device for your application.

src/Notifications.php 1 location

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