Skip to content

Better handling for PHP fatal errors #41

Open
@macbookandrew

Description

@macbookandrew

What would you like to do?
When a fatal error is thrown, it would be great to have a bit more context about what file was being processed when the error occured.

Example output when running the PHP7.3 Array Functions task:

>>> Event: Processing paths: app, database/factories, database/seeders, vendor-custom/brilliantpackages/laravel-mysql-spatial/src/Eloquent, config, database/migrations, routes, tests
Fatal error: Cannot declare class Illuminate\Support\Collection, because the name is already in use in /project/vendor/laravel/framework/src/Illuminate/Collections/Collection.php on line 11
Failed to run rector: adopt-new-array-functions: #0 phar:///opt/shift/workbench/src/Tasks/Workbench/AdoptNewArrayFunctions.php(18): Shift\Tasks\Workbench\AdoptNewArrayFunctions->rector('/opt/shift/reso...')
#1 phar:///opt/shift/workbench/workbench.php(95): Shift\Tasks\Workbench\AdoptNewArrayFunctions->perform()
#2 /opt/shift/workbench(9): require('phar:///opt/shi...')
#3 {main}

I’ve searched my codebase for class Collection and it’s not coming up just found it in _ide_helper.php from this package.

If possible, it would be nice to see the file being processed when the error occurred so I can more easily track it down.

Before/After code snippets
Perhaps something like this:

>>> Event: Processing paths: app, database/factories, database/seeders, vendor-custom/brilliantpackages/laravel-mysql-spatial/src/Eloquent, config, database/migrations, routes, tests
Fatal error: Cannot declare class Illuminate\Support\Collection, because the name is already in use in /project/vendor/laravel/framework/src/Illuminate/Collections/Collection.php on line 11
+ File currently being processed: _ide_helper.php
Failed to run rector: adopt-new-array-functions: #0 phar:///opt/shift/workbench/src/Tasks/Workbench/AdoptNewArrayFunctions.php(18): Shift\Tasks\Workbench\AdoptNewArrayFunctions->rector('/opt/shift/reso...')
#1 phar:///opt/shift/workbench/workbench.php(95): Shift\Tasks\Workbench\AdoptNewArrayFunctions->perform()
#2 /opt/shift/workbench(9): require('phar:///opt/shi...')
#3 {main}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions