laravel-ide-helper icon indicating copy to clipboard operation
laravel-ide-helper copied to clipboard

Error in `getValidAliases()` when running with swoole installed

Open TimoFrenzel opened this issue 2 years ago • 1 comments

Since the package cannot work with swoole, It would make sense in the Generator.php method getValidAliases()

Not only to skip predis, but also swoole.

if ($facade == 'SwooleTW\Http\Server\Facades\Server' && $name == 'Server' && !class_exists('Swoole\Http\Server')) {
                 continue;
             }

TimoFrenzel avatar Oct 30 '23 07:10 TimoFrenzel

I understand this pattern is also used this way, e.g. https://github.com/barryvdh/laravel-ide-helper/blob/9f5670b7e94869b116dc8c3d100f95ca63527536/src/Generator.php#L151-L153

Isn't there a way to more generically solve this?

Can you show a complete stacktrace? Maybe it's smarter to just add a try/catch in the foreach and emit a brief console message (instead of aborting) everything, WDYT?

mfn avatar Nov 01 '23 14:11 mfn