Completed
Push — master ( 77711d...720aae )
by Adriano
03:53
created
src/FipeApi/ApiAbstract.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -38,16 +38,16 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function __construct($tipo, Client $client = null)
40 40
     {
41
-        if(is_null($this->logger))
41
+        if (is_null($this->logger))
42 42
             $this->logger = \Logger::getLogger(__CLASS__);
43 43
 
44 44
         $this->_curl = new Curl();
45 45
         $this->tipo = $tipo;
46 46
 
47
-        if(is_null($client))
47
+        if (is_null($client))
48 48
         {
49 49
             $this->client = new Client();
50
-        }else{
50
+        }else {
51 51
             $this->client = $client;
52 52
         }
53 53
 
@@ -59,13 +59,13 @@  discard block
 block discarded – undo
59 59
      */
60 60
     public function getMarcas()
61 61
     {
62
-        try{
62
+        try {
63 63
             $this->_curl->get(sprintf("%s/%s/marcas.json",
64 64
                 $this->client->getParameter(FipeApiParameter::FIPE_API_HOST),
65 65
                 $this->tipo)
66 66
             );
67 67
             return $this->getResponse();
68
-        }catch(\Exception $ex){
68
+        }catch (\Exception $ex) {
69 69
             $this->logger->error("Falha ao executar requisição", $ex);
70 70
             throw new \Exception($ex->getMessage());
71 71
         }
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public function getVeiculos($fabricante)
81 81
     {
82
-        try{
82
+        try {
83 83
             $this->_curl->get(sprintf("%s/%s/veiculos/%s.json",
84 84
                     $this->client->getParameter(FipeApiParameter::FIPE_API_HOST),
85 85
                     $this->tipo,
86 86
                     $fabricante)
87 87
             );
88 88
             return $this->getResponse();
89
-        }catch(\Exception $ex){
89
+        }catch (\Exception $ex) {
90 90
             $this->logger->error("Falha ao executar requisição", $ex);
91 91
             throw new \Exception($ex->getMessage());
92 92
         }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     public function getModelos($fabricante, $veiculo)
103 103
     {
104
-        try{
104
+        try {
105 105
             $this->_curl->get(sprintf("%s/%s/veiculo/%s/%s.json",
106 106
                     $this->client->getParameter(FipeApiParameter::FIPE_API_HOST),
107 107
                     $this->tipo,
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
                     $veiculo)
110 110
             );
111 111
             return $this->getResponse();
112
-        }catch(\Exception $ex){
112
+        }catch (\Exception $ex) {
113 113
             $this->logger->error("Falha ao executar requisição", $ex);
114 114
             throw new \Exception($ex->getMessage());
115 115
         }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
     public function getDetalhes($fabricante, $veiculo, $fipeCodigo)
119 119
     {
120
-        try{
120
+        try {
121 121
             $this->_curl->get(sprintf("%s/%s/veiculo/%s/%s/%s.json",
122 122
                     $this->client->getParameter(FipeApiParameter::FIPE_API_HOST),
123 123
                     $this->tipo,
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
                     $fipeCodigo)
127 127
             );
128 128
             return $this->getResponse();
129
-        }catch(\Exception $ex){
129
+        }catch (\Exception $ex) {
130 130
             $this->logger->error("Falha ao executar requisição", $ex);
131 131
             throw new \Exception($ex->getMessage());
132 132
         }
Please login to merge, or discard this patch.
Braces   +8 added lines, -7 removed lines patch added patch discarded remove patch
@@ -38,8 +38,9 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function __construct($tipo, Client $client = null)
40 40
     {
41
-        if(is_null($this->logger))
42
-            $this->logger = \Logger::getLogger(__CLASS__);
41
+        if(is_null($this->logger)) {
42
+                    $this->logger = \Logger::getLogger(__CLASS__);
43
+        }
43 44
 
44 45
         $this->_curl = new Curl();
45 46
         $this->tipo = $tipo;
@@ -47,7 +48,7 @@  discard block
 block discarded – undo
47 48
         if(is_null($client))
48 49
         {
49 50
             $this->client = new Client();
50
-        }else{
51
+        } else{
51 52
             $this->client = $client;
52 53
         }
53 54
 
@@ -65,7 +66,7 @@  discard block
 block discarded – undo
65 66
                 $this->tipo)
66 67
             );
67 68
             return $this->getResponse();
68
-        }catch(\Exception $ex){
69
+        } catch(\Exception $ex){
69 70
             $this->logger->error("Falha ao executar requisição", $ex);
70 71
             throw new \Exception($ex->getMessage());
71 72
         }
@@ -86,7 +87,7 @@  discard block
 block discarded – undo
86 87
                     $fabricante)
87 88
             );
88 89
             return $this->getResponse();
89
-        }catch(\Exception $ex){
90
+        } catch(\Exception $ex){
90 91
             $this->logger->error("Falha ao executar requisição", $ex);
91 92
             throw new \Exception($ex->getMessage());
92 93
         }
@@ -109,7 +110,7 @@  discard block
 block discarded – undo
109 110
                     $veiculo)
110 111
             );
111 112
             return $this->getResponse();
112
-        }catch(\Exception $ex){
113
+        } catch(\Exception $ex){
113 114
             $this->logger->error("Falha ao executar requisição", $ex);
114 115
             throw new \Exception($ex->getMessage());
115 116
         }
@@ -126,7 +127,7 @@  discard block
 block discarded – undo
126 127
                     $fipeCodigo)
127 128
             );
128 129
             return $this->getResponse();
129
-        }catch(\Exception $ex){
130
+        } catch(\Exception $ex){
130 131
             $this->logger->error("Falha ao executar requisição", $ex);
131 132
             throw new \Exception($ex->getMessage());
132 133
         }
Please login to merge, or discard this patch.