node; } /** * Returns the lock owner type. * * @return ILock::TYPE_* * @since 24.0.0 */ public function getType(): int { return $this->type; } /** * Returns the owner identifier for the current lock type. * * For example, this may be a user id, app id, or lock token. * * @since 24.0.0 */ public function getOwner(): string { return $this->owner; } /** * Returns a human-readable representation for logging and debugging. * * Not guaranteed to be a stable machine-readable contract. * * @since 24.0.0 */ public function __toString(): string { $typeString = match ($this->type) { ILock::TYPE_USER => 'ILock::TYPE_USER', ILock::TYPE_APP => 'ILock::TYPE_APP', ILock::TYPE_TOKEN => 'ILock::TYPE_TOKEN', default => 'unknown', }; return sprintf('%s %s %d', $typeString, $this->owner, $this->node->getId()); } }