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

Allow using ::class keyword to load a context. #571

Merged

Conversation

niconoe-
Copy link
Contributor

@niconoe- niconoe- commented Aug 7, 2024

I noticed that you cannot use the ::class keyword on contexts to load them.

I updated the Context loaded to manage it, and upgraded the unit tests in charge.

@kamil-tekiela
Copy link
Contributor

I am not at the computer now so I can't check but where and why do we use short class names? Is it just in the tests?

@niconoe-
Copy link
Contributor Author

niconoe- commented Aug 7, 2024

I am not at the computer now so I can't check but where and why do we use short class names? Is it just in the tests?

That's how the Context loader was built originally: to load the MariaDB 10.7 context for instance, you had to call Context::load('MariaDb100700');.
From external projects using SQL-Parser, it's non-intuitive and using the Context…::class both enhance the DX but also ensures that you are using an existing context.

@MauricioFauth MauricioFauth changed the base branch from 5.9.x to 5.10.x August 25, 2024 17:25
@williamdes williamdes self-assigned this Aug 26, 2024
@williamdes williamdes added this to the 5.10.0 milestone Aug 26, 2024
williamdes added a commit that referenced this pull request Aug 26, 2024
Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes williamdes merged commit 8649874 into phpmyadmin:5.10.x Aug 26, 2024
15 of 17 checks passed
@niconoe- niconoe- deleted the fix/allow-loading-context-via-fqcn branch August 26, 2024 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants