for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Thruster\Component\MysqlClient\Exception;
use Exception;
/**
* Class QueryException
*
* @package Thruster\Component\MysqlClient\Exception
* @author Aurimas Niekis <[email protected]>
*/
class QueryException extends Exception
{
public static function create(string $message, int $code)
switch ($code) {
case 1062:
return new RecordDuplicateException($message);
break;
break
The break statement is not necessary if it is preceded for example by a return statement:
switch ($x) { case 1: return 'foo'; break; // This break is not necessary and can be left off. }
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.
default:
return new static($message, $code);
}
The break statement is not necessary if it is preceded for example by a return statement:
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.