fucongcong/framework

View on GitHub
core/Group/Console/Command/GenerateServiceCommand.php

Summary

Maintainability
A
1 hr
Test Coverage

Showing 8 of 8 total issues

Method init has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public function init()
{
$input = $this->getArgv();
 
if (!isset($input[0])) {
Severity: Minor
Found in core/Group/Console/Command/GenerateServiceCommand.php - About 1 hr to fix

    The method init uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

    } else {
    $group = ucfirst($input[0]);
    $name = $input[0];
    }

    Space before opening parenthesis of function call prohibited
    Open

    file_put_contents ($dir."/".$group."/".$serviceName."Service.php", $data);

    Space before opening parenthesis of function call prohibited
    Open

    file_put_contents ($daoDir."/".$serviceName."/".$serviceName."Dao.php", $data);

    Space before opening parenthesis of function call prohibited
    Open

    file_put_contents ($dir."/".$group."/Rely/".$serviceName."BaseService.php", $data);

    Space before opening parenthesis of function call prohibited
    Open

    file_put_contents ($dir."/".$group."/Impl/".$serviceName."ServiceImpl.php", $data);

    Space before opening parenthesis of function call prohibited
    Open

    file_put_contents ($daoDir."/".$serviceName."/Impl/".$serviceName."DaoImpl.php", $data);

    Whitespace found at end of line
    Open

    {
    Category
    Status