LaravelRUS / localized-carbon

A localizable version of Carbon
138 stars 62 forks source link

Declaration of LocalizedCarbon::diffForHumans() should be compatible with Carbon\Carbon::diffForHumans #94

Closed o2-web closed 6 years ago

o2-web commented 6 years ago

ErrorException with message 'Declaration of Laravelrus\LocalizedCarbon\LocalizedCarbon::diffForHumans() should be compatible with Carbon\Carbon::diffForHumans(Carbon\Carbon $other = NULL, $absolute = false, $short = false, $parts = 1)'

recently updated the package and this error appeared

laravel 5.3 localized-carbon version "dev-master"

steps to reproduce error:

  1. $date = Carbon\Carbon::now()->addMinutes(5);
  2. \LocalizedCarbon::instance($date)->diffForHumans();
Amegatron commented 6 years ago

We've recently fixed the package to be compatible with the latest Carbon, laravel 5.3 uses older version of Carbon. Try upgrading Carbon dependency to ^1.24.

o2-web commented 6 years ago

@Amegatron Carbon version "1.24.2" already

Amegatron commented 6 years ago

@02-web That's strange, I've checked recently and package works fine with 1.24. Maybe you have older version of the package (e.g. composer cache)?

o2-web commented 6 years ago

@Amegatron I updated both packages and the error was gone. Thank you!

osbre commented 6 years ago

me too have this error in laravel 5.7, php 7.2