Promotions   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 32
ccs 2
cts 2
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPromotions() 0 4 1
request() 0 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