cakephp / chronos

A standalone DateTime library originally based off of Carbon

Home Page:http://book.cakephp.org/chronos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing Cake\Chronos\Date class

robertpustulka opened this issue · comments

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

class_exists('Cake\Chronos\ChronosDate');

FrozenDate is broken beacuse of this too:

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

There is an alias present in the ChronosDate class

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

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

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 cakephp/cakephp#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.