Code Duplication    Length = 12-12 lines in 2 locations

src/Notifications.php 1 location

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

src/Devices.php 1 location

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