You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: