Issues (196)

src/Exceptions/InvalidMimeTypeException.php (2 issues)

1
<?php
2
3
namespace UniSharp\LaravelFilemanager\Exceptions;
4
5
class InvalidMimeTypeException extends \Exception
6
{
7
    public function __construct($mimetype)
8
    {
9
        $this->message = trans('laravel-filemanager::lfm.error-mime') . $mimetype;
0 ignored issues
show
Are you sure the usage of trans('laravel-filemanager::lfm.error-mime') is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

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

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

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

Loading history...
The call to trans() has too many arguments starting with 'laravel-filemanager::lfm.error-mime'. ( 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-mime') . $mimetype;

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...
10
    }
11
}
12