Passed
Push — master ( c8a802...344029 )
by Nicholas
02:17
created

Vehicle::getVehicleYear()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Nickcheek\Atdconnect\Services;
4
5
class Vehicle {
6
	use \Nickcheek\Atdconnect\Traits\ApiTrait;
7
	
8
	private $location;
9
	private $wsdl;
10
	
11
	private $vehicle = array();
0 ignored issues
show
introduced by
The private property $vehicle is not used, and could be removed.
Loading history...
12
	
13
	public $vehicleYear;
14
	public $vehicleMake;
15
	public $vehicleModel;
16
17
	public function __construct()
18
	{
19
	    $config = include(realpath(dirname(__FILE__) . '/../config/config.php'));
20
	    $this->location = $config->location;
21
		$this->wsdl = 'http://testws.atdconnect.com/ws/3_4/fitments.wsdl';
22
		
23
	}
24
	
25
	//************************************************
26
    //               Vehicle Service
27
    //************************************************
28
    
29
    public  function getVehicleYear()
30
    {
31
        return $this->apiCall('getVehicleYear','',$this->wsdl);
32
    }
33
    
34
    public  function getVehicleMake($year)
35
    {	
36
    	try { if (empty($year)) { throw new \Exception("A Vehicle Year Has Not Been Set."); } 
37
    		return $this->apiCall('getVehicleMake',['vehicle' => ['year'=>$year]],$this->wsdl);
38
        } catch (Exception $e) { return $e; }
0 ignored issues
show
Bug introduced by
The type Nickcheek\Atdconnect\Services\Exception was not found. Did you mean Exception? If so, make sure to prefix the type with \.
Loading history...
39
    }
40
41
    public  function getVehicleModel($year,$make)
42
    {	
43
    	
44
    	try {if (empty($year)||empty($make)) {throw new \Exception("A Vehicle Year OR Make Has Not Been Set.");}
45
    	
46
        	return $this->apiCall('getVehicleModel',['vehicle' => ['year'=>$year,'make'=>$make]],$this->wsdl);
47
        
48
        } catch (Exception $e) {return $e;}
49
    }
50
51
    
52
    public  function getVehicleTrim($year,$make,$model)
53
    {
54
    	try {if (empty($year)||empty($make)||empty($model)) {throw new \Exception("A Vehicle Year, Make OR Model Has Not Been Set.");}
55
    	
56
        	return $this->apiCall('getVehicleTrim',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model]],$this->wsdl);
57
        
58
        } catch (Exception $e) {return $e;}
59
    }
60
    
61
    public function getVehicleTrimOption($year,$make,$model,$trim)
62
    {
63
    	try {if (empty($year)||empty($make)||empty($model)||empty($trim)) {throw new \Exception("A Vehicle Year, Make OR Model Has Not Been Set.");}
64
    	
65
	    	return $this->apiCall('getVehicleTrimOption',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim]],$this->wsdl);
66
	    	
67
	    } catch (Exception $e) {return $e;}
68
	    
69
    }
70
    
71
    public function getVehiclePlusSizes($year,$make,$model,$trim)
72
    {
73
    	try {if (empty($year)||empty($make)||empty($model)||empty($trim)) {throw new \Exception("A Vehicle Year, Make, Model, or Trim Has Not Been Set.");}
74
    	
75
	    	return $this->apiCall('getVehiclePlusSizes',['vehicle' => ['year'=>$year,'make'=>$make,'model'=>$model,'trim'=>$trim]],$this->wsdl);
76
	    	
77
	    } catch (Exception $e) {return $e;}
78
	    
79
    }
80
    
81
    
82
        
83
84
}