There are six golden rules in php to maintain large project.
- In a single php file, we never write more than one class at a time. Out of the scope of that class, we will not write any procedural code.
2. We will save any class with a proper naming convention. For example we
will save the file where we place the Emailer class introduced earlier in this
chapter as class.emailer.php. What benefits can you achieve using this
naming convention? Well, without going inside that file, you are now at least
confirmed that this file contains a class named “Emailer”.
3. Never mix the case in filenames. It creates ugly application structure.
Go ahead with all small letters.
4. Like classes, we will save any interface as interface.name.php , Abstract Abstract
class as abstract.name.php, and Final class as and Final class as final.name.php.
We will always use Camel case while naming our classes. And that means
the first letters of the major part is always a capital letter and the rest are
small letter. For example a class named “arrayobject” will be more readable if
we write ArrayObject.
5. While writing the name of properties or class variables, we will follow the
6. While writing the name of a method, we will start with a small letter and
then the rest are camel case. For example, a method to send an email could be
named as sendEmail.
- PHP OOP Tutorial: What is Object Oriented Programming and How Does it Work (udemy.com)
- A simple question please help (daniweb.com)