cakephp / chronos

A standalone DateTime library originally based off of Carbon
http://book.cakephp.org/chronos
MIT License
1.34k stars 61 forks source link

Missing Cake\Chronos\Date class #408

Closed robertpustulka closed 10 months ago

robertpustulka commented 10 months ago

Shouldn't this class have an alias to a replacement?

https://github.com/cakephp/chronos/blob/3cbb9e2d8af1065c7189e1dc3f4fa641e797719f/src/Date.php#L15

FrozenDate is broken beacuse of this too:

https://github.com/cakephp/cakephp/blob/b58978b3433c3e1a8954a5d667896a8da2d93365/src/I18n/FrozenDate.php#L19

LordSimal commented 10 months ago

There is an alias present in the ChronosDate class

What exact error are you getting and how can we reproduce it?

robertpustulka commented 10 months ago

PHP Stan reported this issue in my project:


Call to static method now() on an unknown class Cake\Chronos\Date.   
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
LordSimal commented 10 months ago

This is a stan warning, not a runtime error which one could interpret from your initial FrozenDate is broken message.

This was already discussed in https://github.com/cakephp/cakephp/issues/17229 and can't be fixed in this current patch release cycle. But it will be fixed in the upcoming CakePHP 4.5 release because Frozendate will use the correct base class as you can see here

So unfortunately you will have to be patient and update to CakePHP 4.5 when it releases to fix this stan issue.