src/State/ExecutionLog/ExecutionLog.php
Avoid too many return
statements within this method. Open
Open
case WorkflowState::STAGE_AFTER: return 'After';
Avoid too many return
statements within this method. Open
Open
case WorkflowState::STAGE_ON_SUCCESS: return 'On Success';
Avoid too many return
statements within this method. Open
Open
case WorkflowState::STAGE_ON_ERROR: return 'On Error';
Avoid too many return
statements within this method. Open
Open
case WorkflowState::STAGE_SUMMARY: return 'Summary';
The method addWarning has a boolean flag argument $workflowReportWarning, which is a certain sign of a Single Responsibility Principle violation. Open
Open
public function addWarning(string $message, bool $workflowReportWarning = false): void
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST)
Open
Open
private array $stages = [];
- Exclude checks
Avoid excessively long variable names like $workflowReportWarning. Keep variable name length under 20. Open
Open
public function addWarning(string $message, bool $workflowReportWarning = false): void
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
The CASE body must start on the line following the statement Open
Open
case WorkflowState::STAGE_SUMMARY: return 'Summary';
- Exclude checks
The CASE body must start on the line following the statement Open
Open
case WorkflowState::STAGE_AFTER: return 'After';
- Exclude checks
The CASE body must start on the line following the statement Open
Open
case WorkflowState::STAGE_ON_SUCCESS: return 'On Success';
- Exclude checks
Terminating statement must be on a line by itself Open
Open
case WorkflowState::STAGE_PROCESS: return 'Process';
- Exclude checks
The CASE body must start on the line following the statement Open
Open
case WorkflowState::STAGE_PREPARE: return 'Prepare';
- Exclude checks
Terminating statement must be on a line by itself Open
Open
case WorkflowState::STAGE_ON_SUCCESS: return 'On Success';
- Exclude checks
Terminating statement must be on a line by itself Open
Open
case WorkflowState::STAGE_SUMMARY: return 'Summary';
- Exclude checks
The CASE body must start on the line following the statement Open
Open
case WorkflowState::STAGE_VALIDATE: return 'Validate';
- Exclude checks
Terminating statement must be on a line by itself Open
Open
case WorkflowState::STAGE_VALIDATE: return 'Validate';
- Exclude checks
The CASE body must start on the line following the statement Open
Open
case WorkflowState::STAGE_BEFORE: return 'Before';
- Exclude checks
Terminating statement must be on a line by itself Open
Open
case WorkflowState::STAGE_AFTER: return 'After';
- Exclude checks
Terminating statement must be on a line by itself Open
Open
case WorkflowState::STAGE_ON_ERROR: return 'On Error';
- Exclude checks
Terminating statement must be on a line by itself Open
Open
case WorkflowState::STAGE_PREPARE: return 'Prepare';
- Exclude checks
Terminating statement must be on a line by itself Open
Open
case WorkflowState::STAGE_BEFORE: return 'Before';
- Exclude checks
The CASE body must start on the line following the statement Open
Open
case WorkflowState::STAGE_PROCESS: return 'Process';
- Exclude checks
The CASE body must start on the line following the statement Open
Open
case WorkflowState::STAGE_ON_ERROR: return 'On Error';
- Exclude checks
Closing brace must be on a line by itself Open
Open
case WorkflowState::STAGE_ON_SUCCESS: return 'On Success';
- Exclude checks
Closing brace must be on a line by itself Open
Open
case WorkflowState::STAGE_ON_ERROR: return 'On Error';
- Exclude checks
Space before opening parenthesis of function call prohibited Open
Open
fn (string $warning): string =>
- Exclude checks
Closing brace must be on a line by itself Open
Open
case WorkflowState::STAGE_PROCESS: return 'Process';
- Exclude checks
Closing brace must be on a line by itself Open
Open
case WorkflowState::STAGE_SUMMARY: return 'Summary';
- Exclude checks
Closing brace must be on a line by itself Open
Open
case WorkflowState::STAGE_BEFORE: return 'Before';
- Exclude checks
Multi-line function call not indented correctly; expected 24 spaces but found 28 Open
Open
sprintf(PHP_EOL . ' %s: %s', self::mapStage($stage), $warning),
- Exclude checks
Closing brace must be on a line by itself Open
Open
case WorkflowState::STAGE_PREPARE: return 'Prepare';
- Exclude checks
Closing brace must be on a line by itself Open
Open
case WorkflowState::STAGE_VALIDATE: return 'Validate';
- Exclude checks
Opening brace should be on a new line Open
Open
public function addStep(int $stage, Describable $step, string $state, ?string $reason): void {
- Exclude checks
Closing brace must be on a line by itself Open
Open
case WorkflowState::STAGE_AFTER: return 'After';
- Exclude checks