Laravel-Backpack / PermissionManager

Admin interface for managing users, roles, permissions, using Backpack CRUD
http://backpackforlaravel.com
Other
516 stars 166 forks source link

fix php 8.2 deprecation warnings #342

Closed makss closed 10 months ago

makss commented 11 months ago

WHY

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

logs\deprecation-warnings.log

[2023-10-19 07:43:25] staging.WARNING: Creation of dynamic property Backpack\PermissionManager\app\Http\Controllers\RoleCrudController::$role_model is deprecated in /vendor/backpack/permissionmanager/src/app/Http/Controllers/RoleCrudController.php on line 20
[2023-10-19 07:43:25] staging.WARNING: Creation of dynamic property Backpack\PermissionManager\app\Http\Controllers\RoleCrudController::$permission_model is deprecated in /vendor/backpack/permissionmanager/src/app/Http/Controllers/RoleCrudController.php on line 21

[2023-10-19 22:39:31] staging.WARNING: Creation of dynamic property Backpack\PermissionManager\app\Http\Controllers\PermissionCrudController::$role_model is deprecated in /vendor/backpack/permissionmanager/src/app/Http/Controllers/PermissionCrudController.php on line 20
[2023-10-19 22:39:31] staging.WARNING: Creation of dynamic property Backpack\PermissionManager\app\Http\Controllers\PermissionCrudController::$permission_model is deprecated in /vendor/backpack/permissionmanager/src/app/Http/Controllers/PermissionCrudController.php on line 21

PHP 8.2 Deprecated https://php.watch/versions/8.2/dynamic-properties-deprecated

Similar Issue: https://github.com/Laravel-Backpack/CRUD/pull/5082

welcome[bot] commented 11 months ago

BOOM! Your first PR with us, thank you so much! Someone will take a look at it shortly.

Please keep in mind that:

Thank you!

-- Justin Case The Backpack Robot

karandatwani92 commented 10 months ago

Hey @makss, thanks for the PR.

@pxpm can you please review this small & quick fix?

pxpm commented 10 months ago

Hey @makss thanks for the PR. 🙏 Really appreciated.

@karandatwani92 I think this just needs types before merging.

protected string $role_model; 
protected string $permission_model; 

@makss can you add types for those ? If you don't have time/desire to do it me or @karandatwani92 can push this foward 🙏

Cheers

makss commented 10 months ago

@pxpm yes, you are right, I specified the type of variables.

pxpm commented 10 months ago

Thanks @makss 🙏 much appreciated!

welcome[bot] commented 10 months ago

WHOOP-WHOOP! Congrats, your first PR on this repo has officialy been merged.

party

If you want to help out the community in other ways, you can:

Again. Thank you for the PR. You are a wonderful person. Keep 'em coming :-) Cheers!

-- Justin Case The Backpack Robot

P.S. Help in the Backpack community is rewarded with free Backpack commercial licenses. It's the least we can do. If you feel you've helped the community with PRs, help & other stuff, please shoot Tabacitu an email and ask him if you qualify for free licenses. You scratch my back, I scratch your back. Thank you!