File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,26 @@ declare(strict_types=1);
1212
1313use AndreyTech \Pdepend \Summary \Formatter \Application ;
1414
15- include_once __DIR__ . '/../autoload.php ' ;
15+ (static function () {
16+ foreach ([ '/../ ' , '/../vendor/ ' ] as $ path ) {
17+ $ autoloadFile = __DIR__ . $ path . 'autoload.php ' ;
18+ if (is_file ($ autoloadFile )) {
19+ if (is_readable ($ autoloadFile )) {
20+ require_once $ autoloadFile ;
21+ return ;
22+ }
23+ trigger_error ('Can not read Composer file "autoload.php" ' , E_USER_ERROR );
24+ }
25+ }
26+ trigger_error ('Can not find Composer file "autoload.php" ' , E_USER_ERROR );
27+ })();
1628
17- $ application = new Application ();
18- $ exitCode = $ application ->run ();
19- exit ($ exitCode );
29+ (new class
30+ {
31+ public function __invoke (): void
32+ {
33+ $ application = new Application ();
34+ $ exitCode = $ application ->run ();
35+ exit ($ exitCode );
36+ }
37+ })();
You can’t perform that action at this time.
0 commit comments