Issues (31)

src/Factory.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace EasyIM;
4
5
/**
6
 * Class Factory
7
 *
8
 * @method static \EasyIM\TencentIM\Application  TencentIM(array $config)
9
 */
10
class Factory
11
{
12
    /**
13
     * @param string $name
14
     * @param array  $config
15
     *
16
     * @return \EasyIM\Kernel\ServiceContainer
17
     */
18 1
    public static function make($name, array $config)
19
    {
20 1
        $namespace = Kernel\Support\Str::studly($name);
21
22 1
        $application = "\\EasyIM\\{$namespace}\\Application";
23
24 1
        return new $application($config);
25
    }
26
27
    /**
28
     * Dynamically pass methods to the application.
29
     *
30
     * @param string $name
31
     * @param array  $arguments
32
     *
33
     * @return mixed
34
     */
35 1
    public static function __callStatic($name, $arguments)
36
    {
37 1
        return self::make($name, ...$arguments);
0 ignored issues
show
$arguments is expanded, but the parameter $config of EasyIM\Factory::make() 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

37
        return self::make($name, /** @scrutinizer ignore-type */ ...$arguments);
Loading history...
38
    }
39
}
40