fix: DockerSecretsResolver - don't normalize absolute paths like /var/www/html/...
Some checks failed
Deploy Application / deploy (push) Has been cancelled
Some checks failed
Deploy Application / deploy (push) Has been cancelled
This commit is contained in:
@@ -135,6 +135,36 @@ final class EventStore
|
||||
- **Use Cases**: Validation beim Setzen, Lazy Loading, Cache Invalidation
|
||||
- **private(set)** für kontrollierte Array-Mutation in mutable Klassen
|
||||
|
||||
**Clone With Syntax (PHP 8.5)**:
|
||||
- ✅ **Verwenden für State-Transformationen** - Reduziert Boilerplate-Code erheblich
|
||||
- ✅ **Syntax**: `clone($object, ['property' => $value])` - Funktioniert perfekt mit `readonly` Klassen
|
||||
- ✅ **Best Practice**: Für einfache und mittlere Transformationen verwenden
|
||||
- ⚠️ **Komplexe Array-Manipulationen**: Können explizit bleiben, wenn lesbarer
|
||||
|
||||
```php
|
||||
// ✅ Clone With für einfache Transformationen
|
||||
public function withCount(int $count): self
|
||||
{
|
||||
return clone($this, ['count' => $count]);
|
||||
}
|
||||
|
||||
// ✅ Clone With für mehrere Properties
|
||||
public function increment(): self
|
||||
{
|
||||
return clone($this, [
|
||||
'count' => $this->count + 1,
|
||||
'lastUpdate' => date('H:i:s')
|
||||
]);
|
||||
}
|
||||
|
||||
// ⚠️ Komplexe Transformationen können explizit bleiben
|
||||
public function withTodoRemoved(string $todoId): self
|
||||
{
|
||||
$newTodos = array_filter($this->todos, fn($todo) => $todo['id'] !== $todoId);
|
||||
return clone($this, ['todos' => array_values($newTodos)]);
|
||||
}
|
||||
```
|
||||
|
||||
## Value Objects over Primitives
|
||||
|
||||
**Verwende Value Objects statt Arrays oder Primitives**:
|
||||
|
||||
Reference in New Issue
Block a user