mxgross / EasyBackupBundle

Kimai 2 Plugin for easier backups
MIT License
24 stars 6 forks source link

Plugin compatibility for Kimai 2.0.0-beta and higher #53

Closed mxgross closed 1 year ago

mxgross commented 1 year ago

Due to bigger changes in Kimai >=2.0.0 this plugin must be converted as well.

mxgross commented 1 year ago

Hi @kevinpapst,

When executing vendor/bin/rector I run into trouble on my branch for the Kimai 2.0.0 beta conversion:

 15/15 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 [ERROR] Could not process "/var/www/html/kimai200/var/plugins/EasyBackupBundle/Controller/EasyBackupController.php"    
         file, due to:                                                                                                  
         "System error: "array_keys(): Argument #1 ($array) must be of type array, null given"                          
         Run Rector with "--debug" option and post the report here: https://github.com/rectorphp/rector/issues/new". On line: 1038

 [ERROR] Could not process                                                                                              
         "/var/www/html/kimai200/var/plugins/EasyBackupBundle/DependencyInjection/EasyBackupExtension.php" file, due to:
         "System error: "array_keys(): Argument #1 ($array) must be of type array, null given"                          
         Run Rector with "--debug" option and post the report here: https://github.com/rectorphp/rector/issues/new". On line: 1038

 [ERROR] Could not process                                                                                              
         "/var/www/html/kimai200/var/plugins/EasyBackupBundle/EventSubscriber/SystemConfigurationSubscriber.php" file,  
         due to:                                                                                                        
         "System error: "array_keys(): Argument #1 ($array) must be of type array, null given"                          
         Run Rector with "--debug" option and post the report here: https://github.com/rectorphp/rector/issues/new". On line: 1038

 [ERROR] Could not process "/var/www/html/kimai200/var/plugins/EasyBackupBundle/Service/EasyBackupService.php" file, due
         to:                                                                                                            
         "System error: "array_keys(): Argument #1 ($array) must be of type array, null given"                          
         Run Rector with "--debug" option and post the report here: https://github.com/rectorphp/rector/issues/new". On line: 1038

 [ERROR] Could not process                                                                                              
         "/var/www/html/kimai200/var/plugins/EasyBackupBundle/Tests/Command/EasyBackupBackupCommandTest.php" file, due  
         to:                                                                                                            
         "System error: "array_keys(): Argument #1 ($array) must be of type array, null given"                          
         Run Rector with "--debug" option and post the report here: https://github.com/rectorphp/rector/issues/new". On line: 1038

I put the rector.php from here to /var/www/kimai200/rector.php and removed all plugin entries, but added mine: __DIR__ . '/var/plugins/EasyBackupBundle/'

I am using PHP 8.1, composer.json please see branch.

Any ideas? Thanks

kevinpapst commented 1 year ago

I don't know 🤷

Never saw that before, maybe some config issue? Did --debug show anything suspicious?

mxgross commented 1 year ago

Here is the log with --debug rector_debug.log

Rector version used is: "rector/rector": "^0.15.7", Some simiular problem was reported at their repo here: https://github.com/rectorphp/rector/issues/7454

kevinpapst commented 1 year ago

That log contains no more information 😢 It worked for me, I am afraid you have to debug. Start with one directory only. Remove all methods and add them one by one and check when it happens. Or deactivate all rector rules and reactivate them one by one.

Your plugin is rather small. I had to migrate 20 plugins and Kimai itself, so automation was needed. You don't have to use Rector. You could do the upgrade manually by adding some return types and converting from annotation to attributes. That should almost be everything code wise.

mxgross commented 1 year ago

Released support for Kimai2 >= 2.0.0 at new 'main' branch tagged as 2.0.1