@@ -39,121 +39,129 @@ public function getAllYears($sort = 'asc')
39
39
/**
40
40
* Return the range of years as supplied.
41
41
*
42
- * @param $minYear
43
- * @param $maxYear
42
+ * @param int $minYear
43
+ * @param int $maxYear
44
44
* @param string $sort
45
45
* @return mixed
46
46
*/
47
- public function getYearsRange ($ minYear , $ maxYear , $ sort = 'asc ' )
47
+ public function getYearsRange (int $ minYear , int $ maxYear , $ sort = 'asc ' )
48
48
{
49
49
return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/range/years/ ' .$ minYear .'/ ' .$ maxYear .'/ ' .$ sort ), true );
50
50
}
51
51
52
52
/**
53
53
* Return all makes available.
54
54
*
55
+ * @param string $sort
55
56
* @return mixed
56
57
*/
57
- public function getAllMakes ()
58
+ public function getAllMakes ($ sort = ' asc ' )
58
59
{
59
- return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/all/car/makes ' ), true );
60
+ return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/all/car/makes/ ' . $ sort ), true );
60
61
}
61
62
62
63
/**
63
64
* Return the makes available for the year supplied.
64
65
*
65
- * @param $year
66
+ * @param int $year
67
+ * @param string $sort
66
68
* @return mixed
67
69
*/
68
- public function getMakesByYear ($ year )
70
+ public function getMakesByYear (int $ year, $ sort = ' asc ' )
69
71
{
70
- return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/car/makes/ ' .$ year ), true );
72
+ return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/car/makes/ ' .$ year. ' / ' . $ sort ), true );
71
73
}
72
74
73
75
/**
74
76
* Return the range of years as supplied.
75
77
*
76
- * @param $minYear
77
- * @param $maxYear
78
+ * @param int $minYear
79
+ * @param int $maxYear
80
+ * @param string $sort
78
81
* @return mixed
79
82
*/
80
- public function getMakesByYearsRange ($ minYear , $ maxYear )
83
+ public function getMakesByYearsRange (int $ minYear , int $ maxYear, $ sort = ' asc ' )
81
84
{
82
- return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/car/makes/in-range/ ' .$ minYear .'/ ' .$ maxYear ), true );
85
+ return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/car/makes/in-range/ ' .$ minYear .'/ ' .$ maxYear. ' / ' . $ sort ), true );
83
86
}
84
87
85
88
/**
86
89
* Return the models available for the make supplied.
87
90
*
88
- * @param $make
91
+ * @param string $make
92
+ * @param string $sort
89
93
* @return mixed
90
94
*/
91
- public function getAllModelsByMake ($ make )
95
+ public function getAllModelsByMake (string $ make, $ sort = ' asc ' )
92
96
{
93
- return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/all/car/models/ ' .$ make ), true );
97
+ return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/all/car/models/ ' .$ make. ' / ' . $ sort ), true );
94
98
}
95
99
96
100
/**
97
101
* Return the models available for the year & make supplied.
98
102
*
99
- * @param $year
100
- * @param $make
103
+ * @param int $year
104
+ * @param string $make
105
+ * @param string $sort
101
106
* @return mixed
102
107
*/
103
- public function getModelsByYearAndMake ($ year , $ make )
108
+ public function getModelsByYearAndMake (int $ year , string $ make, $ sort = ' asc ' )
104
109
{
105
- return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/car/models/ ' .$ year .'/ ' .$ make ), true );
110
+ return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/car/models/ ' .$ year .'/ ' .$ make. ' / ' . $ sort ), true );
106
111
}
107
112
108
113
/**
109
114
* Return the trims available for the year, make & model supplied.
110
115
*
111
- * @param $year
112
- * @param $make
113
- * @param $model
116
+ * @param int $year
117
+ * @param string $make
118
+ * @param string $model
119
+ * @param string $sort
114
120
* @return mixed
115
121
*/
116
- public function getTrimsByYearMakeAndModel ($ year , $ make , $ model )
122
+ public function getTrimsByYearMakeAndModel (int $ year , string $ make , string $ model, $ sort = ' asc ' )
117
123
{
118
- return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/car/trims/ ' .$ year .'/ ' .$ make .'/ ' .$ model ), true );
124
+ return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/car/trims/ ' .$ year .'/ ' .$ make .'/ ' .$ model. ' / ' . $ sort ), true );
119
125
}
120
126
121
127
/**
122
128
* Return the transmissions available for the year, make,model & trim supplied.
123
129
*
124
- * @param $year
125
- * @param $make
126
- * @param $model
127
- * @param $trim
130
+ * @param int $year
131
+ * @param string $make
132
+ * @param string $model
133
+ * @param string $trim
134
+ * @param string $sort
128
135
* @return mixed
129
136
*/
130
- public function getTransmissionsByYearMakeModelAndTrim ($ year , $ make , $ model , $ trim )
137
+ public function getTransmissionsByYearMakeModelAndTrim (int $ year , string $ make , string $ model , string $ trim, $ sort = ' asc ' )
131
138
{
132
- return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/car/transmissions/ ' .$ year .'/ ' .$ make .'/ ' .$ model .'/ ' .$ trim ), true );
139
+ return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/car/transmissions/ ' .$ year .'/ ' .$ make .'/ ' .$ model .'/ ' .$ trim. ' / ' . $ sort ), true );
133
140
}
134
141
135
142
/**
136
143
* Return engines available for the year, make, model & transmission supplied.
137
144
*
138
- * @param $year
139
- * @param $make
140
- * @param $model
141
- * @param $trim
142
- * @param $transmission
145
+ * @param int $year
146
+ * @param string $make
147
+ * @param string $model
148
+ * @param string $trim
149
+ * @param string $transmission
150
+ * @param string $sort
143
151
* @return mixed
144
152
*/
145
- public function getEnginesByYearMakeModelTrimAndTransmission ($ year , $ make , $ model , $ trim , $ transmission )
153
+ public function getEnginesByYearMakeModelTrimAndTransmission (int $ year , string $ make , string $ model , string $ trim , string $ transmission, $ sort = ' asc ' )
146
154
{
147
- return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/car/engines/ ' .$ year .'/ ' .$ make .'/ ' .$ model .'/ ' .$ trim .'/ ' .$ transmission ), true );
155
+ return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-lists/get/car/engines/ ' .$ year .'/ ' .$ make .'/ ' .$ model .'/ ' .$ trim .'/ ' .$ transmission. ' / ' . $ sort ), true );
148
156
}
149
157
150
158
/**
151
159
* Return the logo for the make supplied.
152
160
*
153
- * @param $make
161
+ * @param string $make
154
162
* @return mixed
155
163
*/
156
- public function getMakeLogo ($ make )
164
+ public function getMakeLogo (string $ make )
157
165
{
158
166
return json_decode (Http::withToken ($ this ->vehApiToken )->get ('https://vehapi.com/api/ ' .$ this ->vehApiVersion .'/car-logos/img/ ' .$ make ), true );
159
167
}
0 commit comments