for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace KitLoong\MigrationsGenerator\Generators\Modifier;
use Doctrine\DBAL\Schema\Column;
use KitLoong\MigrationsGenerator\Generators\Decorator;
use KitLoong\MigrationsGenerator\MigrationMethod\ColumnModifier;
use KitLoong\MigrationsGenerator\MigrationsGeneratorSetting;
class CharsetModifier
{
private $decorator;
public function __construct(Decorator $decorator)
$this->decorator = $decorator;
}
public function generate(string $tableName, Column $column): string
$tableName
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function generate(/** @scrutinizer ignore-unused */ string $tableName, Column $column): string
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
if (app(MigrationsGeneratorSetting::class)->isUseDBCollation()) {
$charset = $column->getPlatformOptions()['charset'] ?? null;
if ($charset != null) {
return $this->decorator->decorate(
ColumnModifier::CHARSET,
[$this->decorator->columnDefaultToString($charset)]
);
return '';
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.