<?php
/**
 * Target lock contention.
 *
 * @package ScheduledChanges
 */

namespace ScheduledChanges\Lock;

/**
 * Raised when another unexpired owner holds a required target lock.
 */
final class LockContentionException extends \RuntimeException {
	private string $targetReference;
	public function __construct( string $targetReference ) {
		$this->targetReference = $targetReference;
		parent::__construct( 'Target is locked by another execution: ' . $targetReference );
	}

	public function targetReference(): string {
		return $this->targetReference;
	}
}
