SynchronizeResult

Class
Final: Yes

Result object for packaged directory synchronization operations.

Description

This value object tracks the outcome of a synchronization run by recording which links were created, which existing links or directories were preserved, and which broken links were removed before recreation. It also carries a failure flag so callers can distinguish successful runs from aborted or invalid synchronization attempts.

Table of Contents

Properties

$createdLinks

Stores the entry names for symlinks created during synchronization.

 : array<int, string>
$failed

Indicates whether the synchronization process encountered a fatal failure.

 : bool
$preservedLinks

Stores the entry names that were already valid and therefore preserved.

 : array<int, string>
$removedBrokenLinks

Stores the entry names for broken links removed during repair.

 : array<int, string>

Methods

addCreatedLink()

Records the name of a link that was newly created.

 : void
addPreservedLink()

Records the name of an entry that was preserved as-is.

 : void
addRemovedBrokenLink()

Records the name of a broken link that was removed before recreation.

 : void
failed()

Indicates whether the synchronization result represents a failed run.

 : bool
getCreatedLinks()

Returns the names of links created during synchronization.

 : array<int, string>
getPreservedLinks()

Returns the names of links or directories preserved during synchronization.

 : array<int, string>
getRemovedBrokenLinks()

Returns the names of broken links removed during synchronization repair.

 : array<int, string>
markFailed()

Marks the synchronization as failed.

 : void
Properties
Private

Stores the entry names for symlinks created during synchronization.

private array<int, string> $createdLinks = []

$failed

Private

Indicates whether the synchronization process encountered a fatal failure.

private bool $failed = false
Private

Stores the entry names that were already valid and therefore preserved.

private array<int, string> $preservedLinks = []
Private

Stores the entry names for broken links removed during repair.

private array<int, string> $removedBrokenLinks = []
Methods
Public

Records the name of a link that was newly created.

public addCreatedLink( string  $link) : void
Parameters
$link : string

Description

Entry name identifying the created link

Public

Records the name of an entry that was preserved as-is.

public addPreservedLink( string  $link) : void
Parameters
$link : string

Description

Entry name identifying the preserved link or directory

Public

Records the name of a broken link that was removed before recreation.

public addRemovedBrokenLink( string  $link) : void
Parameters
$link : string

Description

Entry name identifying the repaired broken link

failed()

Public

Indicates whether the synchronization result represents a failed run.

public failed() : bool
Return values
bool
Public

Returns the names of links created during synchronization.

public getCreatedLinks() : array<int, string>
Return values
array<int, string>
Public

Returns the names of links or directories preserved during synchronization.

public getPreservedLinks() : array<int, string>
Return values
array<int, string>
Public

Returns the names of broken links removed during synchronization repair.

public getRemovedBrokenLinks() : array<int, string>
Return values
array<int, string>

markFailed()

Public

Marks the synchronization as failed.

public markFailed() : void

Description

Callers SHOULD use this when a precondition or runtime error prevents the synchronization result from being considered successful.