for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Staudenmeir\LaravelMigrationViews\Schema\Builders;
use Illuminate\Database\Schema\SQLiteBuilder as Base;
use Illuminate\Support\Str;
class SQLiteBuilder extends Base
{
use ManagesViews {
createView as createViewParent;
}
/**
* Create a new view on the schema.
*
* @param string $name
* @param \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|string $query
* @param array|null $columns
* @param bool $orReplace
* @param bool $materialized
* @return void
*/
public function createView($name, $query, ?array $columns = null, $orReplace = false, bool $materialized = false)
$materialized
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function createView($name, $query, ?array $columns = null, $orReplace = false, /** @scrutinizer ignore-unused */ bool $materialized = false)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
if ($orReplace) {
$this->dropViewIfExists($name);
$this->createViewParent($name, $query, $columns);
* Rename a view on the schema.
* @param string $from
* @param string $to
public function renameView($from, $to)
$view = $this->connection->selectOne(
"select * from sqlite_master where type = 'view' and name = ?",
[$this->connection->getTablePrefix().$from]
);
$this->dropView($from);
$query = Str::replaceFirst(
$this->grammar->wrapTable($from),
$this->grammar->wrapTable($to),
$view->sql
$this->connection->statement($query);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.