for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace LaravelFreelancerNL\Aranguent\Testing\Concerns;
use Illuminate\Support\Facades\DB;
trait InteractsWithDatabase
{
/**
* Cast a JSON string to a database compatible type.
* Supported for backwards compatibility in existing projects.
* No cast is necessary as json is a first class citizen in ArangoDB.
*
* @param array<mixed>|object|string $value
* @param string|null $connection
* @return \Illuminate\Contracts\Database\Query\Expression
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function castAsJson($value, $connection = null)
$connection
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function castAsJson($value, /** @scrutinizer ignore-unused */ $connection = null)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return DB::raw($value);
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.