Laravel-Backpack / CRUD

Build custom admin panels. Fast!
https://backpackforlaravel.com
MIT License
3k stars 880 forks source link

fix PHPDoc CrudController #5474

Closed makss closed 3 months ago

makss commented 3 months ago

WHY

Simplifying PHPDoc.

BEFORE - What was wrong? What was happening before this PR?

Now we need to add a PHPDoc block to each CrudController class:

/**
 * Class DummyClassCrudController
 * @package App\Http\Controllers\Admin
 * @property-read \Backpack\CRUD\app\Library\CrudPanel\CrudPanel $crud
 */
class DummyClassCrudController extends CrudController
{
    public function setup()
    {
        $this->crud->[ _autocomplete_works_ ];
    }
}

AFTER - What is happening after this PR?

After the patch, it will no longer be necessary to add a PHPDoc block to each CrudController class:

class DummyClassCrudController extends CrudController
{
    public function setup()
    {
        $this->crud->[ _autocomplete_works_ ];
    }
}

Is it a breaking change?

No

How can we test the before & after?

Check autocomplete in PhpStorm or another IDE.

pxpm commented 3 months ago

Thanks @makss 🙏