dolibarr 25.0.0-alpha
SyncReport Class Reference

Immutable outcome of a permissions sync run. More...

Public Member Functions

 __construct (int $updatedLines=0, int $skipped=0, array $conflicts=array(), array $warnings=array())
 
 hasConflicts ()
 Whether a blocking problem prevented the write.
 
 hasWarnings ()
 Whether something was normalized while still writing.
 
 isNoop ()
 Whether the sync produced no permission line.
 
 toLegacyReturnCode ()
 Map the report onto the historical reWriteAllPermissions() return code.
 

Detailed Description

Immutable outcome of a permissions sync run.

Conflicts and warnings are two distinct severities and must not be merged: a non-empty $conflicts means NO write was performed, while $warnings means the write was performed and something was normalized on the way.

Definition at line 31 of file SyncReport.class.php.

Constructor & Destructor Documentation

◆ __construct()

SyncReport::__construct ( int $updatedLines = 0,
int $skipped = 0,
array $conflicts = array(),
array $warnings = array() )
Parameters
int$updatedLinesNumber of lines written into the permissions block
int$skippedNumber of operations deliberately skipped
string[]$conflictsBlocking problems, in plain English
string[]$warningsNon-blocking problems, in plain English

Definition at line 51 of file SyncReport.class.php.

Member Function Documentation

◆ hasConflicts()

SyncReport::hasConflicts ( )

Whether a blocking problem prevented the write.

Returns
bool True when no write was performed

Definition at line 64 of file SyncReport.class.php.

Referenced by toLegacyReturnCode().

◆ hasWarnings()

SyncReport::hasWarnings ( )

Whether something was normalized while still writing.

Returns
bool True when the write happened but something was adjusted

Definition at line 74 of file SyncReport.class.php.

◆ isNoop()

SyncReport::isNoop ( )

Whether the sync produced no permission line.

This is not the same as "the file was left untouched": removing the last right of a module writes an empty block, which changes the file while producing zero lines.

Returns
bool True when no permission line was written

Definition at line 87 of file SyncReport.class.php.

◆ toLegacyReturnCode()

SyncReport::toLegacyReturnCode ( )

Map the report onto the historical reWriteAllPermissions() return code.

Returns
int<-1,1> 1 if OK, -1 if KO

Definition at line 97 of file SyncReport.class.php.

References hasConflicts().


The documentation for this class was generated from the following file: