for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace TalisOrm;
use RuntimeException;
final class ConcurrentUpdateOccurred extends RuntimeException
{
public static function ofEntity(Entity $entity): ConcurrentUpdateOccurred
return new self(sprintf(
'A concurrent update occurred of an entity of type "%s" with identifier: %s',
get_class($entity),
self::renderIdentifier($entity->identifier())
));
}
/**
* @param array<string, mixed> $identifier
*/
private static function renderIdentifier(array $identifier): string
$parts = [];
foreach ($identifier as $columnName => $value) {
$parts[] = $columnName . ' = ' . var_export($value, true);
return implode(', ', $parts);