Code Duplication    Length = 12-12 lines in 2 locations

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.

src/Devices.php 1 location

@@ 73-84 (lines=12) @@
70
     *
71
     * @return array
72
     */
73
    public function getAll($limit = self::DEVICES_LIMIT, $offset = 0)
74
    {
75
        $query = [
76
            'limit' => max(1, min(self::DEVICES_LIMIT, filter_var($limit, FILTER_VALIDATE_INT))),
77
            'offset' => max(0, filter_var($offset, FILTER_VALIDATE_INT)),
78
            'app_id' => $this->api->getConfig()->getApplicationId(),
79
        ];
80
81
        return $this->api->request('GET', '/players?'.http_build_query($query), [
82
            'Authorization' => 'Basic '.$this->api->getConfig()->getApplicationAuthKey(),
83
        ]);
84
    }
85
86
    /**
87
     * Register a device for your application.