for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace LaravelSpatial\Schema\Grammars;
use Illuminate\Database\Schema\Grammars\Grammar;
/**
* Class GrammarFactory
*
* @package LaravelSpatial\Schema\Grammars
* @internal
*/
class GrammarFactory
{
* @param string $name
* @return \Illuminate\Database\Schema\Grammars\Grammar
public static function make(string $name): Grammar
switch ($name) {
case 'mysql':
return new MySqlGrammar();
break;
break
The break statement is not necessary if it is preceded for example by a return statement:
return
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.
case
case 'postgresql':
case 'pg_sql':
return new PostgresGrammar();
}
throw new \InvalidArgumentException(\sprintf('%s is not a supported grammar.', $name));
The
break
statement is not necessary if it is preceded for example by areturn
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.