Promotions::request()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 1
ccs 0
cts 0
cp 0
nc 1
1
<?php namespace Stevenmaguire\Uber\Resources;
2
3
trait Promotions
4
{
5
    /**
6
     * Lists available promotions.
7
     *
8
     * The Promotions endpoint returns information about the promotion that
9
     * will be available to a new user based on their activity's location.
10
     * These promotions do not apply for existing users.
11
     *
12
     * @param    array    $attributes   Query attributes
13
     *
14
     * @return   stdClass               The JSON response from the request
15
     *
16
     * @see      https://developer.uber.com/docs/riders/ride-promotions/introduction
17
     */
18 2
    public function getPromotions($attributes = [])
19
    {
20 2
        return $this->request('get', 'promotions', $attributes);
21
    }
22
23
    /**
24
     * Makes a request to the Uber API and returns the response.
25
     *
26
     * @param    string $verb       The Http verb to use
27
     * @param    string $path       The path of the APi after the domain
28
     * @param    array  $parameters Parameters
29
     *
30
     * @return   stdClass The JSON response from the request
31
     * @throws   Exception
32
     */
33
    abstract protected function request($verb, $path, $parameters = []);
34
}
35