Skip to content

Commit 1af1ae0

Browse files
authored
Update Config.php
retirada da duṕlicação do WSDL de Logistica Reversa
1 parent f688f91 commit 1af1ae0

File tree

1 file changed

+32
-54
lines changed

1 file changed

+32
-54
lines changed

src/PhpSigep/Config.php

Lines changed: 32 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/**
1212
* @author: Stavarengo
1313
* @author: davidalves1
14-
* @author: RodrigoJob (eConector)
14+
* @author: rodrigojob (eConector)
1515
*/
1616
class Config extends DefaultStdClass
1717
{
@@ -33,7 +33,7 @@ class Config extends DefaultStdClass
3333
* WSDL_CACHE_BOTH = memória e disco
3434
* WSDL_CACHE_NONE = nenhum
3535
*/
36-
const WSDL_CACHE = WSDL_CACHE_BOTH;
36+
const WSDL_CACHE = WSDL_CACHE_MEMORY;
3737

3838
/**
3939
* Indica que estamos no ambiente de desenvolvimento.
@@ -51,8 +51,6 @@ class Config extends DefaultStdClass
5151
const WSDL_PI_PRODUCTION = 'https://cws.correios.com.br/pedidoInformacaoWS/pedidoInformacaoService/pedidoInformacaoWS?wsdl';
5252
const WSDL_PI_DEVELOPMENT = 'https://apphom.correios.com.br/pedidoInformacaoWS/pedidoInformacaoService/pedidoInformacaoWS?wsdl';
5353

54-
// const WSDL_REVERSA_PRODUCTION = 'http://webservicescol.correios.com.br/ScolWeb/WebServiceScol?wsdl';
55-
// const WSDL_REVERSA_DEVELOPMENT = 'http://webservicescolhomologacao.correios.com.br/ScolWeb/WebServiceScol?wsdl';
5654

5755
/**
5856
* Endereço para o WSDL AtendeCliente.
@@ -79,12 +77,7 @@ class Config extends DefaultStdClass
7977
/**
8078
* @var string
8179
*/
82-
protected $wsdlLogisticaReversa = self::WSDL_LOGISTICA_REVERSA_DEVELOPMENT;
83-
84-
/**
85-
* @var string
86-
*/
87-
protected $wsdlPI = self::WSDL_PI_DEVELOPMENT;
80+
protected $wsdlLogisticaReversa = self::WSDL_REVERSA_DEVELOPMENT;
8881

8982
/**
9083
* @var int
@@ -94,7 +87,7 @@ class Config extends DefaultStdClass
9487
/**
9588
* @var string
9689
*/
97-
protected $xml_encode = self::XML_ENCODE_ISO;
90+
protected $xml_encode = self::XML_ENCODE_UTF;
9891

9992
/**
10093
* @var bool
@@ -173,15 +166,6 @@ public function getWsdlCache()
173166
return (int) $this->wsdlCache;
174167
}
175168

176-
/**
177-
* @return int
178-
*/
179-
public function setWsdlCache($wsdlCache)
180-
{
181-
$this->wsdlCache = $wsdlCache;
182-
return $this;
183-
}
184-
185169
/**
186170
* @return int
187171
*/
@@ -239,8 +223,10 @@ public function setEnv($env, $updateWsdlUrl = true)
239223
if ($updateWsdlUrl) {
240224
if ($env == self::ENV_DEVELOPMENT) {
241225
$this->setWsdlAtendeCliente(self::WSDL_ATENDE_CLIENTE_DEVELOPMENT);
226+
$this->setWsdlLogisticaReversa(self::WSDL_REVERSA_DEVELOPMENT);
242227
} else {
243228
$this->setWsdlAtendeCliente(self::WSDL_ATENDE_CLIENTE_PRODUCTION);
229+
$this->setWsdlLogisticaReversa(self::WSDL_REVERSA_PRODUCTION);
244230
}
245231
}
246232

@@ -289,6 +275,25 @@ public function getWsdlReversa()
289275
break;
290276
}
291277
}
278+
279+
/**
280+
* @return string
281+
*/
282+
public function getWsdlLogisticaReversa()
283+
{
284+
return $this->wsdlLogisticaReversa;
285+
}
286+
287+
/**
288+
* @param string $wsdlLogisticaReversa
289+
* @return $this
290+
*/
291+
public function setWsdlLogisticaReversa($wsdlLogisticaReversa)
292+
{
293+
$this->wsdlLogisticaReversa = $wsdlLogisticaReversa;
294+
295+
return $this;
296+
}
292297

293298
/**
294299
* @param string $wsdlAtendeCliente
@@ -359,42 +364,15 @@ public function getWsdlAgenciaWS()
359364
return $this->wsdlAgenciaWS;
360365
}
361366

362-
/**
363-
* @param $wsdlPI
364-
* @return $this;
365-
*/
366-
public function setWsdlPI($wsdlPI)
367-
{
368-
$this->wsdlPI = $wsdlPI;
369-
370-
return $this;
371-
}
372-
373-
/**
374-
* @return string
375-
*/
376367
public function getWsdlPI()
377368
{
378-
return $this->wsdlPI;
379-
}
380-
381-
/**
382-
* @return string
383-
*/
384-
public function getWsdlLogisticaReversa()
385-
{
386-
return $this->wsdlLogisticaReversa;
387-
}
388-
389-
/**
390-
* @param string $wsdlLogisticaReversa
391-
* @return $this
392-
*/
393-
public function setWsdlLogisticaReversa($wsdlLogisticaReversa)
394-
{
395-
$this->wsdlLogisticaReversa = $wsdlLogisticaReversa;
396-
397-
return $this;
369+
switch ($this->env) {
370+
case self::ENV_PRODUCTION:
371+
return self::WSDL_PI_PRODUCTION;
372+
case self::ENV_DEVELOPMENT:
373+
default:
374+
return self::WSDL_PI_DEVELOPMENT;
375+
}
398376
}
399377

400378

0 commit comments

Comments
 (0)