@@ -103,8 +103,8 @@ discard block |
||
| 103 | 103 | $this->_params[ControlPayParameter::CONTROLPAY_KEY] = getenv('CONTROLPAY_KEY'); |
| 104 | 104 | $this->_params[ControlPayParameter::CONTROLPAY_OAUTH_TYPE] = KeyQueryStringAuthentication::class; |
| 105 | 105 | |
| 106 | - if(!is_null($params)) |
|
| 107 | - foreach ($params as $key => $param) |
|
| 106 | + if(!is_null($params)) { |
|
| 107 | + foreach ($params as $key => $param) |
|
| 108 | 108 | { |
| 109 | 109 | if(!in_array($key, [ |
| 110 | 110 | ControlPayParameter::CONTROLPAY_HOST, |
@@ -115,11 +115,13 @@ discard block |
||
| 115 | 115 | ControlPayParameter::CONTROLPAY_OAUTH_TYPE |
| 116 | 116 | ])) |
| 117 | 117 | throw new \Exception(sprintf("Parâmetro %s inválido", $key)); |
| 118 | + } |
|
| 118 | 119 | } |
| 119 | 120 | |
| 120 | - if(!is_null($params) && is_array($params)) |
|
| 121 | - foreach ($params as $key => $value) |
|
| 121 | + if(!is_null($params) && is_array($params)) { |
|
| 122 | + foreach ($params as $key => $value) |
|
| 122 | 123 | $this->_params[$key] = $value; |
| 124 | + } |
|
| 123 | 125 | |
| 124 | 126 | if(is_null($authentication)) |
| 125 | 127 | { |
@@ -84,8 +84,9 @@ discard block |
||
| 84 | 84 | { |
| 85 | 85 | $this->pessoa = $pessoa; |
| 86 | 86 | |
| 87 | - if(is_array($pessoa)) |
|
| 88 | - $this->pessoa = SerializerHelper::denormalize($this->pessoa, Pessoa::class); |
|
| 87 | + if(is_array($pessoa)) { |
|
| 88 | + $this->pessoa = SerializerHelper::denormalize($this->pessoa, Pessoa::class); |
|
| 89 | + } |
|
| 89 | 90 | |
| 90 | 91 | return $this; |
| 91 | 92 | } |
@@ -106,8 +107,9 @@ discard block |
||
| 106 | 107 | { |
| 107 | 108 | $this->operador = $operador; |
| 108 | 109 | |
| 109 | - if(is_array($this->operador)) |
|
| 110 | - $this->operador = SerializerHelper::denormalize($this->operador, Operador::class); |
|
| 110 | + if(is_array($this->operador)) { |
|
| 111 | + $this->operador = SerializerHelper::denormalize($this->operador, Operador::class); |
|
| 112 | + } |
|
| 111 | 113 | |
| 112 | 114 | return $this; |
| 113 | 115 | } |
@@ -128,8 +130,9 @@ discard block |
||
| 128 | 130 | { |
| 129 | 131 | $this->android = $android; |
| 130 | 132 | |
| 131 | - if(is_array($this->android)) |
|
| 132 | - $this->android = SerializerHelper::denormalize($this->android, Device::class); |
|
| 133 | + if(is_array($this->android)) { |
|
| 134 | + $this->android = SerializerHelper::denormalize($this->android, Device::class); |
|
| 135 | + } |
|
| 133 | 136 | |
| 134 | 137 | return $this; |
| 135 | 138 | } |
@@ -150,8 +153,9 @@ discard block |
||
| 150 | 153 | { |
| 151 | 154 | $this->ios = $ios; |
| 152 | 155 | |
| 153 | - if(is_array($this->ios)) |
|
| 154 | - $this->ios = SerializerHelper::denormalize($this->ios, Device::class); |
|
| 156 | + if(is_array($this->ios)) { |
|
| 157 | + $this->ios = SerializerHelper::denormalize($this->ios, Device::class); |
|
| 158 | + } |
|
| 155 | 159 | |
| 156 | 160 | return $this; |
| 157 | 161 | } |
@@ -68,8 +68,9 @@ discard block |
||
| 68 | 68 | { |
| 69 | 69 | $this->pessoa = $pessoa; |
| 70 | 70 | |
| 71 | - if(is_array($pessoa)) |
|
| 72 | - $this->pessoa = SerializerHelper::denormalize($this->pessoa, Pessoa::class); |
|
| 71 | + if(is_array($pessoa)) { |
|
| 72 | + $this->pessoa = SerializerHelper::denormalize($this->pessoa, Pessoa::class); |
|
| 73 | + } |
|
| 73 | 74 | |
| 74 | 75 | return $this; |
| 75 | 76 | } |
@@ -90,8 +91,9 @@ discard block |
||
| 90 | 91 | { |
| 91 | 92 | $this->operador = $operador; |
| 92 | 93 | |
| 93 | - if(is_array($this->operador)) |
|
| 94 | - $this->operador = SerializerHelper::denormalize($this->operador, Operador::class); |
|
| 94 | + if(is_array($this->operador)) { |
|
| 95 | + $this->operador = SerializerHelper::denormalize($this->operador, Operador::class); |
|
| 96 | + } |
|
| 95 | 97 | |
| 96 | 98 | return $this; |
| 97 | 99 | } |
@@ -62,8 +62,9 @@ |
||
| 62 | 62 | { |
| 63 | 63 | $this->intencaoVenda = $intencaoVenda; |
| 64 | 64 | |
| 65 | - if(is_array($this->intencaoVenda)) |
|
| 66 | - $this->intencaoVenda = SerializerHelper::denormalize($this->intencaoVenda, IntencaoVenda::class); |
|
| 65 | + if(is_array($this->intencaoVenda)) { |
|
| 66 | + $this->intencaoVenda = SerializerHelper::denormalize($this->intencaoVenda, IntencaoVenda::class); |
|
| 67 | + } |
|
| 67 | 68 | |
| 68 | 69 | return $this; |
| 69 | 70 | } |
@@ -44,8 +44,9 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | $this->data = \DateTime::createFromFormat('d/m/Y H:i:s.u', $data); |
| 46 | 46 | |
| 47 | - if(!$this->data) |
|
| 48 | - $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 47 | + if(!$this->data) { |
|
| 48 | + $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 49 | + } |
|
| 49 | 50 | |
| 50 | 51 | return $this; |
| 51 | 52 | } |
@@ -65,8 +66,9 @@ discard block |
||
| 65 | 66 | public function setPagamentosExterno($pagamentosExterno) |
| 66 | 67 | { |
| 67 | 68 | |
| 68 | - foreach ($pagamentosExterno as $item) |
|
| 69 | - $this->pagamentosExterno[] = SerializerHelper::denormalize($item, PagamentoExterno::class); |
|
| 69 | + foreach ($pagamentosExterno as $item) { |
|
| 70 | + $this->pagamentosExterno[] = SerializerHelper::denormalize($item, PagamentoExterno::class); |
|
| 71 | + } |
|
| 70 | 72 | |
| 71 | 73 | return $this; |
| 72 | 74 | } |
@@ -45,8 +45,9 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | $this->data = \DateTime::createFromFormat('d/m/Y H:i:s.u', $data); |
| 47 | 47 | |
| 48 | - if(!$this->data) |
|
| 49 | - $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 48 | + if(!$this->data) { |
|
| 49 | + $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 50 | + } |
|
| 50 | 51 | |
| 51 | 52 | return $this; |
| 52 | 53 | } |
@@ -65,8 +66,9 @@ discard block |
||
| 65 | 66 | */ |
| 66 | 67 | public function setTerminais($terminais) |
| 67 | 68 | { |
| 68 | - foreach ($terminais as $item) |
|
| 69 | - $this->terminais[] = SerializerHelper::denormalize($item, Terminal::class); |
|
| 69 | + foreach ($terminais as $item) { |
|
| 70 | + $this->terminais[] = SerializerHelper::denormalize($item, Terminal::class); |
|
| 71 | + } |
|
| 70 | 72 | |
| 71 | 73 | return $this; |
| 72 | 74 | } |
@@ -92,8 +92,9 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | $this->impressora = $impressora; |
| 94 | 94 | |
| 95 | - if(is_array($this->impressora)) |
|
| 96 | - $this->impressora = SerializerHelper::denormalize($this->impressora, Impressora::class); |
|
| 95 | + if(is_array($this->impressora)) { |
|
| 96 | + $this->impressora = SerializerHelper::denormalize($this->impressora, Impressora::class); |
|
| 97 | + } |
|
| 97 | 98 | |
| 98 | 99 | return $this; |
| 99 | 100 | } |
@@ -114,8 +115,9 @@ discard block |
||
| 114 | 115 | { |
| 115 | 116 | $this->pessoa = $pessoa; |
| 116 | 117 | |
| 117 | - if(is_array($this->pessoa)) |
|
| 118 | - $this->pessoa = SerializerHelper::denormalize($this->pessoa, Pessoa::class); |
|
| 118 | + if(is_array($this->pessoa)) { |
|
| 119 | + $this->pessoa = SerializerHelper::denormalize($this->pessoa, Pessoa::class); |
|
| 120 | + } |
|
| 119 | 121 | |
| 120 | 122 | return $this; |
| 121 | 123 | } |
@@ -44,8 +44,9 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | $this->data = \DateTime::createFromFormat('d/m/Y H:i:s.u', $data); |
| 46 | 46 | |
| 47 | - if(!$this->data) |
|
| 48 | - $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 47 | + if(!$this->data) { |
|
| 48 | + $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 49 | + } |
|
| 49 | 50 | |
| 50 | 51 | return $this; |
| 51 | 52 | } |
@@ -66,8 +67,9 @@ discard block |
||
| 66 | 67 | { |
| 67 | 68 | $this->terminal = $terminal; |
| 68 | 69 | |
| 69 | - if(is_array($this->terminal)) |
|
| 70 | - $this->terminal = SerializerHelper::denormalize($this->terminal, Terminal::class); |
|
| 70 | + if(is_array($this->terminal)) { |
|
| 71 | + $this->terminal = SerializerHelper::denormalize($this->terminal, Terminal::class); |
|
| 72 | + } |
|
| 71 | 73 | |
| 72 | 74 | return $this; |
| 73 | 75 | } |
@@ -44,8 +44,9 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | $this->data = \DateTime::createFromFormat('d/m/Y H:i:s.u', $data); |
| 46 | 46 | |
| 47 | - if(!$this->data) |
|
| 48 | - $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 47 | + if(!$this->data) { |
|
| 48 | + $this->data = \DateTime::createFromFormat('d/m/Y H:i:s', $data); |
|
| 49 | + } |
|
| 49 | 50 | |
| 50 | 51 | return $this; |
| 51 | 52 | } |
@@ -65,8 +66,9 @@ discard block |
||
| 65 | 66 | public function setProdutos($produtos) |
| 66 | 67 | { |
| 67 | 68 | |
| 68 | - foreach ($produtos as $item) |
|
| 69 | - $this->produtos[] = SerializerHelper::denormalize($item, Produto::class); |
|
| 69 | + foreach ($produtos as $item) { |
|
| 70 | + $this->produtos[] = SerializerHelper::denormalize($item, Produto::class); |
|
| 71 | + } |
|
| 70 | 72 | |
| 71 | 73 | return $this; |
| 72 | 74 | } |