Failed Conditions
Push — master ( fa2e68...636df0 )
by Arnold
03:02
created

src/Loader/EntryLoader.php (1 issue)

Labels
Severity
1
<?php declare(strict_types=1);
2
3
namespace Jasny\Container\Loader;
4
5
use Improved as i;
6
7
/**
8
 * Load entries from declaration PHP files
9
 */
10
class EntryLoader extends AbstractLoader
11
{
12
    /**
13
     * Load new entries
14
     *
15
     * @return void
16
     */
17 8
    protected function prepareNext(): void
18
    {
19 8
        if (!$this->items->valid()) {
20 2
            return;
21
        }
22
23 6
        $file = $this->items->current();
24
25
        /** @noinspection PhpIncludeInspection */
26 6
        $entries = i\type_check(
1 ignored issue
show
The function type_check was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

26
        $entries = /** @scrutinizer ignore-call */ i\type_check(
Loading history...
27 6
            (include $file),
28 6
            'array',
29 6
            new \UnexpectedValueException("Failed to load container entries from '$file': Invalid or no return value")
30
        );
31
32 6
        $this->entries = new \ArrayIterator($entries);
33
34 6
        $this->items->next();
35 6
    }
36
}
37