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

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