Last active
December 10, 2021 21:38
-
-
Save kastaneda/11f7fd07e0db50c71ccf759469d88f20 to your computer and use it in GitHub Desktop.
Ви коли-небудь замислювались, як звичний нам код зі звичайними англійськими іменами виглядає для English native speakers?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
class ФізичнаОсоба | |
{ | |
public function __construct( | |
public readonly string $іменування, | |
public readonly ?DateTimeInterface $датаНародження = null, | |
public readonly ?ПоштоваАдреса $адреса = null, | |
) { } | |
} | |
class ПоштоваАдреса | |
{ | |
public function __construct( | |
public readonly string $адреса, | |
public readonly Країна $країна, | |
public readonly ?string $поштовийІндекс = null, | |
public readonly ?string $населенийПункт = null, | |
public readonly ?string $регіон = null, | |
public readonly ?string $район = null, | |
) { } | |
} | |
enum Країна: string | |
{ | |
case Україна = 'UA'; | |
case ВеликаБританія = 'UK'; | |
case Нідерланди = 'NL'; | |
case Німеччина = 'DE'; | |
case Польща = 'PL'; | |
case Чехія = 'CZ'; | |
} | |
$цеТипуЯ = new ФізичнаОсоба( | |
'Дмитро', | |
new DateTimeImmutable('1980-09-06 Europe/Kiev'), | |
new ПоштоваАдреса( | |
'вулиця, будинок, квартира', | |
Країна::Україна, | |
населенийПункт: 'Київ', | |
), | |
); | |
echo '<pre>'; | |
print_r($цеТипуЯ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment