Notifysend
in package
implements
Report
Interfaces, Classes and Traits
Table of Contents
- $path : string
- Path to notify-send command.
- $showOk : bool
- Show "ok, all fine" messages.
- $timeout : int
- Notification timeout in milliseconds.
- $version : string
- Version of installed notify-send executable.
- __construct() : mixed
- Load configuration data.
- generate() : void
- Generates a summary of errors and warnings for each file processed.
- generateFileReport() : bool
- Generate a partial report for a single processed file.
- generateMessage() : string
- Generate the error message to show to the user.
- getBasicCommand() : string
- Generate and return the basic notify-send command string to execute.
- notifyAllFine() : void
- Tell the user that all is fine and no error/warning has been found.
- notifyErrors() : void
- Tell the user that errors/warnings have been found.
Properties
$path
Path to notify-send command.
protected
string
$path
= 'notify-send'
$showOk
Show "ok, all fine" messages.
protected
bool
$showOk
= true
$timeout
Notification timeout in milliseconds.
protected
int
$timeout
= 3000
$version
Version of installed notify-send executable.
protected
string
$version
= null
Methods
__construct()
Load configuration data.
public
__construct() : mixed
Return values
mixed —generate()
Generates a summary of errors and warnings for each file processed.
public
generate(string $cachedData, int $totalFiles, int $totalErrors, int $totalWarnings, int $totalFixable[, bool $showSources = false ][, int $width = 80 ][, bool $interactive = false ][, bool $toScreen = true ]) : void
Parameters
- $cachedData : string
-
Any partial report data that was returned from generateFileReport during the run.
- $totalFiles : int
-
Total number of files processed during the run.
- $totalErrors : int
-
Total number of errors found during the run.
- $totalWarnings : int
-
Total number of warnings found during the run.
- $totalFixable : int
-
Total number of problems that can be fixed.
- $showSources : bool = false
-
Show sources?
- $width : int = 80
-
Maximum allowed line width.
- $interactive : bool = false
-
Are we running in interactive mode?
- $toScreen : bool = true
-
Is the report being printed to screen?
Return values
void —generateFileReport()
Generate a partial report for a single processed file.
public
generateFileReport(array<string|int, mixed> $report, File $phpcsFile[, bool $showSources = false ][, int $width = 80 ]) : bool
Function should return TRUE if it printed or stored data about the file and FALSE if it ignored the file. Returning TRUE indicates that the file and its data should be counted in the grand totals.
Parameters
- $report : array<string|int, mixed>
-
Prepared report data.
- $phpcsFile : File
-
The file being reported on.
- $showSources : bool = false
-
Show sources?
- $width : int = 80
-
Maximum allowed line width.
Return values
bool —generateMessage()
Generate the error message to show to the user.
protected
generateMessage(array<string|int, string> $checkedFiles, int $totalErrors, int $totalWarnings) : string
Parameters
- $checkedFiles : array<string|int, string>
-
The files checked during the run.
- $totalErrors : int
-
Total number of errors found during the run.
- $totalWarnings : int
-
Total number of warnings found during the run.
Return values
string —Error message or NULL if no error/warning found.
getBasicCommand()
Generate and return the basic notify-send command string to execute.
protected
getBasicCommand() : string
Return values
string —Shell command with common parameters.
notifyAllFine()
Tell the user that all is fine and no error/warning has been found.
protected
notifyAllFine() : void
Return values
void —notifyErrors()
Tell the user that errors/warnings have been found.
protected
notifyErrors(string $msg) : void
Parameters
- $msg : string
-
Message to display.