Documentation

IssueBuffer
in package

FinalYes

Table of Contents

Properties

$console_issues  : array<int, array<string|int, mixed>>
$emitted  : array<string, bool>
$error_count  : int
$fixable_issue_counts  : array<string, int>
$issues_data  : array<string, array<int, IssueData>>
$recorded_issues  : array<int, array<int, CodeIssue>>
$recording_level  : int
$server  : array<string|int, mixed>
$unused_suppressions  : array<string, array<int, int>>
$used_suppressions  : array<string, array<int, bool>>

Methods

accepts()  : bool
This will add an issue to be emitted if it's not suppressed and return if it has been added
add()  : bool
Add an issue to be emitted. This method should normally not be used! Use IssueBuffer::maybeAdd instead.
addFixableIssue()  : void
addFixableIssues()  : void
addIssues()  : void
addUnusedSuppression()  : void
This is part of the findUnusedPsalmSuppress feature
addUnusedSuppressions()  : void
addUsedSuppressions()  : void
alreadyEmitted()  : bool
bubbleUp()  : void
This will try to add issues that has been retrieved through clearRecordingLevel or record them at a lower level
clear()  : array<string, array<int, IssueData>>
clearCache()  : void
clearRecordingLevel()  : array<int, CodeIssue>
This will return the recorded issues for the current recording level
finish()  : void
getErrorCount()  : int
getFixableIssues()  : array<string, int>
getIssuesData()  : array<string, array<int, IssueData>>
getIssuesDataForFile()  : array<int, IssueData>
getOutput()  : string
getUnusedSuppressions()  : array<string, array<int, int>>
getUsedSuppressions()  : array<string, array<int, bool>>
isRecording()  : bool
Return whether or not we're in a recording state regarding startRecording/stopRecording status
isSuppressed()  : bool
This will return false if an issue is ready to be added for emission. Reasons for not returning false include: - The issue is suppressed in config - We're in a recording state - The issue is included in the list of issues to be suppressed in param
maybeAdd()  : void
This will add an issue to be emitted if it's not suppressed
printSuccessMessage()  : void
processUnusedSuppressions()  : void
remove()  : void
This will try to remove an issue that has been added for emission
startRecording()  : void
Increase the recording level in order to start recording issues instead of adding them while in a loop
stopRecording()  : void
Decrease the recording level after leaving a loop
removeRecordedIssue()  : void

Properties

$console_issues

private static array<int, array<string|int, mixed>> $console_issues = []

$emitted

private static array<string, bool> $emitted = []

$fixable_issue_counts

private static array<string, int> $fixable_issue_counts = []

$issues_data

private static array<string, array<int, IssueData>> $issues_data = []

$recording_level

private static int $recording_level = 0

$server

private static array<string|int, mixed> $server = []

$unused_suppressions

private static array<string, array<int, int>> $unused_suppressions = []

$used_suppressions

private static array<string, array<int, bool>> $used_suppressions = []

Methods

accepts()

This will add an issue to be emitted if it's not suppressed and return if it has been added

public static accepts(CodeIssue $e[, array<string|int, string> $suppressed_issues = [] ][, bool $is_fixable = false ]) : bool
Parameters
$e : CodeIssue
$suppressed_issues : array<string|int, string> = []
$is_fixable : bool = false
Return values
bool

add()

Add an issue to be emitted. This method should normally not be used! Use IssueBuffer::maybeAdd instead.

public static add(CodeIssue $e[, bool $is_fixable = false ]) : bool
Parameters
$e : CodeIssue
$is_fixable : bool = false
Tags
psalm-internal

Psalm\IssueBuffer

psalm-internal

Psalm\Type\Reconciler::getValueForKey

throws
CodeException
Return values
bool

addFixableIssue()

public static addFixableIssue(string $issue_type) : void
Parameters
$issue_type : string

addFixableIssues()

public static addFixableIssues(array<string, int> $fixable_issue_counts) : void
Parameters
$fixable_issue_counts : array<string, int>

addIssues()

public static addIssues(array<string, array<int, IssueData>> $issues_data) : void
Parameters
$issues_data : array<string, array<int, IssueData>>

addUnusedSuppression()

This is part of the findUnusedPsalmSuppress feature

public static addUnusedSuppression(string $file_path, int $offset, string $issue_type) : void
Parameters
$file_path : string
$offset : int
$issue_type : string

addUnusedSuppressions()

public static addUnusedSuppressions(array<string, array<int, int>> $unused_suppressions) : void
Parameters
$unused_suppressions : array<string, array<int, int>>

addUsedSuppressions()

public static addUsedSuppressions(array<string, array<int, bool>> $used_suppressions) : void
Parameters
$used_suppressions : array<string, array<int, bool>>

alreadyEmitted()

public static alreadyEmitted(string $message) : bool
Parameters
$message : string
Return values
bool

bubbleUp()

This will try to add issues that has been retrieved through clearRecordingLevel or record them at a lower level

public static bubbleUp(CodeIssue $e) : void
Parameters
$e : CodeIssue

clear()

public static clear() : array<string, array<int, IssueData>>
Return values
array<string, array<int, IssueData>>

clearRecordingLevel()

This will return the recorded issues for the current recording level

public static clearRecordingLevel() : array<int, CodeIssue>
Return values
array<int, CodeIssue>

finish()

public static finish(ProjectAnalyzer $project_analyzer, bool $is_full, float $start_time[, bool $add_stats = false ][, array<string, array<string, array{o: int, s: array}>> $issue_baseline = [] ]) : void
Parameters
$project_analyzer : ProjectAnalyzer
$is_full : bool
$start_time : float
$add_stats : bool = false
$issue_baseline : array<string, array<string, array{o: int, s: array}>> = []

getErrorCount()

public static getErrorCount() : int
Return values
int

getFixableIssues()

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

getIssuesData()

public static getIssuesData() : array<string, array<int, IssueData>>
Return values
array<string, array<int, IssueData>>

getIssuesDataForFile()

public static getIssuesDataForFile(string $file_path) : array<int, IssueData>
Parameters
$file_path : string
Return values
array<int, IssueData>

getOutput()

public static getOutput(array<string, array<int, IssueData>> $issues_data, ReportOptions $report_options[, array{int, int} $mixed_counts = [0, 0] ]) : string
Parameters
$issues_data : array<string, array<int, IssueData>>
$report_options : ReportOptions
$mixed_counts : array{int, int} = [0, 0]
Return values
string

getUnusedSuppressions()

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

getUsedSuppressions()

public static getUsedSuppressions() : array<string, array<int, bool>>
Return values
array<string, array<int, bool>>

isRecording()

Return whether or not we're in a recording state regarding startRecording/stopRecording status

public static isRecording() : bool
Return values
bool

isSuppressed()

This will return false if an issue is ready to be added for emission. Reasons for not returning false include: - The issue is suppressed in config - We're in a recording state - The issue is included in the list of issues to be suppressed in param

public static isSuppressed(CodeIssue $e[, array<string|int, string> $suppressed_issues = [] ]) : bool
Parameters
$e : CodeIssue
$suppressed_issues : array<string|int, string> = []
Return values
bool

maybeAdd()

This will add an issue to be emitted if it's not suppressed

public static maybeAdd(CodeIssue $e[, array<string|int, string> $suppressed_issues = [] ][, bool $is_fixable = false ]) : void
Parameters
$e : CodeIssue
$suppressed_issues : array<string|int, string> = []
$is_fixable : bool = false

printSuccessMessage()

public static printSuccessMessage(ProjectAnalyzer $project_analyzer) : void
Parameters
$project_analyzer : ProjectAnalyzer

processUnusedSuppressions()

public static processUnusedSuppressions(FileProvider $file_provider) : void
Parameters
$file_provider : FileProvider

remove()

This will try to remove an issue that has been added for emission

public static remove(string $file_path, string $issue_type, int $file_offset) : void
Parameters
$file_path : string
$issue_type : string
$file_offset : int

startRecording()

Increase the recording level in order to start recording issues instead of adding them while in a loop

public static startRecording() : void

stopRecording()

Decrease the recording level after leaving a loop

public static stopRecording() : void
Tags
see
startRecording

removeRecordedIssue()

private static removeRecordedIssue(string $issue_type, int $file_offset) : void
Parameters
$issue_type : string
$file_offset : int

        
On this page

Search results