EntityType.php
- Pfad:
src/Domain/ValueObject/EntityType.php - Namespace: Domain\ValueObject
- Zeilen: 79 | Größe: 1,972 Bytes
- Geändert: 2025-12-25 10:43:37 | Gescannt: 2025-12-31 10:22:15
Code Hygiene Score: 100
- Dependencies: 100 (25%)
- LOC: 100 (20%)
- Methods: 100 (20%)
- Secrets: 100 (15%)
- Classes: 100 (10%)
- Magic Numbers: 100 (10%)
Keine Issues gefunden.
Klassen 1
-
EntityTypeenum Zeile 9
Funktionen 4
-
label()public Zeile 23 -
icon()public Zeile 40 -
colorClass()public Zeile 57 -
isPrimary()public Zeile 74
Code
<?php
declare(strict_types=1);
namespace Domain\ValueObject;
// @responsibility: Entity-Typ-Enum für Wissensgraph-Entitäten
enum EntityType: string
{
case PERSON = 'PERSON';
case ORGANIZATION = 'ORGANIZATION';
case LOCATION = 'LOCATION';
case CONCEPT = 'CONCEPT';
case METHOD = 'METHOD';
case TOOL = 'TOOL';
case EVENT = 'EVENT';
case OTHER = 'OTHER';
/**
* Get human-readable label.
*/
public function label(): string
{
return match ($this) {
self::PERSON => 'Person',
self::ORGANIZATION => 'Organisation',
self::LOCATION => 'Ort',
self::CONCEPT => 'Konzept',
self::METHOD => 'Methode',
self::TOOL => 'Werkzeug',
self::EVENT => 'Ereignis',
self::OTHER => 'Sonstiges',
};
}
/**
* Get icon for display.
*/
public function icon(): string
{
return match ($this) {
self::PERSON => 'user',
self::ORGANIZATION => 'building',
self::LOCATION => 'map-pin',
self::CONCEPT => 'lightbulb',
self::METHOD => 'clipboard-list',
self::TOOL => 'wrench',
self::EVENT => 'calendar',
self::OTHER => 'box',
};
}
/**
* Get CSS color class.
*/
public function colorClass(): string
{
return match ($this) {
self::PERSON => 'blue',
self::ORGANIZATION => 'purple',
self::LOCATION => 'green',
self::CONCEPT => 'yellow',
self::METHOD => 'orange',
self::TOOL => 'gray',
self::EVENT => 'red',
self::OTHER => 'slate',
};
}
/**
* Check if this is a primary entity type (commonly extracted).
*/
public function isPrimary(): bool
{
return in_array($this, [self::PERSON, self::ORGANIZATION, self::CONCEPT], true);
}
}