Method up
has 36 lines of code (exceeds 25 allowed). Consider refactoring.
public function up(): void
{
Schema::create(config('files.table.name'), function (Blueprint $table): void {
$typeId = config('files.table.id');
Function beforeUploadFile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
private function beforeUploadFile(UploadedFile $file): UploadedFile
{
if (!$this->beforeUploadActions || !is_array($this->beforeUploadActions)) {
return $file;
}
Function mimeIs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
public static function mimeIs(string $mimeExist, string $mimeAsk): bool
{
if (empty($mimeExist) || empty($mimeAsk)) {
return false;
}
Function afterUploadFile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
private function afterUploadFile(BaseFile $baseFile)
{
if (!$this->afterUploadActions || !is_array($this->afterUploadActions)) {
return $baseFile;
}
Function handle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
public function handle($model, ... $options)
{
if ($this->width !== null && $this->height !== null) {
if ($this->bestFit) {
$model->getImageProcessor()->resizeToBestFit($this->width, $this->height, ...$options);
Function up
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
public function up(): void
{
Schema::create(config('files.table.name'), function (Blueprint $table): void {
$typeId = config('files.table.id');
Avoid too many return
statements within this method.
return File::class;
Avoid too many return
statements within this method.
return $formatExist === $formatAsk;
Avoid too many return
statements within this method.
return true;