As found in #2151829-13: Doctrine annotation parsing takes an unacceptable amount of time/memory on install, there are 4 datetime class names that don't match their file names.

This actually matters for the Doctrine parser.

Comments

olli’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

chx’s picture

Yay, PHP!

Edit:

php -r 'class x {static function foo(){}} ; $x = X::fOO(); var_dump($X);'
PHP Notice: Undefined variable: X in Command line code on line 1

Classnames are case insensitive. Method names are case insensitive. Variable names, however, are case sensitive.

olli’s picture

Yes, beware class properties, static properties and constants =)

berdir’s picture

50% of the DateTime classes were messed up like this, also tests. Simpletest didn't like that very much but those have been fixed already.

sun’s picture

To my knowledge, the DateTime module and plugins were modeled after PHP's native DateTime class.

PHP's native class name is CamelCased; i.e., DateTime as opposed to Datetime.

Do we rather want to rename the filenames to use DateTime, too?

berdir’s picture

Status: Reviewed & tested by the community » Needs work

Good point, yes, we do.

Almost all other classes, with the exception of a single test are named DateTime...

I think this was changed at some point in the development of that patch/module and that messed this up...

tim.plunkett’s picture

Well I can't roll that patch, because of my filesystem. Git won't let me.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new1.73 KB

@timplunkett: Must be tough live under such inhuman circumstances :)

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

:)

webchick’s picture

Assigned: Unassigned » alexpott

I can't apply this because I'm on Mac:

$ git apply --index datetime-case-8.patch 
error: core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php: already exists in working directory
error: core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldFormatter/DateTimePlainFormatter.php: already exists in working directory
error: core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php: already exists in working directory
error: core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php: already exists in working directory

Tentatively trying alexpott?

xjm’s picture

8: datetime-case-8.patch queued for re-testing.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 562b775 and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.