TypeError on City class
koficoud opened this issue · 0 comments
koficoud commented
Message: Aftab\Sepomex\Entities\City::__construct(): Argument #1 ($id) must be of type int, null given.
PHP: 8.1
Laravel: Laravel Framework 8.83.13
How reproduce?
/**
* Get data by zip code.
*
* @param SepomexContract $sepomex
* @param string $postal
* @return array
*/
public function postal(SepomexContract $sepomex, string $postal): array
{
return $sepomex->getByPostal($postal); // '50360'
}