for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Lagdo\DbAdmin\Driver;
trait ErrorTrait
{
/**
* The last error code
*
* @var int
*/
protected $errno = 0;
* The last error message
* @var string
protected $error = '';
* @inheritDoc
public function setError(string $error = '')
$this->error = $error;
}
public function error()
return $this->error;
public function hasError()
return $this->error !== '';
public function setErrno($errno)
$this->errno = $errno;
public function errno()
return $this->errno;
public function hasErrno()
return $this->errno !== 0;
public function errorMessage()
return $this->hasErrno() ? '(' . $this->errno() . '): ' . $this->error() : $this->error();