The difficulty of extracting includes to their own classes depends on the number and complexity of the include
calls remaining in our class files. If there are very few includes and they are relatively simple, the process will be easy to complete. If there are many complex interdependent includes, the process will be relatively difficult to work through.
In general, the process is as follows:
Search the
classes/
directory for aninclude
call in a class.For that
include
call, search the entire codebase to find how many times the included file is used.If the included file is used only once, and only in that one class:
Copy the contents of the included file code as-is directly over the
include
call.Test the modified class, and delete the include file.
Refactor the copied code so that it follows all our existing rules: no globals, no
new
, inject dependencies, return instead of output, and noinclude
calls.
If the included file is used more than once:
Copy the contents of the...