Adds logging features to the current file
IMPORTANT : Exécute ce workflow étape par étape :
Fichier cible : $ARGUMENTS
LoggableInterface est déjà implémentéePour chaque type-hint de propriété ou paramètre :
LoggableInterface->toLog() dessusSi la classe n'implémente pas encore LoggableInterface :
Ajouter l'import :
use Atournayre\Contracts\Log\LoggableInterface;
Ajouter l'interface à la déclaration de classe :
final class NomClasse implements LoggableInterface
Ajouter la méthode toLog() :
/**
* @return array<string, mixed>
*/
public function toLog(): array
{
return [
// Propriétés clés de l'objet
];
}
Propriétés à inclure :
id (si présent)Propriétés à exclure :
Pour les objets imbriqués :
LoggableInterface : 'relation' => $this->relation->toLog()'relationId' => $this->relation->getId() ou ignorerPour les collections :
/**
* @return array{count: int, items: array<int, array<string, mixed>>}
*/
public function toLog(): array
{
return [
'count' => $this->count(),
'items' => array_map(fn ($item) => $item->toLog(), $this->items),
];
}
@return array<string, mixed> sur la méthodeuse Atournayre\Contracts\Log\LoggableInterface;
final class Commande implements LoggableInterface
{
private Uuid $id;
private string $reference;
private Client $client;
private \DateTimeImmutable $createdAt;
private string $password; // Sensible, à exclure
/**
* @return array<string, mixed>
*/
public function toLog(): array
{
return [
'id' => $this->id->toRfc4122(),
'reference' => $this->reference,
'client' => $this->client->toLog(),
'createdAt' => $this->createdAt->format('c'),
// password exclu intentionnellement
];
}
}
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer