wol-soft/php-workflow

View on GitHub
src/State/ExecutionLog/OutputFormat/StringLog.php

Summary

Maintainability
A
30 mins
Test Coverage

Avoid too many return statements within this method.
Open

            default: return "{$this->indentation}    - " . $info->getInfo();
Severity: Major
Found in src/State/ExecutionLog/OutputFormat/StringLog.php - About 30 mins to fix

    Avoid using static access to class '\PHPWorkflow\State\ExecutionLog\ExecutionLog' in method 'format'.
    Open

                    ExecutionLog::mapStage($stage)

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

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

        private string $indentation = '';

    The DEFAULT body must start on the line following the statement
    Open

                default: return "{$this->indentation}    - " . $info->getInfo();

    Terminating statement must be on a line by itself
    Open

                default: return "{$this->indentation}    - " . $info->getInfo();

    Closing brace must be on a line by itself
    Open

                default: return "{$this->indentation}    - " . $info->getInfo();

    There are no issues that match your filters.

    Category
    Status