Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#1684 - Use PSR-4 autoloader instead of PSR-0 for "Civi" namespace #17105

Merged
merged 1 commit into from
Apr 21, 2020

Conversation

colemanw
Copy link
Member

Overview

This change is to allow underscores in class names, which were being misinterpreted as directory separators.

Before

Classes in the \Civi namespace could not contain underscores.

After

Classes in the \Civi namespace can contain underscores.

Comments

See https://lab.civicrm.org/dev/core/-/issues/1684

@civibot
Copy link

civibot bot commented Apr 19, 2020

(Standard links)

@civibot civibot bot added the master label Apr 19, 2020
@colemanw
Copy link
Member Author

It seems there are a couple non-compliant names in our test suite, like Civi_AllTests.

This change is to allow underscores in class names, which were being misinterpreted as directory separators.
@colemanw
Copy link
Member Author

@totten this seems to work fine if we change the Civi directory but leave tests alone.

@totten totten changed the title dev/core#1684 Use psr-4 autoloader instead of psr-0 dev/core#1684 - Use PSR-4 autoloader instead of PSR-0 for "Civi" namespace Apr 21, 2020
@totten
Copy link
Member

totten commented Apr 21, 2020

(CiviCRM Review Template WORD-1.2)

  • General standards
    • (r-explain) Pass
    • (r-user) Pass
    • (r-doc) Pass
    • (r-run) Pass: Not much to do for this besides running the test suite and doing some click-around on the demo build.
  • Developer standards
    • (r-tech) Pass: This is the main consideration, but this doesn't really change the public interface. If you request a class named Civi\Foo, then you still get the same class. I think if it's problematic, we'd see a problem fairly quick from the tests (either on the PR or in the E2E/Ext matrices).
    • (r-code) Pass: Rah-rah PSR-4!
    • (r-maint) Pass
    • (r-test) Pass

@totten totten merged commit 236ec31 into civicrm:master Apr 21, 2020
@colemanw colemanw deleted the psr-4 branch April 21, 2020 22:06
colemanw added a commit to colemanw/civicrm-core that referenced this pull request Jun 24, 2020
This is a followup to civicrm#17105 which attempted the same thing but without success.
This finally gets classnames with underscores to work correctly in the Civi directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants