MOON
Server: Apache
System: Linux server1.studioinfinity.com.br 2.6.32-954.3.5.lve1.4.90.el6.x86_64 #1 SMP Tue Feb 21 12:26:30 UTC 2023 x86_64
User: artinside (517)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/artinside/public_html/finance/vendor/frenet/frenet-php/src/Command/Postcode/Address.php
<?php

declare(strict_types = 1);

namespace Frenet\Command\Postcode;

use Frenet\Command\CommandAbstract;

/**
 * Class Address
 * @package Frenet\Command\Postcode
 */
class Address extends CommandAbstract implements AddressInterface
{
    /**
     * {@inheritdoc}
     */
    protected $urlPath = 'CEP/Address';
    
    /**
     * {@inheritdoc}
     */
    protected $requestMethod = self::REQUEST_METHOD_GET;
    
    /**
     * @var \Frenet\Model\Normalizer\PostcodeNormalizer
     */
    private $postcodeNormalizer;
    
    public function __construct(
        \Frenet\Service\ConnectionInterface $connection,
        \Frenet\Framework\Data\SerializerInterface $serializer,
        \Frenet\ObjectType\Entity\Postcode\AddressFactory $typeFactory,
        \Frenet\Model\Normalizer\PostcodeNormalizer $postcodeNormalizer
    ) {
        parent::__construct($connection, $serializer, $typeFactory);
        $this->postcodeNormalizer = $postcodeNormalizer;
    }
    
    /**
     * {@inheritdoc}
     */
    public function setPostcode($postcode)
    {
        $this->setData('postcode', $postcode);
        return $this;
    }
    
    /**
     * {@inheritdoc}
     */
    public function getPostcode()
    {
        return $this->getData('postcode');
    }
    
    /**
     * {@inheritdoc}
     */
    public function getUrlPath()
    {
        return parent::getUrlPath() . '/' . $this->postcodeNormalizer->normalize($this->getPostcode());
    }
}