Issues (15)

src_5.6/functions.php (1 issue)

Labels
Severity
1
<?php
2
3
/**
4
 * File gathering functions
5
 */
6
if (!function_exists('type_exists')) {
7
    /**
8
     * Checks if a type is a valid PHP one.
9
     * 
10
     * @param  string $type_name The type name to check
11
     * @return bool   The result
12
     */
13
    function type_exists($type_name)
14
    {
15
        return in_array($type_name, ["boolean", "integer", "double", "string", "array", "object", "resource", "resource (closed)", "NULL", "unknown type"]);
16
    }
17
}
18
if (!function_exists('later')) {
19
    /**
20
     * Create a deferred call chain in a functionnal way.
21
     * 
22
     * @param  string $class_type_interface_or_instance The expected target class/type/interface/instance
23
     * @return \JClaveau\Async\DeferredCallChain
24
     */
25
    function later($class_type_interface_or_instance = null)
26
    {
27
        return new \JClaveau\Async\DeferredCallChain(...func_get_args());
0 ignored issues
show
func_get_args() is expanded, but the parameter $class_type_interface_or_instance of JClaveau\Async\DeferredCallChain::__construct() 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

27
        return new \JClaveau\Async\DeferredCallChain(/** @scrutinizer ignore-type */ ...func_get_args());
Loading history...
28
    }
29
}