fucongcong/framework

View on GitHub
core/Group/Queue/QueueService.php

Summary

Maintainability
A
35 mins
Test Coverage

Showing 12 of 12 total issues

Method put has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

public function put($tube, $data, $priority = null, $delaytime = null, $lifetime = null)
Severity: Minor
Found in core/Group/Queue/QueueService.php - About 35 mins to fix

    Missing class import via use statement (line '38', column '50').
    Open

    if (count($this->server) <= 0) throw new \Exception("beanstalkd服务没有启动", 1);
    Severity: Minor
    Found in core/Group/Queue/QueueService.php by phpmd

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

    } else {
    foreach ($server as $one) {
    $this->init($one['host'], $one['port']);
    }
    }
    Severity: Minor
    Found in core/Group/Queue/QueueService.php by phpmd

    Blank line found at start of control structure
    Open

    if(!$this->server[$key]->getConnection()->isServiceListening()) {

    Inline control structures are not allowed
    Open

    if (count($this->server) <= 0) throw new \Exception("beanstalkd服务没有启动", 1);

    Whitespace found at end of line
    Open

    {

    Opening parenthesis of a multi-line function call must be the last content on the line
    Open

    \EventDispatcher::dispatch(QueueEvent::CRASH,

    Expected 1 space after IF keyword; 0 found
    Open

    if(!$this->server[$key]->getConnection()->isServiceListening()) {

    Multi-line function call not indented correctly; expected 12 spaces but found 16
    Open

    );

    Closing parenthesis of a multi-line function call must be on a line by itself
    Open

    $this->server[$key]->getConnection()->getPort())

    Opening parenthesis of a multi-line function call must be the last content on the line
    Open

    new QueueEvent($this->server[$key]->getConnection()->getHost(),

    Whitespace found at end of line
    Open

    {
    Category
    Status