Génère classe Out (DTO immuable pour output)
Inherits all available tools
Additional assets for this skill
This skill inherits all available tools. When active, it can use any tool Claude has access to.
README.mdtemplates/Out/UtilisateurOut.phpGénère une classe Out (Data Transfer Object) immuable pour représenter les données de sortie d'une entité.
La classe Out est un DTO readonly qui encapsule une entité pour l'exposition vers l'extérieur (API, vues, etc.).
Use skill framework:make:out
Vous serez invité à fournir :
- Le nom de l'entité (ex: Product, User, Order)
Out/UtilisateurOut.php - Template de classe Outsrc/Entity/{EntityName}.phpsrc/Out/{EntityName}Out.phpsrc/Entity/{EntityName}.php
{EntityName} par le nom fourni{entityName} par la version camelCasefinal readonlynew() pour instanciationUse skill framework:make:out
# Saisies utilisateur :
EntityName: Product
# Résultat :
✓ src/Out/ProductOut.php
Fichier généré :
<?php
declare(strict_types=1);
namespace App\Out;
use App\Entity\Product;
final readonly class ProductOut
{
private function __construct(
private Product $product,
) {
}
public static function new(
Product $product,
): self {
return new self(
product: $product,
);
}
}
L'entité doit implémenter la méthode out() :
public function out(): ProductOut
{
return ProductOut::new(
product: $this,
);
}