Passed
Push — master ( 05da8b...b115dc )
by Stream
04:22
created

FileSizeExceedIniMaximumException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace UniSharp\LaravelFilemanager\Exceptions;
4
5
class FileSizeExceedIniMaximumException extends \Exception
6
{
7
    public function __construct()
8
    {
9
        $this->message = trans('laravel-filemanager::lfm.error-file-size', ['max' => ini_get('upload_max_filesize')]);
0 ignored issues
show
Unused Code introduced by
The call to trans() has too many arguments starting with 'laravel-filemanager::lfm.error-file-size'. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

9
        $this->message = /** @scrutinizer ignore-call */ trans('laravel-filemanager::lfm.error-file-size', ['max' => ini_get('upload_max_filesize')]);

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
Bug introduced by
Are you sure the assignment to $this->message is correct as trans('laravel-filemanag...upload_max_filesize'))) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
10
    }
11
}
12