
This book will show you how to modernize your page-based, include-oriented PHP application by extracting and replacing its legacy artifacts. We will use a step-by-step approach, moving slowly and methodically, to improve your application from the ground up. Each completed step in the process will keep your codebase fully operational with higher quality. Please note that this book is about modernizing in terms of practice and technique, and not in terms of tools. We are not going to discuss the latest, hottest frameworks or libraries. Most of the very limited code we do add to your application is specific to this book. When we are done, you will be able to breeze through your code like the wind. Your code will be fully modernized: autoloaded, dependency-injected, unit-tested, layer-separated, and front-controlled.
Good luck!
It gives examples and goes bit by bit through the process of organizing code.
I'm using its suggestions along with a static checker called Phan, which I chose because it attempts to "prove incorrectness rather than correctness."
It might be worth your time. (Edit: noir_lord also recommended the same book in this thread.)