<?php
namespace Core\Bundle\Service\Property\Room\Rooms;
class CountryMapping
{
const CZ = 'CZ';
const EN = 'EN';
public function get(string $countryIsoCode = null) : string // Works correctly if return type is removed
{
switch (strtoupper($countryIsoCode)) {
case 'CZ':
case 'SK':
return self::CZ; // Works correctly if changed to CountryMapping::CZ
default:
return self::EN; // Works correctly if changed to CountryMapping::EN
}
}
}
$mapping = new CountryMapping();
var_dump($mapping->get('CZ'));
Deprecated: Core\Bundle\Service\Property\Room\Rooms\CountryMapping::get(): Implicitly marking parameter $countryIsoCode as nullable is deprecated, the explicit nullable type must be used instead in /in/Ju5dp on line 9
string(2) "CZ"