Skip to content

Instantly share code, notes, and snippets.

@the-toster
the-toster / HydrateVisitor.php
Created June 2, 2024 19:20
Набросок гидратора на 0.4 версии
<?php
declare(strict_types=1);
namespace App\Infrastructure\Hdrtr;
use Typhoon\DeclarationId\AliasId;
use Typhoon\DeclarationId\ClassId;
use Typhoon\DeclarationId\ConstantId;
use Typhoon\DeclarationId\NamedClassId;
@the-toster
the-toster / HydrateVisitor.php
Created June 2, 2024 16:49
Первая версия (на 0.3), проходила тесты, но не псалм
<?php
declare(strict_types=1);
namespace App\Infrastructure\Hdrtr;
use Typhoon\Reflection\TyphoonReflector;
use Typhoon\Type\Argument;
use Typhoon\Type\AtClass;
use Typhoon\Type\AtFunction;
@the-toster
the-toster / enumByName.php
Created February 9, 2022 08:11
Instantiate eunm by name
<?php
function enumByName(string $enumClass, string $case): object {
return (new \ReflectionEnum($enumClass))->getCase($case)->getValue();
}
@the-toster
the-toster / docker-compose.yml
Created December 29, 2021 16:36
docker-compose replicas minimum example
version: '3'
services:
publisher_app:
image: nginx
ports:
- "8080-8081:80"
environment:
server.port: 8080
deploy:
mode: replicated