Code Duplication    Length = 12-15 lines in 4 locations

src/FipeApi/AbstractApi.php 4 locations

@@ 54-65 (lines=12) @@
51
     * @return array
52
     * @throws \Exception
53
     */
54
    public function getMarcas()
55
    {
56
        try{
57
            $this->_curl->get(sprintf("%s/%s/marcas.json",
58
                $this->client->getParameter(FipeApiParameter::FIPE_API_HOST),
59
                $this->tipo)
60
            );
61
            return $this->getResponse();
62
        }catch(\Exception $ex){
63
            throw new \Exception($ex->getMessage());
64
        }
65
    }
66
67
    /**
68
     * @param integer $fabricante
@@ 73-85 (lines=13) @@
70
     * @return array
71
     * @throws \Exception
72
     */
73
    public function getVeiculos($fabricante)
74
    {
75
        try{
76
            $this->_curl->get(sprintf("%s/%s/veiculos/%s.json",
77
                    $this->client->getParameter(FipeApiParameter::FIPE_API_HOST),
78
                    $this->tipo,
79
                    $fabricante)
80
            );
81
            return $this->getResponse();
82
        }catch(\Exception $ex){
83
            throw new \Exception($ex->getMessage());
84
        }
85
    }
86
87
    /**
88
     * @param integer $fabricante
@@ 94-107 (lines=14) @@
91
     * @return array
92
     * @throws \Exception
93
     */
94
    public function getModelos($fabricante, $veiculo)
95
    {
96
        try{
97
            $this->_curl->get(sprintf("%s/%s/veiculo/%s/%s.json",
98
                    $this->client->getParameter(FipeApiParameter::FIPE_API_HOST),
99
                    $this->tipo,
100
                    $fabricante,
101
                    $veiculo)
102
            );
103
            return $this->getResponse();
104
        }catch(\Exception $ex){
105
            throw new \Exception($ex->getMessage());
106
        }
107
    }
108
109
    public function getDetalhes($fabricante, $veiculo, $fipeCodigo)
110
    {
@@ 109-123 (lines=15) @@
106
        }
107
    }
108
109
    public function getDetalhes($fabricante, $veiculo, $fipeCodigo)
110
    {
111
        try{
112
            $this->_curl->get(sprintf("%s/%s/veiculo/%s/%s/%s.json",
113
                    $this->client->getParameter(FipeApiParameter::FIPE_API_HOST),
114
                    $this->tipo,
115
                    $fabricante,
116
                    $veiculo,
117
                    $fipeCodigo)
118
            );
119
            return $this->getResponse();
120
        }catch(\Exception $ex){
121
            throw new \Exception($ex->getMessage());
122
        }
123
    }
124
125
    /**
126
     * @return array