for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Hhxsv5\LaravelS\Illuminate\Database;
use Illuminate\Database\QueryException;
use Swoole\Coroutine\MySQL as SwooleMySQL;
class CoroutineMySQL
{
protected $coMySQL;
public function __construct()
$this->coMySQL = new SwooleMySQL();
}
public function connect(array $serverInfo)
$this->coMySQL->connect($serverInfo);
public function prepare($sql)
$oldStatement = $this->coMySQL->prepare($sql);
if ($oldStatement === false) {
$oldStatement === false
false
throw new QueryException($sql, [], new \Exception($this->coMySQL->error, $this->coMySQL->errno));
return new CoroutineMySQLStatement($oldStatement);
public function beginTransaction()
return $this->coMySQL->begin();
$this->coMySQL->begin()
Swoole\Coroutine\Mysql::begin()
This check looks for function or method calls that always return null and whose return value is used.
class A { function getObject() { return null; } } $a = new A(); if ($a->getObject()) {
The method getObject() can return nothing but null, so it makes no sense to use the return value.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
public function commit()
return $this->coMySQL->commit();
$this->coMySQL->commit()
Swoole\Coroutine\Mysql::commit()
public function rollBack()
return $this->coMySQL->rollback();
$this->coMySQL->rollback()
Swoole\Coroutine\Mysql::rollback()
public function query($sql, $timeout = 0.0)
return $this->coMySQL->query($sql, $timeout);
public function lastInsertId()
return $this->coMySQL->insert_id;
public function rowCount()
return $this->coMySQL->affected_rows;