fucongcong/framework

View on GitHub
core/Group/Async/Handler/TaskHandler.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php
 
namespace Group\Async\Handler;
 
Whitespace found at end of line
abstract class TaskHandler
Opening class brace must be on a line by itself
Expected 0 spaces before opening brace; 1 found
Whitespace found at end of line
{
protected $serv;
 
Avoid variables with short names like $fd. Configured minimum length is 3.
protected $fd;
 
protected $fromId;
 
protected $data;
 
protected $cache;
 
protected $database;
Avoid variables with short names like $fd. Configured minimum length is 3.
public function __construct($serv, $fd, $fromId, $data)
{
$this->serv = $serv;
$this->fd = $fd;
$this->fromId = $fromId;
$this->data = $data;
}
 
abstract public function handle();
 
public function getData()
{
return $this->data;
}
 
public function getServ()
{
return $this->serv;
}
 
public function getFd()
{
return $this->fd;
}
 
public function getfromId()
{
return $this->fromId;
}
 
public function setCache(obj $cache)
{
$this->cache = $cache;
}
 
public function getCache()
{
return $this->cache;
}
 
public function setDatabase(obj $database)
{
$this->database = $database;
}
 
public function getDatabase()
{
return $this->database;
}
 
public function finish($data)
{
return \Group\Async\DataPack::pack($this->data['cmd'], $data, $this->data['info']);
}
 
public function createService($serviceName)
{
return \App::getInstance()->singleton('service')->createService($serviceName);
}
}