wol-soft/php-workflow

View on GitHub

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 {

Closing brace must be on a line by itself
Open

            case WorkflowState::STAGE_AFTER: return 'After';

syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST)
Open

    private array $validationErrors;

syntax error, unexpected 'Describable' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
Open

    private Describable $step;
Severity: Critical
Found in src/State/ExecutionLog/Step.php by phan

syntax error, unexpected 'bool' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
Open

    private bool $success;
Severity: Critical
Found in src/State/WorkflowResult.php by phan

syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)
Open

    private ?Exception $processException = null;
Severity: Critical
Found in src/State/WorkflowState.php by phan

Replace this function name "process" with "__construct".
Open

    public function process(WorkflowStep $step): self
Severity: Major
Found in src/Stage/Process.php by sonar-php

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
Severity: Major
Found in src/Stage/Prepare.php by sonar-php

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);
Severity: Info
Found in src/Stage/Next/AllowNextPrepare.php by phan

syntax error, unexpected 'int' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
Open

    private static int $stepIndex = 0;

syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST)
Open

    protected array $steps = [];
Severity: Critical
Found in src/Step/Loop.php by phan

syntax error, unexpected 'WorkflowStep' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
Open

    private WorkflowStep $step;
Severity: Critical
Found in src/Validator.php by phan

Replace this function name "onSuccess" with "__construct".
Open

    public function onSuccess(WorkflowStep $step): self
Severity: Major
Found in src/Stage/OnSuccess.php by sonar-php

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;
Severity: Critical
Found in src/WorkflowControl.php by phan

Replace this function name "after" with "__construct".
Open

    public function after(WorkflowStep $step): self
Severity: Major
Found in src/Stage/After.php by sonar-php

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

    ) {

Replace this function name "before" with "__construct".
Open

    public function before(WorkflowStep $step): self
Severity: Major
Found in src/Stage/Before.php by sonar-php

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;
Severity: Critical
Found in src/Stage/Stage.php by phan

syntax error, unexpected 'private' (T_PRIVATE), expecting variable (T_VARIABLE)
Open

    public function __construct(private string $key, private ?string $type = null) {}
Severity: Critical
Found in src/Step/Dependency/Requires.php by phan

syntax error, unexpected '=>' (T_DOUBLE_ARROW)
Open

        $profile = fn () => $control->attachStepInfo(
Severity: Critical
Found in src/Middleware/ProfileStep.php by phan
Severity
Category
Status
Source
Language