/** * @param string $uf * @throws EnderecoInvalidoException */ protected function validaUf($uf) { if (Uf::getUfPorCep($this->cep) !== $uf) { throw new EnderecoInvalidoException('O CEP ' . $this->cep . ' não pertence ao estado ' . $uf . '.'); } }
/** * @param Uf $uf * @return string[] */ protected function limitePorEstado(Uf $uf) { $limites = $this->limitesEstados(); return $limites[$uf->getUf()]; }