From 863bad9dd83d8bd90822f322b73ed7dfc4c9ab83 Mon Sep 17 00:00:00 2001 From: Rafael Patro Date: Sat, 27 May 2017 12:38:38 -0300 Subject: [PATCH 1/7] =?UTF-8?q?#170=20Melhoria=20no=20Monitoramento=20Auto?= =?UTF-8?q?m=C3=A1tico=20das=20encomendas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PedroTeixeira/Correios/Model/Observer.php | 79 ++++++--- .../PedroTeixeira/Correios/Model/Sro.php | 164 ++++++++++++------ app/lib/Correios/Rastro.php | 67 +++++++ app/lib/Correios/Rastro/BuscaEventos.php | 61 +++++++ app/lib/Correios/Rastro/BuscaEventosLista.php | 61 +++++++ .../Rastro/BuscaEventosListaResponse.php | 21 +++ .../Correios/Rastro/BuscaEventosResponse.php | 21 +++ app/lib/Correios/Rastro/Destinos.php | 53 ++++++ app/lib/Correios/Rastro/EnderecoMobile.php | 101 +++++++++++ app/lib/Correios/Rastro/Eventos.php | 157 +++++++++++++++++ app/lib/Correios/Rastro/Objeto.php | 61 +++++++ app/lib/Correios/Rastro/Sroxml.php | 53 ++++++ 12 files changed, 826 insertions(+), 73 deletions(-) create mode 100644 app/lib/Correios/Rastro.php create mode 100644 app/lib/Correios/Rastro/BuscaEventos.php create mode 100644 app/lib/Correios/Rastro/BuscaEventosLista.php create mode 100644 app/lib/Correios/Rastro/BuscaEventosListaResponse.php create mode 100644 app/lib/Correios/Rastro/BuscaEventosResponse.php create mode 100644 app/lib/Correios/Rastro/Destinos.php create mode 100644 app/lib/Correios/Rastro/EnderecoMobile.php create mode 100644 app/lib/Correios/Rastro/Eventos.php create mode 100644 app/lib/Correios/Rastro/Objeto.php create mode 100644 app/lib/Correios/Rastro/Sroxml.php diff --git a/app/code/community/PedroTeixeira/Correios/Model/Observer.php b/app/code/community/PedroTeixeira/Correios/Model/Observer.php index e531984..5fe635b 100644 --- a/app/code/community/PedroTeixeira/Correios/Model/Observer.php +++ b/app/code/community/PedroTeixeira/Correios/Model/Observer.php @@ -20,32 +20,67 @@ class PedroTeixeira_Correios_Model_Observer */ public function sroTrackingJob() { - $count = 0; - /* @var $sro PedroTeixeira_Correios_Model_Sro */ - $sro = Mage::getModel('pedroteixeira_correios/sro'); - if ($sro->getConfigData('sro_tracking_job') == 0) { - return "SRO Tracking Job disabled."; + $message = "SRO Tracking Job disabled."; + if (Mage::helper('pedroteixeira_correios')->getConfigData('sro_tracking_job') == 0) { + return $message; } - $collection = $sro->getShippedTracks(); - foreach ($collection as $track) { - /* @var $track Mage_Sales_Model_Order_Shipment_Track */ - if ($sro->request($track->getNumber())) { - $savedId = $track->getDescription(); - $eventId = $sro->getEventId(); - if ($eventId != $savedId) { - $track->setDescription($eventId)->save(); - $track->getShipment()->getOrder() - ->setStatus($sro->getStatus()) - ->save(); - $track->getShipment() - ->addComment($sro->getComment(), $sro->isNotify(), true) - ->sendUpdateEmail($sro->isNotify(), $sro->getEmailComment()) - ->save(); - $count++; + $message = "No tracking updates"; + $count = 0; + $countTrack = 0; + $trackList = array(); + $sro = Mage::getModel('pedroteixeira_correios/sro')->init(); + $response = $sro->request(); + + if ($response && $response->return->qtd > 0) { + $tracksTxn = Mage::getModel('core/resource_transaction'); + $ordersTxn = Mage::getModel('core/resource_transaction'); + $shipmentsTxn = Mage::getModel('core/resource_transaction'); + foreach ($response->return->objeto as $obj) { + if (isset($obj->erro)) { + Mage::log("{$obj->numero}: {$obj->erro}"); + continue; + } + + if ($track = $sro->getTrack($obj)) { + $savedId = $track->getDescription(); + $eventId = $sro->getEventId($obj); + if ($eventId != $savedId) { + $status = $sro->getStatus($obj); + $notify = $sro->isNotify($obj); + $comment = $sro->getComment($obj); + $mailComment = $sro->getEmailComment($obj, $track); + $tracksTxn->addObject( + $track->setDescription($eventId) + ); + $ordersTxn->addObject( + $track->getShipment()->getOrder()->setStatus($status) + ); + $shipmentsTxn->addObject( + $track->getShipment() + ->addComment($comment, $notify, true) + ->sendUpdateEmail($notify, $mailComment) + ); + Mage::log("{$obj->numero}: saving scheduled"); + $count++; + } + } + $countTrack++; + } + + if ($count) { + try { + $tracksTxn->save(); + $ordersTxn->save(); + $shipmentsTxn->save(); + $message = "Updated {$count} objects of {$countTrack} tracked."; + } catch (Exception $e) { + $message = $e->getMessage(); } } } - return "Tracked {$count} objects of {$collection->getSize()}."; + + Mage::log($message); + return $message; } } diff --git a/app/code/community/PedroTeixeira/Correios/Model/Sro.php b/app/code/community/PedroTeixeira/Correios/Model/Sro.php index c84a714..92f0e4a 100644 --- a/app/code/community/PedroTeixeira/Correios/Model/Sro.php +++ b/app/code/community/PedroTeixeira/Correios/Model/Sro.php @@ -16,14 +16,22 @@ class PedroTeixeira_Correios_Model_Sro extends Varien_Object const CARRIER_CODE = 'pedroteixeira_correios'; const ORDER_SHIPPED_STATUS = 'complete_shipped'; const ORDER_WARNED_STATUS = 'complete_warned'; - - /** - * Request response - * - * @var SimpleXMLElement - */ - protected $_xml = null; + protected $_trackList = array(); + + public function init() + { + $collection = $this->getShippedTracks(); + foreach ($collection as $track) { + if ($this->validateTrackNumber($track->getNumber())) { + $this->_trackList[$track->getNumber()] = $track; + continue; + } + Mage::log("{$track->getNumber()}: invalid tracking code"); + } + return $this; + } + /** * Load all opened tracks from database. * Filter tracks only with complete order state, and shipped status. @@ -48,8 +56,6 @@ public function getShippedTracks() /** * Load XML response from Correios * - * @param string $trackingCode Tracking Code - * * @throws Exception * * @link http://www.correios.com.br/para-voce/correios-de-a-a-z/pdf/rastreamento-de-objetos/ @@ -57,31 +63,37 @@ public function getShippedTracks() * @link http://www.corporativo.correios.com.br/encomendas/sigepweb/doc/ * Manual_de_Implementacao_do_Web_Service_SIGEPWEB_Logistica_Reversa.pdf * - * @return boolean|PedroTeixeira_Correios_Model_Sro + * @return boolean|Correios_Rastro_BuscaEventosResponse */ - public function request($trackingCode) + public function request() { - $params = array( - 'usuario' => $this->getConfigData('sro_username'), - 'senha' => $this->getConfigData('sro_password'), - 'tipo' => $this->getConfigData('sro_type'), - 'resultado' => $this->getConfigData('sro_result'), - 'lingua' => $this->getConfigData('sro_language'), - 'objetos' => $trackingCode, - ); - - try { - $client = new SoapClient($this->getConfigData('url_sro_correios')); - $response = $client->buscaEventos($params); - if (empty($response)) { - throw new Exception("Empty response"); + $response = false; + if (count($this->_trackList)) { + $trackingCodes = implode('', array_keys($this->_trackList)); + $params = new Correios_Rastro_BuscaEventos( + $this->getConfigData('sro_username'), + $this->getConfigData('sro_password'), + $this->getConfigData('sro_type'), + $this->getConfigData('sro_result'), + $this->getConfigData('sro_language'), + $trackingCodes + ); + Mage::log(print_r($params, true)); + + try { + $client = new Correios_Rastro( + Mage::helper('pedroteixeira_correios')->getStreamContext(), + $this->getConfigData('url_sro_correios') + ); + $response = $client->buscaEventos($params); + if (empty($response)) { + throw new Exception("Empty response"); + } + } catch (Exception $e) { + Mage::log("Soap Error: {$e->getMessage()}"); } - $this->_xml = $response->return; - } catch (Exception $e) { - Mage::log("Soap Error: {$e->getMessage()}"); - return false; } - return $this; + return $response; } /** @@ -99,12 +111,14 @@ public function getConfigData($path) /** * Returns a Shipping comment message * + * @param Correios_Rastro_Objeto $obj Response Object + * * @return string */ - public function getComment() + public function getComment($obj) { - $code = $this->_xml->objeto->numero; - $evento = $this->_xml->objeto->evento; + $code = $obj->numero; + $evento = $obj->evento; $msg = array(); $msg[] = $code; $msg[] = "{$evento->cidade}/{$evento->uf}"; @@ -126,14 +140,17 @@ public function getComment() /** * Returns an Update Shipping e-mail comment * + * @param Correios_Rastro_Objeto $obj Response Object + * @param Mage_Sales_Model_Order_Shipment_Track $track Tracking instance + * * @return string */ - public function getEmailComment() + public function getEmailComment($obj, $track) { - $trackUrl = $this->getConfigData('url_tracking'); - $code = $this->_xml->objeto->numero; - $evento = $this->_xml->objeto->evento; - $htmlAnchor = "{$code}"; + $trackUrl = Mage::helper('shipping')->getTrackingPopupUrlBySalesModel($track); + $code = $obj->numero; + $evento = $obj->evento; + $htmlAnchor = "{$code}"; $msg = array(); $msg[] = Mage::helper('pedroteixeira_correios')->__('Rastreador: %s', $htmlAnchor); $msg[] = Mage::helper('pedroteixeira_correios')->__('Local: %s', "{$evento->cidade}/{$evento->uf}"); @@ -154,14 +171,15 @@ public function getEmailComment() /** * Check the event type * + * @param Correios_Rastro_Objeto $obj Response Object * @param string $mode Event Type Mode * * @return boolean */ - public function validate($mode) + public function validate($obj, $mode) { $isValid = false; - $evento = $this->_xml->objeto->evento; + $evento = $obj->evento; $hashTypes = explode(',', $this->getConfigData("sro_event_type_{$mode}")); if (in_array($evento->tipo, $hashTypes)) { $type = strtolower($evento->tipo); @@ -175,41 +193,85 @@ public function validate($mode) * Track Description field are now being used to save the event id. * Event Id is a simple key to identify the last carrier event. * + * @param Correios_Rastro_Objeto $obj Response Object + * * @return string */ - public function getEventId() + public function getEventId($obj) { - $code = $this->_xml->objeto->numero; - $date = $this->_xml->objeto->evento->data; - $hour = $this->_xml->objeto->evento->hora; - $type = $this->_xml->objeto->evento->tipo; - return "{$code}::{$date}{$hour}::{$type}"; + if ($obj->numero && $obj->evento) { + $code = $obj->numero; + $date = $obj->evento->data; + $hour = $obj->evento->hora; + $type = $obj->evento->tipo; + return "{$code}::{$date}{$hour}::{$type}"; + } + return false; } /** * Check whether event notify is enabled or not * + * @param Correios_Rastro_Objeto $obj Response Object + * * @return boolean */ - public function isNotify() + public function isNotify($obj) { - return $this->validate('notify'); + return $this->validate($obj, 'notify'); } /** * Load order status based on event checking * + * @param Correios_Rastro_Objeto $obj Response Object + * * @return string */ - public function getStatus() + public function getStatus($obj) { $status = self::ORDER_SHIPPED_STATUS; - if ($this->validate('warn')) { + if ($this->validate($obj, 'warn')) { $status = self::ORDER_WARNED_STATUS; } - if ($this->validate('last')) { + if ($this->validate($obj, 'last')) { $status = Mage_Sales_Model_Order::STATE_COMPLETE; } return $status; } + + /** + * Validates the tracking code + * + * @param string $trackNumber Tracking Code + * + * @return boolean + */ + public function validateTrackNumber($trackNumber) + { + return preg_match('/^[a-zA-Z]{2}[0-9]{9}[a-zA-Z]{2}$/', $trackNumber); + } + + /** + * Retrieves the tracking instance + * + * @throws Exception + * + * @param Correios_Rastro_Objeto $obj Return Object + * + * @return Mage_Sales_Model_Order_Shipment_Track + */ + public function getTrack($obj) + { + $track = $this->_trackList[$obj->numero]; + if (!($desc = $track->getDescription())) { + Mage::log("{$obj->numero}: tracking instance missed. Trying to reload"); + try { + $track = Mage::getModel('sales/order_shipment_track')->load($obj->numero, 'track_number'); + } catch (Exception $e) { + Mage::log("{$obj->numero}: {$e->getMessage()}"); + } + } + return $track; + } } diff --git a/app/lib/Correios/Rastro.php b/app/lib/Correios/Rastro.php new file mode 100644 index 0000000..2bb7bc9 --- /dev/null +++ b/app/lib/Correios/Rastro.php @@ -0,0 +1,67 @@ + 'Correios_Rastro_BuscaEventosLista', + 'BuscaEventosListaResponse' => 'Correios_Rastro_BuscaEventosListaResponse', + 'Sroxml' => 'Correios_Rastro_Sroxml', + 'Objeto' => 'Correios_Rastro_Objeto', + 'Eventos' => 'Correios_Rastro_Eventos', + 'Destinos' => 'Correios_Rastro_Destinos', + 'EnderecoMobile' => 'Correios_Rastro_EnderecoMobile', + 'BuscaEventos' => 'Correios_Rastro_BuscaEventos', + 'BuscaEventosResponse' => 'Correios_Rastro_BuscaEventosResponse'); + + /** + * @param array $options A array of config values + * @param string $wsdl The wsdl file to use + * @access public + */ + public function __construct(array $options = array(), $wsdl = 'Rastro.wsdl') + { + foreach (self::$classmap as $key => $value) { + if (!isset($options['classmap'][$key])) { + $options['classmap'][$key] = $value; + } + } + + parent::__construct($wsdl, $options); + } + + /** + * @param Correios_Rastro_BuscaEventos $parameters + * @access public + * @return Correios_Rastro_BuscaEventosResponse + */ + public function buscaEventos(Correios_Rastro_BuscaEventos $parameters) + { + return $this->__soapCall('buscaEventos', array($parameters)); + } + + /** + * @param Correios_Rastro_BuscaEventosLista $parameters + * @access public + * @return Correios_Rastro_BuscaEventosListaResponse + */ + public function buscaEventosLista(Correios_Rastro_BuscaEventosLista $parameters) + { + return $this->__soapCall('buscaEventosLista', array($parameters)); + } + +} diff --git a/app/lib/Correios/Rastro/BuscaEventos.php b/app/lib/Correios/Rastro/BuscaEventos.php new file mode 100644 index 0000000..1c15a7c --- /dev/null +++ b/app/lib/Correios/Rastro/BuscaEventos.php @@ -0,0 +1,61 @@ +usuario = $usuario; + $this->senha = $senha; + $this->tipo = $tipo; + $this->resultado = $resultado; + $this->lingua = $lingua; + $this->objetos = $objetos; + } + +} diff --git a/app/lib/Correios/Rastro/BuscaEventosLista.php b/app/lib/Correios/Rastro/BuscaEventosLista.php new file mode 100644 index 0000000..fd4d420 --- /dev/null +++ b/app/lib/Correios/Rastro/BuscaEventosLista.php @@ -0,0 +1,61 @@ +usuario = $usuario; + $this->senha = $senha; + $this->tipo = $tipo; + $this->resultado = $resultado; + $this->lingua = $lingua; + $this->objetos = $objetos; + } + +} diff --git a/app/lib/Correios/Rastro/BuscaEventosListaResponse.php b/app/lib/Correios/Rastro/BuscaEventosListaResponse.php new file mode 100644 index 0000000..90fb66d --- /dev/null +++ b/app/lib/Correios/Rastro/BuscaEventosListaResponse.php @@ -0,0 +1,21 @@ +return = $return; + } + +} diff --git a/app/lib/Correios/Rastro/BuscaEventosResponse.php b/app/lib/Correios/Rastro/BuscaEventosResponse.php new file mode 100644 index 0000000..b8df656 --- /dev/null +++ b/app/lib/Correios/Rastro/BuscaEventosResponse.php @@ -0,0 +1,21 @@ +return = $return; + } + +} diff --git a/app/lib/Correios/Rastro/Destinos.php b/app/lib/Correios/Rastro/Destinos.php new file mode 100644 index 0000000..4caff5e --- /dev/null +++ b/app/lib/Correios/Rastro/Destinos.php @@ -0,0 +1,53 @@ +local = $local; + $this->codigo = $codigo; + $this->cidade = $cidade; + $this->bairro = $bairro; + $this->uf = $uf; + } + +} diff --git a/app/lib/Correios/Rastro/EnderecoMobile.php b/app/lib/Correios/Rastro/EnderecoMobile.php new file mode 100644 index 0000000..bc86b3f --- /dev/null +++ b/app/lib/Correios/Rastro/EnderecoMobile.php @@ -0,0 +1,101 @@ +codigo = $codigo; + $this->cep = $cep; + $this->logradouro = $logradouro; + $this->complemento = $complemento; + $this->numero = $numero; + $this->localidade = $localidade; + $this->uf = $uf; + $this->bairro = $bairro; + $this->latitude = $latitude; + $this->longitude = $longitude; + $this->celular = $celular; + } + +} diff --git a/app/lib/Correios/Rastro/Eventos.php b/app/lib/Correios/Rastro/Eventos.php new file mode 100644 index 0000000..5db943f --- /dev/null +++ b/app/lib/Correios/Rastro/Eventos.php @@ -0,0 +1,157 @@ +tipo = $tipo; + $this->status = $status; + $this->data = $data; + $this->hora = $hora; + $this->descricao = $descricao; + $this->detalhe = $detalhe; + $this->recebedor = $recebedor; + $this->documento = $documento; + $this->comentario = $comentario; + $this->local = $local; + $this->codigo = $codigo; + $this->cidade = $cidade; + $this->uf = $uf; + $this->sto = $sto; + $this->amazoncode = $amazoncode; + $this->amazontimezone = $amazontimezone; + $this->destino = $destino; + $this->endereco = $endereco; + } + +} diff --git a/app/lib/Correios/Rastro/Objeto.php b/app/lib/Correios/Rastro/Objeto.php new file mode 100644 index 0000000..23ec027 --- /dev/null +++ b/app/lib/Correios/Rastro/Objeto.php @@ -0,0 +1,61 @@ +numero = $numero; + $this->sigla = $sigla; + $this->nome = $nome; + $this->categoria = $categoria; + $this->erro = $erro; + $this->evento = $evento; + } + +} diff --git a/app/lib/Correios/Rastro/Sroxml.php b/app/lib/Correios/Rastro/Sroxml.php new file mode 100644 index 0000000..26cefa7 --- /dev/null +++ b/app/lib/Correios/Rastro/Sroxml.php @@ -0,0 +1,53 @@ +versao = $versao; + $this->qtd = $qtd; + $this->TipoPesquisa = $TipoPesquisa; + $this->TipoResultado = $TipoResultado; + $this->objeto = $objeto; + } + +} From 1651f6fb996a8fb02363ac9ab33a96ad4ef2527b Mon Sep 17 00:00:00 2001 From: Rafael Patro Date: Sat, 27 May 2017 19:52:12 -0300 Subject: [PATCH 2/7] =?UTF-8?q?#265=20Removidas=20as=20declara=C3=A7=C3=B5?= =?UTF-8?q?es=20include=5Fonce?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/Correios/Rastro.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/app/lib/Correios/Rastro.php b/app/lib/Correios/Rastro.php index 2bb7bc9..d89bed2 100644 --- a/app/lib/Correios/Rastro.php +++ b/app/lib/Correios/Rastro.php @@ -1,15 +1,5 @@ Date: Sat, 27 May 2017 20:49:54 -0300 Subject: [PATCH 3/7] =?UTF-8?q?#265=20Corre=C3=A7=C3=A3o=20do=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PedroTeixeira/Correios/Model/Sro.php | 15 ++-- app/lib/Correios/Rastro.php | 24 +++++- app/lib/Correios/Rastro/BuscaEventos.php | 36 +++++--- app/lib/Correios/Rastro/BuscaEventosLista.php | 36 +++++--- .../Rastro/BuscaEventosListaResponse.php | 16 +++- .../Correios/Rastro/BuscaEventosResponse.php | 16 +++- app/lib/Correios/Rastro/Destinos.php | 32 ++++--- app/lib/Correios/Rastro/EnderecoMobile.php | 56 ++++++++----- app/lib/Correios/Rastro/Eventos.php | 84 +++++++++++-------- app/lib/Correios/Rastro/Objeto.php | 36 +++++--- app/lib/Correios/Rastro/Sroxml.php | 32 ++++--- 11 files changed, 256 insertions(+), 127 deletions(-) diff --git a/app/code/community/PedroTeixeira/Correios/Model/Sro.php b/app/code/community/PedroTeixeira/Correios/Model/Sro.php index 92f0e4a..09f1108 100644 --- a/app/code/community/PedroTeixeira/Correios/Model/Sro.php +++ b/app/code/community/PedroTeixeira/Correios/Model/Sro.php @@ -19,6 +19,11 @@ class PedroTeixeira_Correios_Model_Sro extends Varien_Object protected $_trackList = array(); + /** + * Retrieves all valid tracking codes + * + * @return PedroTeixeira_Correios_Model_Sro + */ public function init() { $collection = $this->getShippedTracks(); @@ -140,7 +145,7 @@ public function getComment($obj) /** * Returns an Update Shipping e-mail comment * - * @param Correios_Rastro_Objeto $obj Response Object + * @param Correios_Rastro_Objeto $obj Response Object * @param Mage_Sales_Model_Order_Shipment_Track $track Tracking instance * * @return string @@ -171,8 +176,8 @@ public function getEmailComment($obj, $track) /** * Check the event type * - * @param Correios_Rastro_Objeto $obj Response Object - * @param string $mode Event Type Mode + * @param Correios_Rastro_Objeto $obj Response Object + * @param string $mode Event Type Mode * * @return boolean */ @@ -255,10 +260,10 @@ public function validateTrackNumber($trackNumber) /** * Retrieves the tracking instance * - * @throws Exception - * * @param Correios_Rastro_Objeto $obj Return Object * + * @throws Exception + * * @return Mage_Sales_Model_Order_Shipment_Track */ public function getTrack($obj) diff --git a/app/lib/Correios/Rastro.php b/app/lib/Correios/Rastro.php index d89bed2..4036f80 100644 --- a/app/lib/Correios/Rastro.php +++ b/app/lib/Correios/Rastro.php @@ -1,5 +1,16 @@ + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) + * @license http://opensource.org/licenses/MIT MIT + * @link https://github.com/pedro-teixeira/correios + */ class Correios_Rastro extends SoapClient { @@ -19,8 +30,9 @@ class Correios_Rastro extends SoapClient 'BuscaEventosResponse' => 'Correios_Rastro_BuscaEventosResponse'); /** - * @param array $options A array of config values - * @param string $wsdl The wsdl file to use + * @param array $options An array of config values + * @param string $wsdl The wsdl file to use + * * @access public */ public function __construct(array $options = array(), $wsdl = 'Rastro.wsdl') @@ -35,8 +47,10 @@ public function __construct(array $options = array(), $wsdl = 'Rastro.wsdl') } /** - * @param Correios_Rastro_BuscaEventos $parameters + * @param Correios_Rastro_BuscaEventos $parameters Parameters + * * @access public + * * @return Correios_Rastro_BuscaEventosResponse */ public function buscaEventos(Correios_Rastro_BuscaEventos $parameters) @@ -45,8 +59,10 @@ public function buscaEventos(Correios_Rastro_BuscaEventos $parameters) } /** - * @param Correios_Rastro_BuscaEventosLista $parameters + * @param Correios_Rastro_BuscaEventosLista $parameters Parameters + * * @access public + * * @return Correios_Rastro_BuscaEventosListaResponse */ public function buscaEventosLista(Correios_Rastro_BuscaEventosLista $parameters) diff --git a/app/lib/Correios/Rastro/BuscaEventos.php b/app/lib/Correios/Rastro/BuscaEventos.php index 1c15a7c..8eced73 100644 --- a/app/lib/Correios/Rastro/BuscaEventos.php +++ b/app/lib/Correios/Rastro/BuscaEventos.php @@ -1,5 +1,16 @@ + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) + * @license http://opensource.org/licenses/MIT MIT + * @link https://github.com/pedro-teixeira/correios + */ class Correios_Rastro_BuscaEventos { @@ -40,22 +51,23 @@ class Correios_Rastro_BuscaEventos public $objetos = null; /** - * @param string $usuario - * @param string $senha - * @param string $tipo - * @param string $resultado - * @param string $lingua - * @param string $objetos + * @param string $usuario Username + * @param string $senha Password + * @param string $tipo Type + * @param string $resultado Result + * @param string $lingua Language + * @param string $objetos Objects + * * @access public */ public function __construct($usuario, $senha, $tipo, $resultado, $lingua, $objetos) { - $this->usuario = $usuario; - $this->senha = $senha; - $this->tipo = $tipo; - $this->resultado = $resultado; - $this->lingua = $lingua; - $this->objetos = $objetos; + $this->usuario = $usuario; + $this->senha = $senha; + $this->tipo = $tipo; + $this->resultado = $resultado; + $this->lingua = $lingua; + $this->objetos = $objetos; } } diff --git a/app/lib/Correios/Rastro/BuscaEventosLista.php b/app/lib/Correios/Rastro/BuscaEventosLista.php index fd4d420..baf7db5 100644 --- a/app/lib/Correios/Rastro/BuscaEventosLista.php +++ b/app/lib/Correios/Rastro/BuscaEventosLista.php @@ -1,5 +1,16 @@ + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) + * @license http://opensource.org/licenses/MIT MIT + * @link https://github.com/pedro-teixeira/correios + */ class Correios_Rastro_BuscaEventosLista { @@ -40,22 +51,23 @@ class Correios_Rastro_BuscaEventosLista public $objetos = null; /** - * @param string $usuario - * @param string $senha - * @param string $tipo - * @param string $resultado - * @param string $lingua - * @param string[] $objetos + * @param string $usuario Username + * @param string $senha Password + * @param string $tipo Type + * @param string $resultado Result + * @param string $lingua Language + * @param string[] $objetos Object List + * * @access public */ public function __construct($usuario, $senha, $tipo, $resultado, $lingua, $objetos) { - $this->usuario = $usuario; - $this->senha = $senha; - $this->tipo = $tipo; - $this->resultado = $resultado; - $this->lingua = $lingua; - $this->objetos = $objetos; + $this->usuario = $usuario; + $this->senha = $senha; + $this->tipo = $tipo; + $this->resultado = $resultado; + $this->lingua = $lingua; + $this->objetos = $objetos; } } diff --git a/app/lib/Correios/Rastro/BuscaEventosListaResponse.php b/app/lib/Correios/Rastro/BuscaEventosListaResponse.php index 90fb66d..4baf2cc 100644 --- a/app/lib/Correios/Rastro/BuscaEventosListaResponse.php +++ b/app/lib/Correios/Rastro/BuscaEventosListaResponse.php @@ -1,5 +1,16 @@ + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) + * @license http://opensource.org/licenses/MIT MIT + * @link https://github.com/pedro-teixeira/correios + */ class Correios_Rastro_BuscaEventosListaResponse { @@ -10,12 +21,13 @@ class Correios_Rastro_BuscaEventosListaResponse public $return = null; /** - * @param Correios_Rastro_Sroxml $return + * @param Correios_Rastro_Sroxml $return Sroxml Object + * * @access public */ public function __construct($return) { - $this->return = $return; + $this->return = $return; } } diff --git a/app/lib/Correios/Rastro/BuscaEventosResponse.php b/app/lib/Correios/Rastro/BuscaEventosResponse.php index b8df656..866d24f 100644 --- a/app/lib/Correios/Rastro/BuscaEventosResponse.php +++ b/app/lib/Correios/Rastro/BuscaEventosResponse.php @@ -1,5 +1,16 @@ + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) + * @license http://opensource.org/licenses/MIT MIT + * @link https://github.com/pedro-teixeira/correios + */ class Correios_Rastro_BuscaEventosResponse { @@ -10,12 +21,13 @@ class Correios_Rastro_BuscaEventosResponse public $return = null; /** - * @param Correios_Rastro_Sroxml $return + * @param Correios_Rastro_Sroxml $return Sroxml Object + * * @access public */ public function __construct($return) { - $this->return = $return; + $this->return = $return; } } diff --git a/app/lib/Correios/Rastro/Destinos.php b/app/lib/Correios/Rastro/Destinos.php index 4caff5e..d5fd446 100644 --- a/app/lib/Correios/Rastro/Destinos.php +++ b/app/lib/Correios/Rastro/Destinos.php @@ -1,5 +1,16 @@ + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) + * @license http://opensource.org/licenses/MIT MIT + * @link https://github.com/pedro-teixeira/correios + */ class Correios_Rastro_Destinos { @@ -34,20 +45,21 @@ class Correios_Rastro_Destinos public $uf = null; /** - * @param string $local - * @param string $codigo - * @param string $cidade - * @param string $bairro - * @param string $uf + * @param string $local Local + * @param string $codigo Code + * @param string $cidade City + * @param string $bairro Address + * @param string $uf Region Code + * * @access public */ public function __construct($local, $codigo, $cidade, $bairro, $uf) { - $this->local = $local; - $this->codigo = $codigo; - $this->cidade = $cidade; - $this->bairro = $bairro; - $this->uf = $uf; + $this->local = $local; + $this->codigo = $codigo; + $this->cidade = $cidade; + $this->bairro = $bairro; + $this->uf = $uf; } } diff --git a/app/lib/Correios/Rastro/EnderecoMobile.php b/app/lib/Correios/Rastro/EnderecoMobile.php index bc86b3f..7b2b32c 100644 --- a/app/lib/Correios/Rastro/EnderecoMobile.php +++ b/app/lib/Correios/Rastro/EnderecoMobile.php @@ -1,5 +1,16 @@ + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) + * @license http://opensource.org/licenses/MIT MIT + * @link https://github.com/pedro-teixeira/correios + */ class Correios_Rastro_EnderecoMobile { @@ -70,32 +81,33 @@ class Correios_Rastro_EnderecoMobile public $celular = null; /** - * @param string $codigo - * @param string $cep - * @param string $logradouro - * @param string $complemento - * @param string $numero - * @param string $localidade - * @param string $uf - * @param string $bairro - * @param string $latitude - * @param string $longitude - * @param string $celular + * @param string $codigo Code + * @param string $cep Zip + * @param string $logradouro Street + * @param string $complemento Street 2 + * @param string $numero Number + * @param string $localidade Region + * @param string $uf Region Code + * @param string $bairro Address + * @param string $latitude Latitude + * @param string $longitude Longitude + * @param string $celular Cellphone + * * @access public */ public function __construct($codigo, $cep, $logradouro, $complemento, $numero, $localidade, $uf, $bairro, $latitude, $longitude, $celular) { - $this->codigo = $codigo; - $this->cep = $cep; - $this->logradouro = $logradouro; - $this->complemento = $complemento; - $this->numero = $numero; - $this->localidade = $localidade; - $this->uf = $uf; - $this->bairro = $bairro; - $this->latitude = $latitude; - $this->longitude = $longitude; - $this->celular = $celular; + $this->codigo = $codigo; + $this->cep = $cep; + $this->logradouro = $logradouro; + $this->complemento = $complemento; + $this->numero = $numero; + $this->localidade = $localidade; + $this->uf = $uf; + $this->bairro = $bairro; + $this->latitude = $latitude; + $this->longitude = $longitude; + $this->celular = $celular; } } diff --git a/app/lib/Correios/Rastro/Eventos.php b/app/lib/Correios/Rastro/Eventos.php index 5db943f..7b189ae 100644 --- a/app/lib/Correios/Rastro/Eventos.php +++ b/app/lib/Correios/Rastro/Eventos.php @@ -1,5 +1,16 @@ + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) + * @license http://opensource.org/licenses/MIT MIT + * @link https://github.com/pedro-teixeira/correios + */ class Correios_Rastro_Eventos { @@ -112,46 +123,47 @@ class Correios_Rastro_Eventos public $endereco = null; /** - * @param string $tipo - * @param string $status - * @param string $data - * @param string $hora - * @param string $descricao - * @param string $detalhe - * @param string $recebedor - * @param string $documento - * @param string $comentario - * @param string $local - * @param string $codigo - * @param string $cidade - * @param string $uf - * @param string $sto - * @param string $amazoncode - * @param string $amazontimezone - * @param Correios_Rastro_Destinos $destino - * @param Correios_Rastro_EnderecoMobile $endereco + * @param string $tipo Type + * @param string $status State + * @param string $data Date + * @param string $hora Hour + * @param string $descricao Description + * @param string $detalhe Detail + * @param string $recebedor Receiver + * @param string $documento Document + * @param string $comentario Comment + * @param string $local Local + * @param string $codigo Code + * @param string $cidade City + * @param string $uf State + * @param string $sto Sto + * @param string $amazoncode Amazon Code + * @param string $amazontimezone Amazon Timezone + * @param Correios_Rastro_Destinos $destino Destination + * @param Correios_Rastro_EnderecoMobile $endereco Address + * * @access public */ public function __construct($tipo, $status, $data, $hora, $descricao, $detalhe, $recebedor, $documento, $comentario, $local, $codigo, $cidade, $uf, $sto, $amazoncode, $amazontimezone, $destino, $endereco) { - $this->tipo = $tipo; - $this->status = $status; - $this->data = $data; - $this->hora = $hora; - $this->descricao = $descricao; - $this->detalhe = $detalhe; - $this->recebedor = $recebedor; - $this->documento = $documento; - $this->comentario = $comentario; - $this->local = $local; - $this->codigo = $codigo; - $this->cidade = $cidade; - $this->uf = $uf; - $this->sto = $sto; - $this->amazoncode = $amazoncode; - $this->amazontimezone = $amazontimezone; - $this->destino = $destino; - $this->endereco = $endereco; + $this->tipo = $tipo; + $this->status = $status; + $this->data = $data; + $this->hora = $hora; + $this->descricao = $descricao; + $this->detalhe = $detalhe; + $this->recebedor = $recebedor; + $this->documento = $documento; + $this->comentario = $comentario; + $this->local = $local; + $this->codigo = $codigo; + $this->cidade = $cidade; + $this->uf = $uf; + $this->sto = $sto; + $this->amazoncode = $amazoncode; + $this->amazontimezone = $amazontimezone; + $this->destino = $destino; + $this->endereco = $endereco; } } diff --git a/app/lib/Correios/Rastro/Objeto.php b/app/lib/Correios/Rastro/Objeto.php index 23ec027..ef02f42 100644 --- a/app/lib/Correios/Rastro/Objeto.php +++ b/app/lib/Correios/Rastro/Objeto.php @@ -1,5 +1,16 @@ + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) + * @license http://opensource.org/licenses/MIT MIT + * @link https://github.com/pedro-teixeira/correios + */ class Correios_Rastro_Objeto { @@ -40,22 +51,23 @@ class Correios_Rastro_Objeto public $evento = null; /** - * @param string $numero - * @param string $sigla - * @param string $nome - * @param string $categoria - * @param string $erro - * @param Correios_Rastro_Eventos $evento + * @param string $numero Number + * @param string $sigla Initials + * @param string $nome Name + * @param string $categoria Category + * @param string $erro Error + * @param Correios_Rastro_Eventos $evento Event + * * @access public */ public function __construct($numero, $sigla, $nome, $categoria, $erro, $evento) { - $this->numero = $numero; - $this->sigla = $sigla; - $this->nome = $nome; - $this->categoria = $categoria; - $this->erro = $erro; - $this->evento = $evento; + $this->numero = $numero; + $this->sigla = $sigla; + $this->nome = $nome; + $this->categoria = $categoria; + $this->erro = $erro; + $this->evento = $evento; } } diff --git a/app/lib/Correios/Rastro/Sroxml.php b/app/lib/Correios/Rastro/Sroxml.php index 26cefa7..ce50f08 100644 --- a/app/lib/Correios/Rastro/Sroxml.php +++ b/app/lib/Correios/Rastro/Sroxml.php @@ -1,5 +1,16 @@ + * @copyright 2015 Pedro Teixeira (http://pedroteixeira.io) + * @license http://opensource.org/licenses/MIT MIT + * @link https://github.com/pedro-teixeira/correios + */ class Correios_Rastro_Sroxml { @@ -34,20 +45,21 @@ class Correios_Rastro_Sroxml public $objeto = null; /** - * @param string $versao - * @param string $qtd - * @param string $TipoPesquisa - * @param string $TipoResultado - * @param Correios_Rastro_Objeto $objeto + * @param string $versao Release + * @param string $qtd Quantity + * @param string $TipoPesquisa Search Type + * @param string $TipoResultado Result Type + * @param Correios_Rastro_Objeto $objeto Object + * * @access public */ public function __construct($versao, $qtd, $TipoPesquisa, $TipoResultado, $objeto) { - $this->versao = $versao; - $this->qtd = $qtd; - $this->TipoPesquisa = $TipoPesquisa; - $this->TipoResultado = $TipoResultado; - $this->objeto = $objeto; + $this->versao = $versao; + $this->qtd = $qtd; + $this->TipoPesquisa = $TipoPesquisa; + $this->TipoResultado = $TipoResultado; + $this->objeto = $objeto; } } From a9db02fa39f663f181fe5207d9a4627f62d54517 Mon Sep 17 00:00:00 2001 From: Rafael Patro Date: Sat, 27 May 2017 20:57:13 -0300 Subject: [PATCH 4/7] =?UTF-8?q?#266=20Corre=C3=A7=C3=A3o=20do=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/Correios/Rastro.php | 3 +++ app/lib/Correios/Rastro/BuscaEventos.php | 1 + app/lib/Correios/Rastro/BuscaEventosLista.php | 1 + app/lib/Correios/Rastro/BuscaEventosListaResponse.php | 1 + app/lib/Correios/Rastro/BuscaEventosResponse.php | 1 + app/lib/Correios/Rastro/Destinos.php | 1 + app/lib/Correios/Rastro/EnderecoMobile.php | 5 ++++- app/lib/Correios/Rastro/Eventos.php | 6 +++++- app/lib/Correios/Rastro/Objeto.php | 1 + app/lib/Correios/Rastro/Sroxml.php | 1 + 10 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/lib/Correios/Rastro.php b/app/lib/Correios/Rastro.php index 4036f80..89d2816 100644 --- a/app/lib/Correios/Rastro.php +++ b/app/lib/Correios/Rastro.php @@ -30,6 +30,7 @@ class Correios_Rastro extends SoapClient 'BuscaEventosResponse' => 'Correios_Rastro_BuscaEventosResponse'); /** + * * @param array $options An array of config values * @param string $wsdl The wsdl file to use * @@ -47,6 +48,7 @@ public function __construct(array $options = array(), $wsdl = 'Rastro.wsdl') } /** + * * @param Correios_Rastro_BuscaEventos $parameters Parameters * * @access public @@ -59,6 +61,7 @@ public function buscaEventos(Correios_Rastro_BuscaEventos $parameters) } /** + * * @param Correios_Rastro_BuscaEventosLista $parameters Parameters * * @access public diff --git a/app/lib/Correios/Rastro/BuscaEventos.php b/app/lib/Correios/Rastro/BuscaEventos.php index 8eced73..5455206 100644 --- a/app/lib/Correios/Rastro/BuscaEventos.php +++ b/app/lib/Correios/Rastro/BuscaEventos.php @@ -51,6 +51,7 @@ class Correios_Rastro_BuscaEventos public $objetos = null; /** + * * @param string $usuario Username * @param string $senha Password * @param string $tipo Type diff --git a/app/lib/Correios/Rastro/BuscaEventosLista.php b/app/lib/Correios/Rastro/BuscaEventosLista.php index baf7db5..2f7c812 100644 --- a/app/lib/Correios/Rastro/BuscaEventosLista.php +++ b/app/lib/Correios/Rastro/BuscaEventosLista.php @@ -51,6 +51,7 @@ class Correios_Rastro_BuscaEventosLista public $objetos = null; /** + * * @param string $usuario Username * @param string $senha Password * @param string $tipo Type diff --git a/app/lib/Correios/Rastro/BuscaEventosListaResponse.php b/app/lib/Correios/Rastro/BuscaEventosListaResponse.php index 4baf2cc..2eb494f 100644 --- a/app/lib/Correios/Rastro/BuscaEventosListaResponse.php +++ b/app/lib/Correios/Rastro/BuscaEventosListaResponse.php @@ -21,6 +21,7 @@ class Correios_Rastro_BuscaEventosListaResponse public $return = null; /** + * * @param Correios_Rastro_Sroxml $return Sroxml Object * * @access public diff --git a/app/lib/Correios/Rastro/BuscaEventosResponse.php b/app/lib/Correios/Rastro/BuscaEventosResponse.php index 866d24f..4ee2cac 100644 --- a/app/lib/Correios/Rastro/BuscaEventosResponse.php +++ b/app/lib/Correios/Rastro/BuscaEventosResponse.php @@ -21,6 +21,7 @@ class Correios_Rastro_BuscaEventosResponse public $return = null; /** + * * @param Correios_Rastro_Sroxml $return Sroxml Object * * @access public diff --git a/app/lib/Correios/Rastro/Destinos.php b/app/lib/Correios/Rastro/Destinos.php index d5fd446..60e6c44 100644 --- a/app/lib/Correios/Rastro/Destinos.php +++ b/app/lib/Correios/Rastro/Destinos.php @@ -45,6 +45,7 @@ class Correios_Rastro_Destinos public $uf = null; /** + * * @param string $local Local * @param string $codigo Code * @param string $cidade City diff --git a/app/lib/Correios/Rastro/EnderecoMobile.php b/app/lib/Correios/Rastro/EnderecoMobile.php index 7b2b32c..d09f176 100644 --- a/app/lib/Correios/Rastro/EnderecoMobile.php +++ b/app/lib/Correios/Rastro/EnderecoMobile.php @@ -81,6 +81,7 @@ class Correios_Rastro_EnderecoMobile public $celular = null; /** + * * @param string $codigo Code * @param string $cep Zip * @param string $logradouro Street @@ -95,7 +96,9 @@ class Correios_Rastro_EnderecoMobile * * @access public */ - public function __construct($codigo, $cep, $logradouro, $complemento, $numero, $localidade, $uf, $bairro, $latitude, $longitude, $celular) + public function __construct( + $codigo, $cep, $logradouro, $complemento, $numero, $localidade, $uf, $bairro, $latitude, $longitude, $celular + ) { $this->codigo = $codigo; $this->cep = $cep; diff --git a/app/lib/Correios/Rastro/Eventos.php b/app/lib/Correios/Rastro/Eventos.php index 7b189ae..222b46e 100644 --- a/app/lib/Correios/Rastro/Eventos.php +++ b/app/lib/Correios/Rastro/Eventos.php @@ -123,6 +123,7 @@ class Correios_Rastro_Eventos public $endereco = null; /** + * * @param string $tipo Type * @param string $status State * @param string $data Date @@ -144,7 +145,10 @@ class Correios_Rastro_Eventos * * @access public */ - public function __construct($tipo, $status, $data, $hora, $descricao, $detalhe, $recebedor, $documento, $comentario, $local, $codigo, $cidade, $uf, $sto, $amazoncode, $amazontimezone, $destino, $endereco) + public function __construct( + $tipo, $status, $data, $hora, $descricao, $detalhe, $recebedor, $documento, $comentario, $local, $codigo, + $cidade, $uf, $sto, $amazoncode, $amazontimezone, $destino, $endereco + ) { $this->tipo = $tipo; $this->status = $status; diff --git a/app/lib/Correios/Rastro/Objeto.php b/app/lib/Correios/Rastro/Objeto.php index ef02f42..fea7cd7 100644 --- a/app/lib/Correios/Rastro/Objeto.php +++ b/app/lib/Correios/Rastro/Objeto.php @@ -51,6 +51,7 @@ class Correios_Rastro_Objeto public $evento = null; /** + * * @param string $numero Number * @param string $sigla Initials * @param string $nome Name diff --git a/app/lib/Correios/Rastro/Sroxml.php b/app/lib/Correios/Rastro/Sroxml.php index ce50f08..7a40d04 100644 --- a/app/lib/Correios/Rastro/Sroxml.php +++ b/app/lib/Correios/Rastro/Sroxml.php @@ -45,6 +45,7 @@ class Correios_Rastro_Sroxml public $objeto = null; /** + * * @param string $versao Release * @param string $qtd Quantity * @param string $TipoPesquisa Search Type From 56896e4a015ed94205a39a92333b3536ec35900b Mon Sep 17 00:00:00 2001 From: Rafael Patro Date: Sat, 27 May 2017 21:10:17 -0300 Subject: [PATCH 5/7] =?UTF-8?q?#266=20Corre=C3=A7=C3=A3o=20do=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/Correios/Rastro.php | 34 +++++++++++-------- app/lib/Correios/Rastro/BuscaEventos.php | 1 + app/lib/Correios/Rastro/BuscaEventosLista.php | 1 + .../Rastro/BuscaEventosListaResponse.php | 1 + .../Correios/Rastro/BuscaEventosResponse.php | 1 + app/lib/Correios/Rastro/Destinos.php | 1 + app/lib/Correios/Rastro/EnderecoMobile.php | 1 + app/lib/Correios/Rastro/Eventos.php | 1 + app/lib/Correios/Rastro/Objeto.php | 1 + app/lib/Correios/Rastro/Sroxml.php | 1 + 10 files changed, 28 insertions(+), 15 deletions(-) diff --git a/app/lib/Correios/Rastro.php b/app/lib/Correios/Rastro.php index 89d2816..819e82f 100644 --- a/app/lib/Correios/Rastro.php +++ b/app/lib/Correios/Rastro.php @@ -19,17 +19,19 @@ class Correios_Rastro extends SoapClient * @access private */ private static $classmap = array( - 'BuscaEventosLista' => 'Correios_Rastro_BuscaEventosLista', - 'BuscaEventosListaResponse' => 'Correios_Rastro_BuscaEventosListaResponse', - 'Sroxml' => 'Correios_Rastro_Sroxml', - 'Objeto' => 'Correios_Rastro_Objeto', - 'Eventos' => 'Correios_Rastro_Eventos', - 'Destinos' => 'Correios_Rastro_Destinos', - 'EnderecoMobile' => 'Correios_Rastro_EnderecoMobile', - 'BuscaEventos' => 'Correios_Rastro_BuscaEventos', - 'BuscaEventosResponse' => 'Correios_Rastro_BuscaEventosResponse'); + 'BuscaEventosLista' => 'Correios_Rastro_BuscaEventosLista', + 'BuscaEventosListaResponse' => 'Correios_Rastro_BuscaEventosListaResponse', + 'Sroxml' => 'Correios_Rastro_Sroxml', + 'Objeto' => 'Correios_Rastro_Objeto', + 'Eventos' => 'Correios_Rastro_Eventos', + 'Destinos' => 'Correios_Rastro_Destinos', + 'EnderecoMobile' => 'Correios_Rastro_EnderecoMobile', + 'BuscaEventos' => 'Correios_Rastro_BuscaEventos', + 'BuscaEventosResponse' => 'Correios_Rastro_BuscaEventosResponse' + ); /** + * Class constructor method * * @param array $options An array of config values * @param string $wsdl The wsdl file to use @@ -38,16 +40,17 @@ class Correios_Rastro extends SoapClient */ public function __construct(array $options = array(), $wsdl = 'Rastro.wsdl') { - foreach (self::$classmap as $key => $value) { - if (!isset($options['classmap'][$key])) { - $options['classmap'][$key] = $value; + foreach (self::$classmap as $key => $value) { + if (!isset($options['classmap'][$key])) { + $options['classmap'][$key] = $value; + } } - } parent::__construct($wsdl, $options); } /** + * Request method for buscaEventos * * @param Correios_Rastro_BuscaEventos $parameters Parameters * @@ -57,10 +60,11 @@ public function __construct(array $options = array(), $wsdl = 'Rastro.wsdl') */ public function buscaEventos(Correios_Rastro_BuscaEventos $parameters) { - return $this->__soapCall('buscaEventos', array($parameters)); + return $this->__soapCall('buscaEventos', array($parameters)); } /** + * Request method for buscaEventosLista * * @param Correios_Rastro_BuscaEventosLista $parameters Parameters * @@ -70,7 +74,7 @@ public function buscaEventos(Correios_Rastro_BuscaEventos $parameters) */ public function buscaEventosLista(Correios_Rastro_BuscaEventosLista $parameters) { - return $this->__soapCall('buscaEventosLista', array($parameters)); + return $this->__soapCall('buscaEventosLista', array($parameters)); } } diff --git a/app/lib/Correios/Rastro/BuscaEventos.php b/app/lib/Correios/Rastro/BuscaEventos.php index 5455206..b7714c4 100644 --- a/app/lib/Correios/Rastro/BuscaEventos.php +++ b/app/lib/Correios/Rastro/BuscaEventos.php @@ -51,6 +51,7 @@ class Correios_Rastro_BuscaEventos public $objetos = null; /** + * Class constructor method * * @param string $usuario Username * @param string $senha Password diff --git a/app/lib/Correios/Rastro/BuscaEventosLista.php b/app/lib/Correios/Rastro/BuscaEventosLista.php index 2f7c812..c8dd767 100644 --- a/app/lib/Correios/Rastro/BuscaEventosLista.php +++ b/app/lib/Correios/Rastro/BuscaEventosLista.php @@ -51,6 +51,7 @@ class Correios_Rastro_BuscaEventosLista public $objetos = null; /** + * Class constructor method * * @param string $usuario Username * @param string $senha Password diff --git a/app/lib/Correios/Rastro/BuscaEventosListaResponse.php b/app/lib/Correios/Rastro/BuscaEventosListaResponse.php index 2eb494f..eeb4253 100644 --- a/app/lib/Correios/Rastro/BuscaEventosListaResponse.php +++ b/app/lib/Correios/Rastro/BuscaEventosListaResponse.php @@ -21,6 +21,7 @@ class Correios_Rastro_BuscaEventosListaResponse public $return = null; /** + * Class constructor method * * @param Correios_Rastro_Sroxml $return Sroxml Object * diff --git a/app/lib/Correios/Rastro/BuscaEventosResponse.php b/app/lib/Correios/Rastro/BuscaEventosResponse.php index 4ee2cac..57042c5 100644 --- a/app/lib/Correios/Rastro/BuscaEventosResponse.php +++ b/app/lib/Correios/Rastro/BuscaEventosResponse.php @@ -21,6 +21,7 @@ class Correios_Rastro_BuscaEventosResponse public $return = null; /** + * Class constructor method * * @param Correios_Rastro_Sroxml $return Sroxml Object * diff --git a/app/lib/Correios/Rastro/Destinos.php b/app/lib/Correios/Rastro/Destinos.php index 60e6c44..70cbe29 100644 --- a/app/lib/Correios/Rastro/Destinos.php +++ b/app/lib/Correios/Rastro/Destinos.php @@ -45,6 +45,7 @@ class Correios_Rastro_Destinos public $uf = null; /** + * Class constructor method * * @param string $local Local * @param string $codigo Code diff --git a/app/lib/Correios/Rastro/EnderecoMobile.php b/app/lib/Correios/Rastro/EnderecoMobile.php index d09f176..679f879 100644 --- a/app/lib/Correios/Rastro/EnderecoMobile.php +++ b/app/lib/Correios/Rastro/EnderecoMobile.php @@ -81,6 +81,7 @@ class Correios_Rastro_EnderecoMobile public $celular = null; /** + * Class constructor method * * @param string $codigo Code * @param string $cep Zip diff --git a/app/lib/Correios/Rastro/Eventos.php b/app/lib/Correios/Rastro/Eventos.php index 222b46e..a47c0b2 100644 --- a/app/lib/Correios/Rastro/Eventos.php +++ b/app/lib/Correios/Rastro/Eventos.php @@ -123,6 +123,7 @@ class Correios_Rastro_Eventos public $endereco = null; /** + * Class constructor method * * @param string $tipo Type * @param string $status State diff --git a/app/lib/Correios/Rastro/Objeto.php b/app/lib/Correios/Rastro/Objeto.php index fea7cd7..ec0f602 100644 --- a/app/lib/Correios/Rastro/Objeto.php +++ b/app/lib/Correios/Rastro/Objeto.php @@ -51,6 +51,7 @@ class Correios_Rastro_Objeto public $evento = null; /** + * Class constructor method * * @param string $numero Number * @param string $sigla Initials diff --git a/app/lib/Correios/Rastro/Sroxml.php b/app/lib/Correios/Rastro/Sroxml.php index 7a40d04..41eee51 100644 --- a/app/lib/Correios/Rastro/Sroxml.php +++ b/app/lib/Correios/Rastro/Sroxml.php @@ -45,6 +45,7 @@ class Correios_Rastro_Sroxml public $objeto = null; /** + * Class constructor method * * @param string $versao Release * @param string $qtd Quantity From 030a340e6c70de70bd2438f042555dca5162a741 Mon Sep 17 00:00:00 2001 From: Rafael Patro Date: Sat, 27 May 2017 21:11:47 -0300 Subject: [PATCH 6/7] =?UTF-8?q?#266=20Corre=C3=A7=C3=A3o=20do=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/Correios/Rastro/EnderecoMobile.php | 3 +-- app/lib/Correios/Rastro/Eventos.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/lib/Correios/Rastro/EnderecoMobile.php b/app/lib/Correios/Rastro/EnderecoMobile.php index 679f879..3f3bc70 100644 --- a/app/lib/Correios/Rastro/EnderecoMobile.php +++ b/app/lib/Correios/Rastro/EnderecoMobile.php @@ -99,8 +99,7 @@ class Correios_Rastro_EnderecoMobile */ public function __construct( $codigo, $cep, $logradouro, $complemento, $numero, $localidade, $uf, $bairro, $latitude, $longitude, $celular - ) - { + ) { $this->codigo = $codigo; $this->cep = $cep; $this->logradouro = $logradouro; diff --git a/app/lib/Correios/Rastro/Eventos.php b/app/lib/Correios/Rastro/Eventos.php index a47c0b2..8af0e34 100644 --- a/app/lib/Correios/Rastro/Eventos.php +++ b/app/lib/Correios/Rastro/Eventos.php @@ -149,8 +149,7 @@ class Correios_Rastro_Eventos public function __construct( $tipo, $status, $data, $hora, $descricao, $detalhe, $recebedor, $documento, $comentario, $local, $codigo, $cidade, $uf, $sto, $amazoncode, $amazontimezone, $destino, $endereco - ) - { + ) { $this->tipo = $tipo; $this->status = $status; $this->data = $data; From 26257f0525a406bf475e27ec5f9ff47e3f03fe0c Mon Sep 17 00:00:00 2001 From: Rafael Patro Date: Sat, 27 May 2017 22:15:48 -0300 Subject: [PATCH 7/7] =?UTF-8?q?#266=20Corre=C3=A7=C3=A3o=20do=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/Correios/Rastro.php | 4 ++-- app/lib/Correios/Rastro/EnderecoMobile.php | 4 ++-- app/lib/Correios/Rastro/Eventos.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/lib/Correios/Rastro.php b/app/lib/Correios/Rastro.php index 819e82f..c010236 100644 --- a/app/lib/Correios/Rastro.php +++ b/app/lib/Correios/Rastro.php @@ -45,8 +45,8 @@ public function __construct(array $options = array(), $wsdl = 'Rastro.wsdl') $options['classmap'][$key] = $value; } } - - parent::__construct($wsdl, $options); + + parent::__construct($wsdl, $options); } /** diff --git a/app/lib/Correios/Rastro/EnderecoMobile.php b/app/lib/Correios/Rastro/EnderecoMobile.php index 3f3bc70..724e4c1 100644 --- a/app/lib/Correios/Rastro/EnderecoMobile.php +++ b/app/lib/Correios/Rastro/EnderecoMobile.php @@ -98,8 +98,8 @@ class Correios_Rastro_EnderecoMobile * @access public */ public function __construct( - $codigo, $cep, $logradouro, $complemento, $numero, $localidade, $uf, $bairro, $latitude, $longitude, $celular - ) { + $codigo, $cep, $logradouro, $complemento, $numero, $localidade, $uf, $bairro, $latitude, $longitude, $celular) + { $this->codigo = $codigo; $this->cep = $cep; $this->logradouro = $logradouro; diff --git a/app/lib/Correios/Rastro/Eventos.php b/app/lib/Correios/Rastro/Eventos.php index 8af0e34..dd90f49 100644 --- a/app/lib/Correios/Rastro/Eventos.php +++ b/app/lib/Correios/Rastro/Eventos.php @@ -148,8 +148,8 @@ class Correios_Rastro_Eventos */ public function __construct( $tipo, $status, $data, $hora, $descricao, $detalhe, $recebedor, $documento, $comentario, $local, $codigo, - $cidade, $uf, $sto, $amazoncode, $amazontimezone, $destino, $endereco - ) { + $cidade, $uf, $sto, $amazoncode, $amazontimezone, $destino, $endereco) + { $this->tipo = $tipo; $this->status = $status; $this->data = $data;