refactor: add a TemplateFile DTO

Add a data transfer object that stores the source file name, the file
name to generate and an optional path to create for each file to
generate.

As I'm using a `readonly` class for the DTO, this required updating PHP
to 8.2.

nix develop --command php bin/build-configs run
This commit is contained in:
Oliver Davies 2023-04-20 22:31:14 +01:00
parent bd3e77254b
commit ac1e0dc2c8
3 changed files with 70 additions and 38 deletions

View file

@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace OliverDaviesLtd\BuildConfigs\DataTransferObject;
readonly final class TemplateFile
{
public function __construct(
public string $data,
public string $name,
public string|null $path = null,
) {
}
}