GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Failed
Push — master ( 77a95b...6c805f )
by Igor
08:36 queued 12s
created
src/Route4Me/Schedule/Schedule.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -12,47 +12,47 @@
 block discarded – undo
12 12
  */
13 13
 class Schedule extends Common
14 14
 {
15
-    /**
16
-     * Gets or sets a value indicating whether this is enabled.
17
-     * @var Boolean
18
-     */
19
-    public $enabled;
20
-
21
-    /**
22
-     * When schedule will be started from.
23
-     * @var string
24
-     */
25
-    public $from;
26
-
27
-    /**
28
-     * Schedule mode<br>
29
-     * Available values:<br>
30
-     * daily, weekly, monthly, annually
31
-     * @var string
32
-     */
33
-    public $mode;
34
-
35
-    /**
36
-     * If schedule mode is daily, specifies daily schedule data.
37
-     * @var ScheduleDaily
38
-     */
39
-    public $daily;
40
-
41
-    /**
42
-     * If schedule mode is weekly, specifies weekly schedule data.
43
-     * @var ScheduleWeekly
44
-     */
45
-    public $weekly;
46
-
47
-    /**
48
-     * If schedule mode is monthly, specifies monthly schedule data.
49
-     * @var ScheduleMonthly
50
-     */
51
-    public $monthly;
52
-
53
-    /**
54
-     * If schedule mode is annually, specifies annually schedule data.
55
-     * @var ScheduleAnnually
56
-     */
57
-    public $annually;
15
+	/**
16
+	 * Gets or sets a value indicating whether this is enabled.
17
+	 * @var Boolean
18
+	 */
19
+	public $enabled;
20
+
21
+	/**
22
+	 * When schedule will be started from.
23
+	 * @var string
24
+	 */
25
+	public $from;
26
+
27
+	/**
28
+	 * Schedule mode<br>
29
+	 * Available values:<br>
30
+	 * daily, weekly, monthly, annually
31
+	 * @var string
32
+	 */
33
+	public $mode;
34
+
35
+	/**
36
+	 * If schedule mode is daily, specifies daily schedule data.
37
+	 * @var ScheduleDaily
38
+	 */
39
+	public $daily;
40
+
41
+	/**
42
+	 * If schedule mode is weekly, specifies weekly schedule data.
43
+	 * @var ScheduleWeekly
44
+	 */
45
+	public $weekly;
46
+
47
+	/**
48
+	 * If schedule mode is monthly, specifies monthly schedule data.
49
+	 * @var ScheduleMonthly
50
+	 */
51
+	public $monthly;
52
+
53
+	/**
54
+	 * If schedule mode is annually, specifies annually schedule data.
55
+	 * @var ScheduleAnnually
56
+	 */
57
+	public $annually;
58 58
 }
59 59
\ No newline at end of file
Please login to merge, or discard this patch.
src/Route4Me/Schedule/ScheduleAnnually.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -12,27 +12,27 @@
 block discarded – undo
12 12
  */
13 13
 class ScheduleAnnually extends Common
14 14
 {
15
-    /**
16
-     * Repeat every year next 'Every' months.
17
-     * @var integer
18
-     */
19
-    public $every;
15
+	/**
16
+	 * Repeat every year next 'Every' months.
17
+	 * @var integer
18
+	 */
19
+	public $every;
20 20
 
21
-    /**
22
-     * If true, use NTH mode.
23
-     * @var Boolean
24
-     */
25
-    public $use_nth;
21
+	/**
22
+	 * If true, use NTH mode.
23
+	 * @var Boolean
24
+	 */
25
+	public $use_nth;
26 26
 
27
-    /**
28
-     * An array of the month numbers.
29
-     * @var integer[]
30
-     */
31
-    public $months;
27
+	/**
28
+	 * An array of the month numbers.
29
+	 * @var integer[]
30
+	 */
31
+	public $months;
32 32
 
33
-    /**
34
-     * Annualy schedule option if 'UseNth' is true.
35
-     * @var ScheduleMonthlyNth
36
-     */
37
-    public $nth;
33
+	/**
34
+	 * Annualy schedule option if 'UseNth' is true.
35
+	 * @var ScheduleMonthlyNth
36
+	 */
37
+	public $nth;
38 38
 }
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
src/Route4Me/Schedule/ScheduleWeekly.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -11,15 +11,15 @@
 block discarded – undo
11 11
  */
12 12
 class ScheduleWeekly extends Common
13 13
 {
14
-    /**
15
-     * Repeat every week next 'Every' days.
16
-     * @var integer
17
-     */
18
-    public $every;
14
+	/**
15
+	 * Repeat every week next 'Every' days.
16
+	 * @var integer
17
+	 */
18
+	public $every;
19 19
 
20
-    /**
21
-     * An array of the weekday numbers.
22
-     * @var integer[]
23
-     */
24
-    public $weekdays = [];
20
+	/**
21
+	 * An array of the weekday numbers.
22
+	 * @var integer[]
23
+	 */
24
+	public $weekdays = [];
25 25
 }
Please login to merge, or discard this patch.
src/Route4Me/Schedule/ScheduleMonthlyNth.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,17 +11,17 @@
 block discarded – undo
11 11
  */
12 12
 class ScheduleMonthlyNth
13 13
 {
14
-    /**
15
-     * Which day of the time period, 1: 1st, 2: 2nd, 3: 3rd, 4: 4th, 5: 5th, -1: Last
16
-     * @var integer
17
-     */
18
-    public $n;
14
+	/**
15
+	 * Which day of the time period, 1: 1st, 2: 2nd, 3: 3rd, 4: 4th, 5: 5th, -1: Last
16
+	 * @var integer
17
+	 */
18
+	public $n;
19 19
 
20
-    /**
21
-     * What time. Available values:<br>
22
-     * 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday,<br>
23
-     * 6: Saturday, 7: Sunday, 8: Day, 9: Working Day, 10: Weekend
24
-     * @var integer
25
-     */
26
-    public $what;
20
+	/**
21
+	 * What time. Available values:<br>
22
+	 * 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday,<br>
23
+	 * 6: Saturday, 7: Sunday, 8: Day, 9: Working Day, 10: Weekend
24
+	 * @var integer
25
+	 */
26
+	public $what;
27 27
 }
28 28
\ No newline at end of file
Please login to merge, or discard this patch.
src/Route4Me/Schedule/ScheduleDaily.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@
 block discarded – undo
11 11
  */
12 12
 class ScheduleDaily extends Common
13 13
 {
14
-    /**
15
-     * Repeat every next 'Every' days
16
-     * @var integer
17
-     */
18
-    public $every;
14
+	/**
15
+	 * Repeat every next 'Every' days
16
+	 * @var integer
17
+	 */
18
+	public $every;
19 19
 }
20 20
\ No newline at end of file
Please login to merge, or discard this patch.
src/Route4Me/DirectionStep.php 1 patch
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -11,76 +11,76 @@
 block discarded – undo
11 11
  */
12 12
 class DirectionStep extends Common
13 13
 {
14
-    /**
15
-     * Name (detailed)
16
-     * @var string
17
-     */
18
-    public $direction;
14
+	/**
15
+	 * Name (detailed)
16
+	 * @var string
17
+	 */
18
+	public $direction;
19 19
 
20
-    /**
21
-     * Name (brief)
22
-     * @var strng
23
-     */
24
-    public $directions;
20
+	/**
21
+	 * Name (brief)
22
+	 * @var strng
23
+	 */
24
+	public $directions;
25 25
 
26
-    /**
27
-     * Distance
28
-     * @var double
29
-     */
30
-    public $distance;
26
+	/**
27
+	 * Distance
28
+	 * @var double
29
+	 */
30
+	public $distance;
31 31
 
32
-    /**
33
-     * Distance unit
34
-     * @var string
35
-     */
36
-    public $distance_unit;
32
+	/**
33
+	 * Distance unit
34
+	 * @var string
35
+	 */
36
+	public $distance_unit;
37 37
 
38
-    /**
39
-     * Maneuver Type. Available values:
40
-     * - Head,Go Straight,Turn Left,Turn Right,Turn Slight Left,
41
-     * - Turn Slight Right,Turn Sharp Left,Turn Sharp Right,
42
-     * - Roundabout Left,Roundabout Right,Uturn Left,Uturn Right,
43
-     * - Ramp Left,Ramp Right,Fork Left,Fork Right,Keep Left,
44
-     * - Keep Right,Ferry,Ferry Train,Merge,Reached Your Destination.
45
-     * @var string
46
-     */
47
-    public $maneuverType;
38
+	/**
39
+	 * Maneuver Type. Available values:
40
+	 * - Head,Go Straight,Turn Left,Turn Right,Turn Slight Left,
41
+	 * - Turn Slight Right,Turn Sharp Left,Turn Sharp Right,
42
+	 * - Roundabout Left,Roundabout Right,Uturn Left,Uturn Right,
43
+	 * - Ramp Left,Ramp Right,Fork Left,Fork Right,Keep Left,
44
+	 * - Keep Right,Ferry,Ferry Train,Merge,Reached Your Destination.
45
+	 * @var string
46
+	 */
47
+	public $maneuverType;
48 48
 
49
-    /**
50
-     * Compass Direction. Available values:<br>
51
-     *  N, S, W, E, NW, NE, SW, SE
52
-     * @var string
53
-     */
54
-    public $compass_direction;
49
+	/**
50
+	 * Compass Direction. Available values:<br>
51
+	 *  N, S, W, E, NW, NE, SW, SE
52
+	 * @var string
53
+	 */
54
+	public $compass_direction;
55 55
 
56
-    /**
57
-     * UDU Distance (UDU: User Distance Unit).
58
-     * @var double
59
-     */
60
-    public $udu_distance;
56
+	/**
57
+	 * UDU Distance (UDU: User Distance Unit).
58
+	 * @var double
59
+	 */
60
+	public $udu_distance;
61 61
 
62
-    /**
63
-     * Direction step duration(seconds)
64
-     * @var integer
65
-     */
66
-    public $duration_sec;
62
+	/**
63
+	 * Direction step duration(seconds)
64
+	 * @var integer
65
+	 */
66
+	public $duration_sec;
67 67
 
68
-    /**
69
-     * Maneuver Point
70
-     * @var GeoPoint
71
-     */
72
-    public $maneuverPoint;
68
+	/**
69
+	 * Maneuver Point
70
+	 * @var GeoPoint
71
+	 */
72
+	public $maneuverPoint;
73 73
 
74
-    public static function fromArray(array $params)
75
-    {
76
-        $thisParams = new self();
74
+	public static function fromArray(array $params)
75
+	{
76
+		$thisParams = new self();
77 77
 
78
-        foreach ($params as $key => $value) {
79
-            if (property_exists($thisParams, $key)) {
80
-                $thisParams->{$key} = $value;
81
-            }
82
-        }
78
+		foreach ($params as $key => $value) {
79
+			if (property_exists($thisParams, $key)) {
80
+				$thisParams->{$key} = $value;
81
+			}
82
+		}
83 83
 
84
-        return $thisParams;
85
-    }
84
+		return $thisParams;
85
+	}
86 86
 }
87 87
\ No newline at end of file
Please login to merge, or discard this patch.
src/Route4Me/OrderCustomField.php 1 patch
Indentation   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -5,92 +5,92 @@
 block discarded – undo
5 5
 
6 6
 class OrderCustomField extends Common
7 7
 {
8
-    public $order_custom_field_id;
9
-    public $order_custom_field_name;
10
-    public $order_custom_field_label;
11
-    public $order_custom_field_type;
12
-    public $order_custom_field_value;
13
-    public $root_owner_member_id;
14
-    public $order_custom_field_type_info;
15
-
16
-    public function __construct()
17
-    {
18
-        Route4Me::setBaseUrl(Endpoint::BASE_URL);
19
-    }
20
-
21
-    public static function fromArray(array $params)
22
-    {
23
-        $orderCustomField = new self();
24
-        foreach ($params as $key => $value) {
25
-            if (property_exists($orderCustomField, $key)) {
26
-                $orderCustomField->{$key} = $value;
27
-            }
28
-        }
29
-
30
-        return $orderCustomField;
31
-    }
32
-
33
-    public static function addOrderCustomUserField($params)
34
-    {
35
-        $excludeFields = ['order_custom_field_id'];
36
-
37
-        $allBodyFields = Route4Me::getObjectProperties(new self(), $excludeFields);
38
-
39
-        $response = Route4Me::makeRequst([
40
-            'url'       => Endpoint::ORDER_CUSTOM_FIELDS_V4,
41
-            'method'    => 'POST',
42
-            'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
43
-        ]);
44
-
45
-        return $response;
46
-    }
47
-
48
-    public static function getOrderCustomUserFields($params)
49
-    {
50
-        $allQueryFields = [];
51
-
52
-        $response = Route4Me::makeRequst([
53
-            'url'       => Endpoint::ORDER_CUSTOM_FIELDS_V4,
54
-            'method'    => 'GET',
55
-            'query'     => Route4Me::generateRequestParameters($allQueryFields, $params),
56
-        ]);
57
-
58
-        return $response;
59
-    }
60
-
61
-    public static function updateOrderCustomUserField($params)
62
-    {
63
-        $excludeFields = ['order_custom_field_name'];
64
-
65
-        $allBodyFields = Route4Me::getObjectProperties(new self(), $excludeFields);
66
-
67
-        $response = Route4Me::makeRequst([
68
-            'url'       => Endpoint::ORDER_CUSTOM_FIELDS_V4,
69
-            'method'    => 'PUT',
70
-            'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
71
-        ]);
72
-
73
-        return $response;
74
-    }
75
-
76
-    public static function removeOrderCustomUserField($params)
77
-    {
78
-        $excludeFields = [
79
-            'order_custom_field_name',
80
-            'order_custom_field_type',
81
-            'order_custom_field_label',
82
-            'order_custom_field_type_info',
83
-            'root_owner_member_id'
84
-        ];
85
-
86
-        $allBodyFields = Route4Me::getObjectProperties(new self(), $excludeFields);
87
-
88
-        $response = Route4Me::makeRequst([
89
-            'url'       => Endpoint::ORDER_CUSTOM_FIELDS_V4,
90
-            'method'    => 'DELETE',
91
-            'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
92
-        ]);
93
-
94
-        return $response;
95
-    }
8
+	public $order_custom_field_id;
9
+	public $order_custom_field_name;
10
+	public $order_custom_field_label;
11
+	public $order_custom_field_type;
12
+	public $order_custom_field_value;
13
+	public $root_owner_member_id;
14
+	public $order_custom_field_type_info;
15
+
16
+	public function __construct()
17
+	{
18
+		Route4Me::setBaseUrl(Endpoint::BASE_URL);
19
+	}
20
+
21
+	public static function fromArray(array $params)
22
+	{
23
+		$orderCustomField = new self();
24
+		foreach ($params as $key => $value) {
25
+			if (property_exists($orderCustomField, $key)) {
26
+				$orderCustomField->{$key} = $value;
27
+			}
28
+		}
29
+
30
+		return $orderCustomField;
31
+	}
32
+
33
+	public static function addOrderCustomUserField($params)
34
+	{
35
+		$excludeFields = ['order_custom_field_id'];
36
+
37
+		$allBodyFields = Route4Me::getObjectProperties(new self(), $excludeFields);
38
+
39
+		$response = Route4Me::makeRequst([
40
+			'url'       => Endpoint::ORDER_CUSTOM_FIELDS_V4,
41
+			'method'    => 'POST',
42
+			'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
43
+		]);
44
+
45
+		return $response;
46
+	}
47
+
48
+	public static function getOrderCustomUserFields($params)
49
+	{
50
+		$allQueryFields = [];
51
+
52
+		$response = Route4Me::makeRequst([
53
+			'url'       => Endpoint::ORDER_CUSTOM_FIELDS_V4,
54
+			'method'    => 'GET',
55
+			'query'     => Route4Me::generateRequestParameters($allQueryFields, $params),
56
+		]);
57
+
58
+		return $response;
59
+	}
60
+
61
+	public static function updateOrderCustomUserField($params)
62
+	{
63
+		$excludeFields = ['order_custom_field_name'];
64
+
65
+		$allBodyFields = Route4Me::getObjectProperties(new self(), $excludeFields);
66
+
67
+		$response = Route4Me::makeRequst([
68
+			'url'       => Endpoint::ORDER_CUSTOM_FIELDS_V4,
69
+			'method'    => 'PUT',
70
+			'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
71
+		]);
72
+
73
+		return $response;
74
+	}
75
+
76
+	public static function removeOrderCustomUserField($params)
77
+	{
78
+		$excludeFields = [
79
+			'order_custom_field_name',
80
+			'order_custom_field_type',
81
+			'order_custom_field_label',
82
+			'order_custom_field_type_info',
83
+			'root_owner_member_id'
84
+		];
85
+
86
+		$allBodyFields = Route4Me::getObjectProperties(new self(), $excludeFields);
87
+
88
+		$response = Route4Me::makeRequst([
89
+			'url'       => Endpoint::ORDER_CUSTOM_FIELDS_V4,
90
+			'method'    => 'DELETE',
91
+			'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
92
+		]);
93
+
94
+		return $response;
95
+	}
96 96
 }
Please login to merge, or discard this patch.
src/Route4Me/SearchResponse.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -10,42 +10,42 @@
 block discarded – undo
10 10
  */
11 11
 class SearchResponse
12 12
 {
13
-    /**
14
-     * An array of the AddressBookContact type objects.
15
-     * @var AddressBookLocation[]
16
-     */
17
-    public $results=[];
18
-
19
-    /**
20
-     * Total number of the returned contacts
21
-     * @var integer
22
-     */
23
-    public $total;
24
-
25
-    /**
26
-     * An array of the field names to be shown
27
-     * @var string[]
28
-     */
29
-    public $fields=[];
30
-
31
-    /**
32
-     * The contacts query in the JSON format
33
-     * @var string
34
-     */
35
-    public $index_query;
36
-
37
-    public static function fromArray(array $params)
38
-    {
39
-        $searchResponse = new self();
40
-
41
-        foreach ($params as $key => $value) {
42
-            if (property_exists($searchResponse, $key)) {
43
-                $searchResponse->{$key} = $value;
44
-            } else {
45
-                throw new BadParam("Correct parameter must be provided. Wrong Parameter: $key");
46
-            }
47
-        }
48
-
49
-        return $searchResponse;
50
-    }
13
+	/**
14
+	 * An array of the AddressBookContact type objects.
15
+	 * @var AddressBookLocation[]
16
+	 */
17
+	public $results=[];
18
+
19
+	/**
20
+	 * Total number of the returned contacts
21
+	 * @var integer
22
+	 */
23
+	public $total;
24
+
25
+	/**
26
+	 * An array of the field names to be shown
27
+	 * @var string[]
28
+	 */
29
+	public $fields=[];
30
+
31
+	/**
32
+	 * The contacts query in the JSON format
33
+	 * @var string
34
+	 */
35
+	public $index_query;
36
+
37
+	public static function fromArray(array $params)
38
+	{
39
+		$searchResponse = new self();
40
+
41
+		foreach ($params as $key => $value) {
42
+			if (property_exists($searchResponse, $key)) {
43
+				$searchResponse->{$key} = $value;
44
+			} else {
45
+				throw new BadParam("Correct parameter must be provided. Wrong Parameter: $key");
46
+			}
47
+		}
48
+
49
+		return $searchResponse;
50
+	}
51 51
 }
Please login to merge, or discard this patch.
src/Route4Me/AddressBookGroup.php 1 patch
Indentation   +149 added lines, -149 removed lines patch added patch discarded remove patch
@@ -6,157 +6,157 @@
 block discarded – undo
6 6
 
7 7
 class AddressBookGroup extends Common
8 8
 {
9
-    public $group_id;
10
-    public $group_name;
11
-    public $group_color;
12
-    public $group_icon;
13
-    public $member_id;
14
-    public $filter;
15
-
16
-    public function __construct()
17
-    {
18
-        Route4Me::setBaseUrl(Endpoint::BASE_URL);
19
-    }
20
-
21
-    public static function fromArray(array $params)
22
-    {
23
-        $addressBookGroup = new self();
24
-
25
-        foreach ($params as $key => $value) {
26
-            if (property_exists($addressBookGroup, $key)) {
27
-                $addressBookGroup->{$key} = $value;
28
-            }
29
-        }
30
-
31
-        return $addressBookGroup;
32
-    }
33
-
34
-    public static function getAddressBookGroup(array $params)
35
-    {
36
-        $abGroup = Route4Me::makeRequst([
37
-            'url'       => Endpoint::ADDRESS_BOOK_GROUP,
38
-            'method'    => 'GET',
39
-            'query'     => [
40
-                'group_id' => isset($params['group_id']) ?  $params['group_id'] : null,
41
-            ],
42
-        ]);
43
-
44
-        return $abGroup;
45
-    }
46
-
47
-    public static function updateAddressBookGroup(array $params)
48
-    {
49
-        $allBodyFields = ['group_id', 'group_color', 'group_icon', 'filter'];
50
-
51
-        $abGroup = Route4Me::makeRequst([
52
-            'url'       => Endpoint::ADDRESS_BOOK_GROUP,
53
-            'method'    => 'PUT',
54
-            'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
55
-        ]);
56
-
57
-        return $abGroup;
58
-    }
59
-
60
-    public static function removeAddressBookGroup(array $params)
61
-    {
62
-        $allBodyFields = ['group_id'];
63
-
64
-        $abGroup = Route4Me::makeRequst([
65
-            'url'       => Endpoint::ADDRESS_BOOK_GROUP,
66
-            'method'    => 'DELETE',
67
-            'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
68
-        ]);
69
-
70
-        return $abGroup;
71
-    }
72
-
73
-    public static function createAddressBookGroup(array $params)
74
-    {
75
-        $allBodyFields = ['group_name', 'group_color', 'group_icon', 'filter'];
76
-
77
-        $abGroup = Route4Me::makeRequst([
78
-            'url'       => Endpoint::ADDRESS_BOOK_GROUP,
79
-            'method'    => 'POST',
80
-            'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
81
-        ]);
82
-
83
-        return $abGroup;
84
-    }
85
-
86
-    public static function  searchAddressBookGroups(array $params)
87
-    {
88
-        $allBodyFields = ['fields', 'offset', 'limit', 'filter'];
89
-
90
-        $abGroups = Route4Me::makeRequst([
91
-            'url'       => Endpoint::ADDRESS_BOOK_V4,
92
-            'method'    => 'POST',
93
-            'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
94
-        ]);
95
-
96
-        return $abGroups;
97
-    }
98
-
99
-    public static function getAddressBookContactsByGroup(array $params)
100
-    {
101
-        $allBodyFields = ['fields', 'group_id'];
102
-
103
-        $abGroups = Route4Me::makeRequst([
104
-            'url'       => Endpoint::ADDRESS_BOOK_SEARCH,
105
-            'method'    => 'POST',
106
-            'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
107
-        ]);
108
-
109
-        return $abGroups;
110
-    }
111
-
112
-    public static function getAddressBookGroups(array $params)
113
-    {
114
-        $abGroup = Route4Me::makeRequst([
115
-            'url'       => Endpoint::ADDRESS_BOOK_GROUP,
116
-            'method'    => 'GET',
117
-            'query'     => [
118
-                'offset'    => isset($params['offset']) ? $params['offset'] : null,
119
-                'limit'     => isset($params['limit']) ?  $params['limit'] : null,
120
-            ],
121
-        ]);
122
-
123
-        return $abGroup;
124
-    }
125
-
126
-    public static function getRandomAddressBookGroup(array $params)
127
-    {
128
-        $abGroups = self::getAddressBookGroups($params);
129
-
130
-        if (isset($abGroups) && sizeof($abGroups>1)) {
131
-            $groupsSize = sizeof($abGroups);
132
-
133
-                $randomGroupIndex = rand(0, $groupsSize - 1);
134
-
135
-                return $abGroups[$randomGroupIndex];
136
-        }
137
-
138
-        return null;
139
-    }
140
-
141
-    /*
9
+	public $group_id;
10
+	public $group_name;
11
+	public $group_color;
12
+	public $group_icon;
13
+	public $member_id;
14
+	public $filter;
15
+
16
+	public function __construct()
17
+	{
18
+		Route4Me::setBaseUrl(Endpoint::BASE_URL);
19
+	}
20
+
21
+	public static function fromArray(array $params)
22
+	{
23
+		$addressBookGroup = new self();
24
+
25
+		foreach ($params as $key => $value) {
26
+			if (property_exists($addressBookGroup, $key)) {
27
+				$addressBookGroup->{$key} = $value;
28
+			}
29
+		}
30
+
31
+		return $addressBookGroup;
32
+	}
33
+
34
+	public static function getAddressBookGroup(array $params)
35
+	{
36
+		$abGroup = Route4Me::makeRequst([
37
+			'url'       => Endpoint::ADDRESS_BOOK_GROUP,
38
+			'method'    => 'GET',
39
+			'query'     => [
40
+				'group_id' => isset($params['group_id']) ?  $params['group_id'] : null,
41
+			],
42
+		]);
43
+
44
+		return $abGroup;
45
+	}
46
+
47
+	public static function updateAddressBookGroup(array $params)
48
+	{
49
+		$allBodyFields = ['group_id', 'group_color', 'group_icon', 'filter'];
50
+
51
+		$abGroup = Route4Me::makeRequst([
52
+			'url'       => Endpoint::ADDRESS_BOOK_GROUP,
53
+			'method'    => 'PUT',
54
+			'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
55
+		]);
56
+
57
+		return $abGroup;
58
+	}
59
+
60
+	public static function removeAddressBookGroup(array $params)
61
+	{
62
+		$allBodyFields = ['group_id'];
63
+
64
+		$abGroup = Route4Me::makeRequst([
65
+			'url'       => Endpoint::ADDRESS_BOOK_GROUP,
66
+			'method'    => 'DELETE',
67
+			'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
68
+		]);
69
+
70
+		return $abGroup;
71
+	}
72
+
73
+	public static function createAddressBookGroup(array $params)
74
+	{
75
+		$allBodyFields = ['group_name', 'group_color', 'group_icon', 'filter'];
76
+
77
+		$abGroup = Route4Me::makeRequst([
78
+			'url'       => Endpoint::ADDRESS_BOOK_GROUP,
79
+			'method'    => 'POST',
80
+			'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
81
+		]);
82
+
83
+		return $abGroup;
84
+	}
85
+
86
+	public static function  searchAddressBookGroups(array $params)
87
+	{
88
+		$allBodyFields = ['fields', 'offset', 'limit', 'filter'];
89
+
90
+		$abGroups = Route4Me::makeRequst([
91
+			'url'       => Endpoint::ADDRESS_BOOK_V4,
92
+			'method'    => 'POST',
93
+			'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
94
+		]);
95
+
96
+		return $abGroups;
97
+	}
98
+
99
+	public static function getAddressBookContactsByGroup(array $params)
100
+	{
101
+		$allBodyFields = ['fields', 'group_id'];
102
+
103
+		$abGroups = Route4Me::makeRequst([
104
+			'url'       => Endpoint::ADDRESS_BOOK_SEARCH,
105
+			'method'    => 'POST',
106
+			'body'      => Route4Me::generateRequestParameters($allBodyFields, $params),
107
+		]);
108
+
109
+		return $abGroups;
110
+	}
111
+
112
+	public static function getAddressBookGroups(array $params)
113
+	{
114
+		$abGroup = Route4Me::makeRequst([
115
+			'url'       => Endpoint::ADDRESS_BOOK_GROUP,
116
+			'method'    => 'GET',
117
+			'query'     => [
118
+				'offset'    => isset($params['offset']) ? $params['offset'] : null,
119
+				'limit'     => isset($params['limit']) ?  $params['limit'] : null,
120
+			],
121
+		]);
122
+
123
+		return $abGroup;
124
+	}
125
+
126
+	public static function getRandomAddressBookGroup(array $params)
127
+	{
128
+		$abGroups = self::getAddressBookGroups($params);
129
+
130
+		if (isset($abGroups) && sizeof($abGroups>1)) {
131
+			$groupsSize = sizeof($abGroups);
132
+
133
+				$randomGroupIndex = rand(0, $groupsSize - 1);
134
+
135
+				return $abGroups[$randomGroupIndex];
136
+		}
137
+
138
+		return null;
139
+	}
140
+
141
+	/*
142 142
      * Gets an array of the address book contact groups with a specified name.
143 143
      * @param string $name
144 144
      *        Address book contact group name
145 145
      */
146
-    public static function getAddressBookGroupIdByName($name)
147
-    {
148
-        $abGroups = self::getAddressBookGroups(['offset'=>0,'limit'=>100]);
149
-
150
-        $abGroupId = [];
151
-
152
-        foreach ($abGroups as $abg) {
153
-            if (isset($abg['group_name'])) {
154
-                if ($abg['group_name']==$name) {
155
-                    $abGroupId[] = $abg['group_id'];
156
-                }
157
-            }
158
-        }
159
-
160
-        return $abGroupId;
161
-    }
146
+	public static function getAddressBookGroupIdByName($name)
147
+	{
148
+		$abGroups = self::getAddressBookGroups(['offset'=>0,'limit'=>100]);
149
+
150
+		$abGroupId = [];
151
+
152
+		foreach ($abGroups as $abg) {
153
+			if (isset($abg['group_name'])) {
154
+				if ($abg['group_name']==$name) {
155
+					$abGroupId[] = $abg['group_id'];
156
+				}
157
+			}
158
+		}
159
+
160
+		return $abGroupId;
161
+	}
162 162
 }
Please login to merge, or discard this patch.