This repository was archived by the owner on Dec 9, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php declare (strict_types = 1 );
2+
3+ spl_autoload_register (function (string $ class ): void {
4+ if (!extension_loaded ('phar ' ) || defined ('__PHPSTAN_RUNNING__ ' )) {
5+ return ;
6+ }
7+
8+ if (strpos ($ class , '_HumbugBox ' ) === 0 ) {
9+ if (!in_array ('phar ' , stream_get_wrappers (), true )) {
10+ throw new \Exception ('Phar wrapper is not registered. Please review your php.ini settings. ' );
11+ }
12+
13+ $ composerAutoloader = require 'phar:// ' . __DIR__ . '/phpstan.phar/vendor/autoload.php ' ;
14+ $ composerAutoloader ->loadClass ($ class );
15+
16+ return ;
17+ }
18+ if (strpos ($ class , 'PHPStan \\PhpDocParser \\' ) === 0 ) {
19+ return ;
20+ }
21+ if (strpos ($ class , 'PHPStan \\' ) !== 0 ) {
22+ return ;
23+ }
24+
25+ if (!in_array ('phar ' , stream_get_wrappers (), true )) {
26+ throw new \Exception ('Phar wrapper is not registered. Please review your php.ini settings. ' );
27+ }
28+
29+ $ filename = str_replace ('\\' , DIRECTORY_SEPARATOR , $ class );
30+ $ filename = substr ($ filename , strlen ('PHPStan \\' ));
31+ $ filepath = 'phar:// ' . __DIR__ . '/phpstan.phar/src/ ' . $ filename . '.php ' ;
32+ if (!file_exists ($ filepath )) {
33+ return ;
34+ }
35+
36+ require $ filepath ;
37+ });
Original file line number Diff line number Diff line change 1717 "branch-alias" : {
1818 "dev-master" : " 0.12-dev"
1919 }
20+ },
21+ "autoload" : {
22+ "files" : [" bootstrap.php" ]
2023 }
2124}
You can’t perform that action at this time.
0 commit comments