Issues (4)

src/helpers.php (2 issues)

1
<?php
2
3
use Illuminate\Container\Container;
4
5
if (! function_exists('laraflash')) {
6
    function laraflash(...$args)
7
    {
8
        /** @var \Coderello\Laraflash\Laraflash\Laraflash $laraflash */
9
        $laraflash = Container::getInstance()->make('laraflash');
10
11
        if ($args) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $args of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
12
            return $laraflash->message(...$args);
0 ignored issues
show
$args is expanded, but the parameter $content of Coderello\Laraflash\Laraflash\Laraflash::message() does not expect variable arguments. ( Ignorable by Annotation )

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

12
            return $laraflash->message(/** @scrutinizer ignore-type */ ...$args);
Loading history...
13
        }
14
15
        return $laraflash;
16
    }
17
}
18