Showing 116 of 116 total issues
Opening brace should be on a new line 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
case WorkflowState::STAGE_AFTER: return 'After';
- Exclude checks
syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST)
Open
private array $validationErrors;
- Exclude checks
syntax error, unexpected 'Describable' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
Open
private Describable $step;
- Exclude checks
syntax error, unexpected 'bool' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
Open
private bool $success;
- Exclude checks
syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)
Open
private ?Exception $processException = null;
- Exclude checks
Replace this function name "process" with "__construct". Open
public function process(WorkflowStep $step): self
- Read upRead up
- Exclude checks
In PHP 4, any function with the same name as the nesting class was considered a class constructor. In PHP 5, this mechanism has been deprecated and the "__construct" method name should be used instead. If both styles are present in the same class, PHP 5 will treat the function named "__construct" as the class constructor.
This rule rule raises an issue for each method with the same name as the enclosing class.
Noncompliant Code Example
class Foo { function Foo(){...} }
Compliant Solution
class Foo { function __construct(){...} }
Replace this function name "prepare" with "__construct". Open
public function prepare(WorkflowStep $step): self
- Read upRead up
- Exclude checks
In PHP 4, any function with the same name as the nesting class was considered a class constructor. In PHP 5, this mechanism has been deprecated and the "__construct" method name should be used instead. If both styles are present in the same class, PHP 5 will treat the function named "__construct" as the class constructor.
This rule rule raises an issue for each method with the same name as the enclosing class.
Noncompliant Code Example
class Foo { function Foo(){...} }
Compliant Solution
class Foo { function __construct(){...} }
Call with 1 arg(s) to \PHPWorkflow\Stage\Prepare::__construct()
which only takes 0 arg(s) defined at /code/src/Stage/Prepare.php:13
Open
return $this->nextStage = (new Prepare($this->workflow))->prepare($step);
- Exclude checks
syntax error, unexpected 'int' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
Open
private static int $stepIndex = 0;
- Exclude checks
syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST)
Open
protected array $steps = [];
- Exclude checks
syntax error, unexpected 'WorkflowStep' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
Open
private WorkflowStep $step;
- Exclude checks
Replace this function name "onSuccess" with "__construct". Open
public function onSuccess(WorkflowStep $step): self
- Read upRead up
- Exclude checks
In PHP 4, any function with the same name as the nesting class was considered a class constructor. In PHP 5, this mechanism has been deprecated and the "__construct" method name should be used instead. If both styles are present in the same class, PHP 5 will treat the function named "__construct" as the class constructor.
This rule rule raises an issue for each method with the same name as the enclosing class.
Noncompliant Code Example
class Foo { function Foo(){...} }
Compliant Solution
class Foo { function __construct(){...} }
syntax error, unexpected 'WorkflowState' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
Open
private WorkflowState $workflowState;
- Exclude checks
Replace this function name "after" with "__construct". Open
public function after(WorkflowStep $step): self
- Read upRead up
- Exclude checks
In PHP 4, any function with the same name as the nesting class was considered a class constructor. In PHP 5, this mechanism has been deprecated and the "__construct" method name should be used instead. If both styles are present in the same class, PHP 5 will treat the function named "__construct" as the class constructor.
This rule rule raises an issue for each method with the same name as the enclosing class.
Noncompliant Code Example
class Foo { function Foo(){...} }
Compliant Solution
class Foo { function __construct(){...} }
syntax error, unexpected ')', expecting variable (T_VARIABLE)
Open
) {
- Exclude checks
Replace this function name "before" with "__construct". Open
public function before(WorkflowStep $step): self
- Read upRead up
- Exclude checks
In PHP 4, any function with the same name as the nesting class was considered a class constructor. In PHP 5, this mechanism has been deprecated and the "__construct" method name should be used instead. If both styles are present in the same class, PHP 5 will treat the function named "__construct" as the class constructor.
This rule rule raises an issue for each method with the same name as the enclosing class.
Noncompliant Code Example
class Foo { function Foo(){...} }
Compliant Solution
class Foo { function __construct(){...} }
syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)
Open
protected ?Stage $nextStage = null;
- Exclude checks
syntax error, unexpected 'private' (T_PRIVATE), expecting variable (T_VARIABLE)
Open
public function __construct(private string $key, private ?string $type = null) {}
- Exclude checks
syntax error, unexpected '=>' (T_DOUBLE_ARROW)
Open
$profile = fn () => $control->attachStepInfo(
- Exclude checks