makeitworkpress / wp-custom-fields

WP Custom Fields is an options, metabox and customizer framework for WordPress aimed at speeding-up plug-in and theme development.
https://makeitwork.press/scripts/wp-custom-fields/
GNU General Public License v3.0
70 stars 15 forks source link

uppercase class filenames #6

Closed hlev closed 2 years ago

hlev commented 2 years ago

Addresses https://github.com/makeitworkpress/wp-custom-fields/issues/4 dump-autoload -o will work in Composer 2.0+

I was using this in a custom child theme as a dependency and did not see any issues with just simply including the generated autoload.php in functions.php

leichim commented 2 years ago

Thanks - the solution includes the filenames being uppercase?

hlev commented 2 years ago

No problem. PSR-4 autoloading requires one class definition per file where class name matches filename and namespacing matches directory structure. AFAIK on case-sensitive file systems it matters as well that the filenames have correct casing.

leichim commented 2 years ago

Makes a lot of sense. I think WordPress uses lowercase for class names and adds the class-prefix (e.g. class-classname.php), but I prefer the uppercase as you suggested (reminds me of some JS projects as well)

leichim commented 2 years ago

I manually pushed a new update, which includes the uppercase class names and directories.