• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

chico-rei / correios-php / 27582377165

15 Jun 2026 11:08PM UTC coverage: 4.589% (-0.04%) from 4.627%
27582377165

push

github

mathmarques
set min version to php 8.2

57 of 1242 relevant lines covered (4.59%)

0.05 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Response/GetPrePostagemPostadaResponse.php
1
<?php
2

3
namespace ChicoRei\Packages\Correios\Response;
4

5
use Carbon\Carbon;
6
use ChicoRei\Packages\Correios\CorreiosObject;
7
use ChicoRei\Packages\Correios\Model\ServicoAdicional;
8
use ChicoRei\Packages\Correios\Util;
9

10
class GetPrePostagemPostadaResponse extends CorreiosObject
11
{
12
    /**
13
     * ID.
14
     */
15
    public ?string $id = null;
16

17
    /**
18
     * Número externo Cliente.
19
     */
20
    public ?string $numeroExternoCliente = null;
21

22
    /**
23
     * Numero Cartão Postagem.
24
     */
25
    public ?string $numeroCartaoPostagem = null;
26

27
    /**
28
     * CEP Agencia.
29
     */
30
    public ?string $cepAgencia = null;
31

32
    /**
33
     * CEP Destino.
34
     */
35
    public ?string $cepDestino = null;
36

37
    /**
38
     * Número Atendimento.
39
     */
40
    public ?string $numeroAtendimento = null;
41

42
    /**
43
     * Data da Postagem.
44
     */
45
    public ?Carbon $dataPostagem = null;
46

47
    /**
48
     * Valor do Atendimento.
49
     */
50
    public ?float $valorAtendimento = null;
51

52
    /**
53
     * Número Sistema.
54
     */
55
    public ?string $numeroSistema = null;
56

57
    /**
58
     * CEP Remetente.
59
     */
60
    public ?string $cepRemetente = null;
61

62
    /**
63
     * CEP Destinatário.
64
     */
65
    public ?string $cepDestinatario = null;
66

67
    /**
68
     * Código identificador do objeto. Tamanho máximo: 13 caracteres.
69
     */
70
    public ?string $codigoObjeto = null;
71

72
    /**
73
     * Código identificador do objeto. Tamanho máximo: 13 caracteres.
74
     */
75
    public ?string $codigoServico = null;
76

77
    /**
78
     * Nome do Serviço.
79
     */
80
    public ?string $nomeServico = null;
81

82
    /**
83
     * Altura do Objeto.
84
     */
85
    public ?string $alturaObjeto = null;
86

87
    /**
88
     * Comprimento do Objeto.
89
     */
90
    public ?string $comprimentoObjeto = null;
91

92
    /**
93
     * Largura do Objeto.
94
     */
95
    public ?string $larguraObjeto = null;
96

97
    /**
98
     * Diametro do Objeto.
99
     */
100
    public ?string $diametroObjeto = null;
101

102
    /**
103
     * Peso do Objeto.
104
     */
105
    public ?string $pesoObjeto = null;
106

107
    /**
108
     * Peso Tarifado do Objeto.
109
     */
110
    public ?string $pesoTarifadoObjeto = null;
111

112
    /**
113
     * Valor Declarado do Objeto.
114
     */
115
    public ?string $valorDeclaradoObjeto = null;
116

117
    public function getId(): ?string
118
    {
119
        return $this->id;
×
120
    }
121

122
    public function setId(?string $id): GetPrePostagemPostadaResponse
123
    {
124
        $this->id = $id;
×
125
        return $this;
×
126
    }
127

128
    public function getNumeroExternoCliente(): ?string
129
    {
130
        return $this->numeroExternoCliente;
×
131
    }
132

133
    public function setNumeroExternoCliente(?string $numeroExternoCliente): GetPrePostagemPostadaResponse
134
    {
135
        $this->numeroExternoCliente = $numeroExternoCliente;
×
136
        return $this;
×
137
    }
138

139
    public function getNumeroCartaoPostagem(): ?string
140
    {
141
        return $this->numeroCartaoPostagem;
×
142
    }
143

144
    public function setNumeroCartaoPostagem(?string $numeroCartaoPostagem): GetPrePostagemPostadaResponse
145
    {
146
        $this->numeroCartaoPostagem = $numeroCartaoPostagem;
×
147
        return $this;
×
148
    }
149

150
    public function getCepAgencia(): ?string
151
    {
152
        return $this->cepAgencia;
×
153
    }
154

155
    public function setCepAgencia(?string $cepAgencia): GetPrePostagemPostadaResponse
156
    {
157
        $this->cepAgencia = $cepAgencia;
×
158
        return $this;
×
159
    }
160

161
    public function getCepDestino(): ?string
162
    {
163
        return $this->cepDestino;
×
164
    }
165

166
    public function setCepDestino(?string $cepDestino): GetPrePostagemPostadaResponse
167
    {
168
        $this->cepDestino = $cepDestino;
×
169
        return $this;
×
170
    }
171

172
    public function getNumeroAtendimento(): ?string
173
    {
174
        return $this->numeroAtendimento;
×
175
    }
176

177
    public function setNumeroAtendimento(?string $numeroAtendimento): GetPrePostagemPostadaResponse
178
    {
179
        $this->numeroAtendimento = $numeroAtendimento;
×
180
        return $this;
×
181
    }
182

183
    public function getDataPostagem(): ?Carbon
184
    {
185
        return $this->dataPostagem;
×
186
    }
187

188
    public function setDataPostagem($dataPostagem): GetPrePostagemPostadaResponse
189
    {
190
        $this->dataPostagem = Util::parseDate($dataPostagem);
×
191
        return $this;
×
192
    }
193

194
    public function getValorAtendimento(): ?float
195
    {
196
        return $this->valorAtendimento;
×
197
    }
198

199
    public function setValorAtendimento(?float $valorAtendimento): GetPrePostagemPostadaResponse
200
    {
201
        $this->valorAtendimento = $valorAtendimento;
×
202
        return $this;
×
203
    }
204

205
    public function getNumeroSistema(): ?string
206
    {
207
        return $this->numeroSistema;
×
208
    }
209

210
    public function setNumeroSistema(?string $numeroSistema): GetPrePostagemPostadaResponse
211
    {
212
        $this->numeroSistema = $numeroSistema;
×
213
        return $this;
×
214
    }
215

216
    public function getCepRemetente(): ?string
217
    {
218
        return $this->cepRemetente;
×
219
    }
220

221
    public function setCepRemetente(?string $cepRemetente): GetPrePostagemPostadaResponse
222
    {
223
        $this->cepRemetente = $cepRemetente;
×
224
        return $this;
×
225
    }
226

227
    public function getCepDestinatario(): ?string
228
    {
229
        return $this->cepDestinatario;
×
230
    }
231

232
    public function setCepDestinatario(?string $cepDestinatario): GetPrePostagemPostadaResponse
233
    {
234
        $this->cepDestinatario = $cepDestinatario;
×
235
        return $this;
×
236
    }
237

238
    public function getCodigoObjeto(): ?string
239
    {
240
        return $this->codigoObjeto;
×
241
    }
242

243
    public function setCodigoObjeto(?string $codigoObjeto): GetPrePostagemPostadaResponse
244
    {
245
        $this->codigoObjeto = $codigoObjeto;
×
246
        return $this;
×
247
    }
248

249
    public function getCodigoServico(): ?string
250
    {
251
        return $this->codigoServico;
×
252
    }
253

254
    public function setCodigoServico(?string $codigoServico): GetPrePostagemPostadaResponse
255
    {
256
        $this->codigoServico = $codigoServico;
×
257
        return $this;
×
258
    }
259

260
    public function getNomeServico(): ?string
261
    {
262
        return $this->nomeServico;
×
263
    }
264

265
    public function setNomeServico(?string $nomeServico): GetPrePostagemPostadaResponse
266
    {
267
        $this->nomeServico = $nomeServico;
×
268
        return $this;
×
269
    }
270

271
    public function getAlturaObjeto(): ?string
272
    {
273
        return $this->alturaObjeto;
×
274
    }
275

276
    public function setAlturaObjeto(?string $alturaObjeto): GetPrePostagemPostadaResponse
277
    {
278
        $this->alturaObjeto = $alturaObjeto;
×
279
        return $this;
×
280
    }
281

282
    public function getComprimentoObjeto(): ?string
283
    {
284
        return $this->comprimentoObjeto;
×
285
    }
286

287
    public function setComprimentoObjeto(?string $comprimentoObjeto): GetPrePostagemPostadaResponse
288
    {
289
        $this->comprimentoObjeto = $comprimentoObjeto;
×
290
        return $this;
×
291
    }
292

293
    public function getLarguraObjeto(): ?string
294
    {
295
        return $this->larguraObjeto;
×
296
    }
297

298
    public function setLarguraObjeto(?string $larguraObjeto): GetPrePostagemPostadaResponse
299
    {
300
        $this->larguraObjeto = $larguraObjeto;
×
301
        return $this;
×
302
    }
303

304
    public function getDiametroObjeto(): ?string
305
    {
306
        return $this->diametroObjeto;
×
307
    }
308

309
    public function setDiametroObjeto(?string $diametroObjeto): GetPrePostagemPostadaResponse
310
    {
311
        $this->diametroObjeto = $diametroObjeto;
×
312
        return $this;
×
313
    }
314

315
    public function getPesoObjeto(): ?string
316
    {
317
        return $this->pesoObjeto;
×
318
    }
319

320
    public function setPesoObjeto(?string $pesoObjeto): GetPrePostagemPostadaResponse
321
    {
322
        $this->pesoObjeto = $pesoObjeto;
×
323
        return $this;
×
324
    }
325

326
    public function getPesoTarifadoObjeto(): ?string
327
    {
328
        return $this->pesoTarifadoObjeto;
×
329
    }
330

331
    public function setPesoTarifadoObjeto(?string $pesoTarifadoObjeto): GetPrePostagemPostadaResponse
332
    {
333
        $this->pesoTarifadoObjeto = $pesoTarifadoObjeto;
×
334
        return $this;
×
335
    }
336

337
    public function getValorDeclaradoObjeto(): ?string
338
    {
339
        return $this->valorDeclaradoObjeto;
×
340
    }
341

342
    public function setValorDeclaradoObjeto(?string $valorDeclaradoObjeto): GetPrePostagemPostadaResponse
343
    {
344
        $this->valorDeclaradoObjeto = $valorDeclaradoObjeto;
×
345
        return $this;
×
346
    }
347

348
    /**
349
     * Serviços Adicionais.
350
     *
351
     * @var ServicoAdicional[]|null
352
     */
353
    public ?array $listaServicoAdicional = null;
354

355
    public function getListaServicoAdicional(): ?array
356
    {
357
        return $this->listaServicoAdicional;
×
358
    }
359

360
    /**
361
     * @param ServicoAdicional[]|array|null $listaServicoAdicional
362
     * @return $this
363
     */
364
    public function setListaServicoAdicional(?array $listaServicoAdicional): GetPrePostagemPostadaResponse
365
    {
366
        if (is_array($listaServicoAdicional)) {
×
367
            $this->listaServicoAdicional = [];
×
368

369
            foreach ($listaServicoAdicional as $servicoAdicional) {
×
370
                $this->addServicoAdicional($servicoAdicional);
×
371
            }
372
        } else {
373
            $this->listaServicoAdicional = null;
×
374
        }
375

376
        return $this;
×
377
    }
378

379
    /**
380
     * @param ServicoAdicional|array $servicoAdicional
381
     */
382
    public function addServicoAdicional($servicoAdicional): GetPrePostagemPostadaResponse
383
    {
384
        if (! is_array($servicoAdicional) && ! $servicoAdicional instanceof ServicoAdicional) {
×
385
            throw new \InvalidArgumentException('The argument must be an instance of ServicoAdicional or an array');
×
386
        }
387

388
        if (!isset($this->listaServicoAdicional)) {
×
389
            $this->listaServicoAdicional = [];
×
390
        }
391

392
        $this->listaServicoAdicional[] = ServicoAdicional::create($servicoAdicional);
×
393

394
        return $this;
×
395
    }
396

397
    public function toArray(): array
398
    {
399
        return [
×
400
            'id' => $this->getId(),
×
401
            'numeroExternoCliente' => $this->getNumeroExternoCliente(),
×
402
            'numeroCartaoPostagem' => $this->getNumeroCartaoPostagem(),
×
403
            'cepAgencia' => $this->getCepAgencia(),
×
404
            'cepDestino' => $this->getCepDestino(),
×
405
            'numeroAtendimento' => $this->getNumeroAtendimento(),
×
406
            'dataPostagem' => $this->getDataPostagem() ? $this->getDataPostagem()->toIso8601String() : null,
×
407
            'valorAtendimento' => $this->getValorAtendimento(),
×
408
            'numeroSistema' => $this->getNumeroSistema(),
×
409
            'cepRemetente' => $this->getCepRemetente(),
×
410
            'cepDestinatario' => $this->getCepDestinatario(),
×
411
            'codigoObjeto' => $this->getCodigoObjeto(),
×
412
            'codigoServico' => $this->getCodigoServico(),
×
413
            'nomeServico' => $this->getNomeServico(),
×
414
            'alturaObjeto' => $this->getAlturaObjeto(),
×
415
            'comprimentoObjeto' => $this->getComprimentoObjeto(),
×
416
            'larguraObjeto' => $this->getLarguraObjeto(),
×
417
            'diametroObjeto' => $this->getDiametroObjeto(),
×
418
            'pesoObjeto' => $this->getPesoObjeto(),
×
419
            'pesoTarifadoObjeto' => $this->getPesoTarifadoObjeto(),
×
420
            'valorDeclaradoObjeto' => $this->getValorDeclaradoObjeto(),
×
421
            'listaServicoAdicional' => $this->getListaServicoAdicional()
×
422
                ? array_map(function (ServicoAdicional $servicoAdicional) {
×
423
                    return $servicoAdicional->toArray();
×
424
                }, $this->getListaServicoAdicional())
×
425
                : null,
×
426
        ];
×
427
    }
428
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc