Issues (7)

src/Helpers/helpers.php (3 issues)

1
<?php
2
3
declare(strict_types=1);
4
5
use MichaelRubel\EnhancedContainer\Core\CallProxy;
6
use MichaelRubel\EnhancedContainer\Core\MethodBinder;
0 ignored issues
show
The type MichaelRubel\EnhancedContainer\Core\MethodBinder was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
if (! function_exists('call')) {
9
    function call(string|object $class, array $parameters = [], ?string $context = null): CallProxy
10
    {
11 59
        return app(CallProxy::class, [
12 59
            'class'        => $class,
13 59
            'dependencies' => $parameters,
14 59
            'context'      => $context,
15 59
        ]);
16
    }
17
}
18
19
if (! function_exists('bind')) {
20
21
    function bind(object|string $abstract): MethodBinder
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
22
    {
23 14
        return app(MethodBinder::class, ['abstract' => $abstract]);
0 ignored issues
show
Bug Best Practice introduced by
The expression return app(MichaelRubel\...bstract' => $abstract)) could return the type Illuminate\Contracts\Fou...\Foundation\Application which is incompatible with the type-hinted return MichaelRubel\EnhancedContainer\Core\MethodBinder. Consider adding an additional type-check to rule them out.
Loading history...
24
    }
25
}
26