1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* This file is part of the sj-i/php-profiler package. |
5
|
|
|
* |
6
|
|
|
* (c) sji <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
declare(strict_types=1); |
13
|
|
|
|
14
|
|
|
namespace PhpProfiler\Lib\PhpInternals\Opcodes; |
15
|
|
|
|
16
|
|
|
final class OpcodeFactory |
17
|
|
|
{ |
18
|
|
|
/** @var array<string, class-string<Opcode>> */ |
19
|
|
|
private const VERSION_MAP = [ |
20
|
|
|
'v70' => OpcodeV70::class, |
21
|
|
|
'v71' => OpcodeV71::class, |
22
|
|
|
'v72' => OpcodeV72::class, |
23
|
|
|
'v73' => OpcodeV73::class, |
24
|
|
|
'v74' => OpcodeV74::class, |
25
|
|
|
'v80' => OpcodeV80::class, |
26
|
|
|
]; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @template TVersion of key-of<self::VERSION_MAP> |
30
|
|
|
* @param TVersion $version |
|
|
|
|
31
|
|
|
* @return ( |
|
|
|
|
32
|
|
|
* TVersion is 'v70' ? OpcodeV70 : |
33
|
|
|
* TVersion is 'v71' ? OpcodeV71 : |
34
|
|
|
* TVersion is 'v72' ? OpcodeV72 : |
35
|
|
|
* TVersion is 'v73' ? OpcodeV73 : |
36
|
|
|
* TVersion is 'v74' ? OpcodeV74 : |
37
|
|
|
* OpcodeV80 |
38
|
|
|
* ) |
39
|
|
|
*/ |
40
|
|
|
public function create(string $version, int $opcode): Opcode |
41
|
|
|
{ |
42
|
|
|
return match ($version) { |
43
|
|
|
'v71' => new OpcodeV71($opcode), |
44
|
|
|
'v72' => new OpcodeV72($opcode), |
45
|
|
|
'v73' => new OpcodeV73($opcode), |
46
|
|
|
'v74' => new OpcodeV74($opcode), |
47
|
|
|
'v80' => new OpcodeV80($opcode), |
48
|
|
|
}; |
49
|
|
|
} |
50
|
|
|
} |
51
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths