laravel icon indicating copy to clipboard operation
laravel copied to clipboard

Declaration of BackupManager\Laravel\Laravel51Compatibility::table(array $headers, $rows, $style = 'default') should be compatible with Illuminate\Consol e\Command::table($headers, $rows, $style = 'default')

Open 4sh3 opened this issue 8 years ago • 17 comments

Hi friends,

I am using windows 10 with php 7.1, I am trying to update laravel 5.4* to 5.5 and when I do composer update to my app:

[ErrorException] Declaration of BackupManager\Laravel\Laravel51Compatibility::table(array $headers, $rows, $style = 'default') should be compatible with Illuminate\Consol e\Command::table($headers, $rows, $style = 'default')

Script php artisan optimize handling the post-update-cmd event returned with error code 1

What can i do?

Thanks for your help

4sh3 avatar Sep 02 '17 23:09 4sh3

Solved, I just changed the function: public function table($headers, $rows, $style = 'default') in BackupManager\Laravel\Laravel51Compatibility

4sh3 avatar Sep 02 '17 23:09 4sh3

I think that perhaps a better solution might be to create Laravel 55 compatibility.

ShawnMcCool avatar Sep 03 '17 10:09 ShawnMcCool

@ShawnMcCool PR was made several days ago...

SergeyMiracle avatar Sep 03 '17 12:09 SergeyMiracle

@ShawnMcCool any news on PR #87 What else needs to be done?

SergeyMiracle avatar Sep 04 '17 08:09 SergeyMiracle

Ironically I get this error upgrading from 5.4 to 5.5.

Declaration of BackupManager\Laravel\Laravel55Compatibility::table($headers, $rows, 
$style = 'default') should be compatible with Illuminate\Console\Command::table($headers, 
$rows, $tableStyle = 'default', array $columnStyles = Array)

if I change this

public function table($headers, $rows, $style = 'default')

to

public function table($headers, $rows, $style = 'default', array $columnStyles = [])

it works.

whoacowboy avatar Sep 19 '17 22:09 whoacowboy

in Laravel55Compatibility public function table($headers, $rows, $style = 'default', array $columnStyles = [])

that works fine...

xembill avatar Sep 20 '17 10:09 xembill

Hoping this gets pushed in soon, thanks!

matthewscalf avatar Sep 21 '17 18:09 matthewscalf

Submit a PR =) I'll merge it in.

ShawnMcCool avatar Sep 22 '17 09:09 ShawnMcCool

@ShawnMcCool It's here. Can you tag it too?

whoacowboy avatar Sep 22 '17 13:09 whoacowboy

Please solve it in the repository because when someone works with heroku should do composer updates on the server and is so hard change this each time you push the code correct this...

4sh3 avatar Sep 26 '17 23:09 4sh3

Error on Laravel55Compatibility:

[ErrorException] Declaration of BackupManager\Laravel\Laravel55Compatibility::table($headers , $rows, $style = 'default') should be compatible with Illuminate\Console\C ommand::table($headers, $rows, $tableStyle = 'default', array $columnStyles = Array)

4sh3 avatar Sep 27 '17 10:09 4sh3

Ok, I'm not sure why anyone would do composer update on a server. But, that's beside the point.

@4sh3 did you see this? https://github.com/backup-manager/laravel/pull/91

ShawnMcCool avatar Sep 27 '17 10:09 ShawnMcCool

do the same for lumen (5.5) can be a great thing no ?

croucour avatar Dec 06 '17 09:12 croucour

I'll honestly merge anything at this point.

ShawnMcCool avatar Dec 06 '17 10:12 ShawnMcCool

Still having this issue on 5.4.. For anyone else wanting to modify vendor files (shudder), change Laravel51Compatibility to:

public function table($headers, $rows, $style = 'default', array $columnStyles = [])

scottybo avatar Feb 14 '18 08:02 scottybo

There are different compatibility files for each version of Laravel's API change. This ticket is about 5.1. What happens when you use the 54 compatibility file?

ShawnMcCool avatar Feb 14 '18 12:02 ShawnMcCool

I changed following files: Laravel5DbListCommand Laravel5DbBackupCommand Laravel5DbRestoreCommand from use Laravel51Compatibility; into use Laravel55Compatibility;

And works like a charm

cheers

dennisvandenende avatar Oct 06 '18 20:10 dennisvandenende