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

Refactor Namespaces + Autoloader, Move Many Files #271

Closed
dac514 opened this issue Oct 16, 2015 · 1 comment
Closed

Refactor Namespaces + Autoloader, Move Many Files #271

dac514 opened this issue Oct 16, 2015 · 1 comment
Assignees

Comments

@dac514
Copy link
Contributor

dac514 commented Oct 16, 2015

When Namespaces were first introduced in PB back in 2012 we had to fudge a way to make a compromise between our existing legacy code already in place + WP file naming conventions.

Looking at the PB code today we no longer have any code that isn't namespaced yet we are still far from the standards:

Our code should be refactored to better follow the PSR recommendations. Our current Autloader looks for \Pressbooks files in multiple places. This is not standard. Files should be changed & moved so that loading is unambiguous.

For example, according to the PSR (minus the file naming which is a WP standard that conflicts with the PSR standard, but what are you gonna do?) the class \PressBooks\Network_Managers_List_Table should be in /includes/class-pb-network-managers-list-table.php It is not. It is currently In /admin/class-pb-network-managers-list-table.php

In the refactoring effort proposed by this ticket, this Class would be changed to \PressBooks\Admin\Network_Managers_List_Table and the file would be located in /includes/admin/class-pb-network-managers-list-table.php

@dac514
Copy link
Contributor Author

dac514 commented Oct 16, 2015

PS: It is implied by this ticket that /shortcodes/ would be moved to /includes/shortcodes/ and so on.

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

No branches or pull requests

1 participant