Issues (177)

Concerns/Standalone/BootStandaloneLarupload.php (3 issues)

1
<?php
2
3
namespace Mostafaznv\Larupload\Concerns\Standalone;
4
5
use Mostafaznv\Larupload\Enums\LaruploadMode;
6
use Mostafaznv\Larupload\Larupload;
7
8
trait BootStandaloneLarupload
9
{
10
    protected static string $laruploadNull;
11
12
    protected bool $internalFunctionIsCallable = false;
13
14
15
    public function __construct(string $name, LaruploadMode $mode)
0 ignored issues
show
The parameter $mode is not used and could be removed. ( Ignorable by Annotation )

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

15
    public function __construct(string $name, /** @scrutinizer ignore-unused */ LaruploadMode $mode)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
16
    {
17
        static::$laruploadNull = crc32(time());
18
19
        if (!defined('LARUPLOAD_NULL')) {
20
            // @codeCoverageIgnoreStart
21
            define('LARUPLOAD_NULL', static::$laruploadNull);
22
            // @codeCoverageIgnoreEnd
23
        }
24
25
        parent::__construct($name, LaruploadMode::STANDALONE);
26
    }
27
28
29
    public static function init(string $name): Larupload
30
    {
31
        $instance = new self($name, LaruploadMode::STANDALONE);
32
        $instance->id = time();
0 ignored issues
show
Bug Best Practice introduced by
The property id does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
33
34
        return $instance;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $instance returns the type Mostafaznv\Larupload\Con...BootStandaloneLarupload which includes types incompatible with the type-hinted return Mostafaznv\Larupload\Larupload.
Loading history...
35
    }
36
}
37