current location: Home > Download > Learning resources > php e-book > DoitPHP Coding Specifications
DoitPHP Coding Specifications
Classify: Learning materials / php e-book | Release time: 2017-12-12 | visits: 3099953 |
Download: 233 |
Latest Downloads
Fantasy Aquarium
Girls Frontline
Wings of Stars
Little Flower Fairy Fairy Paradise
Restaurant Cute Story
Shanhe Travel Exploration
Love and Producer
The most powerful brain 3
Odd Dust: Damila
Young Journey to the West 2
24 HoursReading Leaderboard
- 1 Is MySQL\'s Profiler a Viable Alternative to SQL Server Profiler for Database Performance Analysis?
- 2 dsimeh.dll - What is dsimeh.dll?
- 3 How to Read a Text File in Golang?
- 4 Why Is CYBRO A Must-Watch Altcoin for Q4 2024
- 5 Should You Fill Gaps in Auto-Increment Fields in Your Database?
- 6 How Can I Implement Named Parameters in JDBC?
- 7 Why Does GCC Reject Explicit Specialization Outside of a Namespace?
- 8 How to Access a FastAPI Backend from a Different Machine on the Same Local Network?
- 9 How to Configure C++ Include Paths and Libraries in VSCode\'s c_cpp_properties.json and task.json?
- 10 Why Does SomeFunction().c_str() Return Garbage Data While str_copy = SomeFunction(); str_copy.c_str(); Works Correctly?
- 11 dxfdll.dll - What is dxfdll.dll?
- 12 How can you set a time limit on user input in Python\'s `raw_input()` function?
- 13 Is std::shared_ptr Enough to Ensure Thread Safety for Your Objects?
- 14 How to Buy Bitcoin in Spain: A Step-by-Step Guide
- 15 How to Integrate Entity Framework 6 with MySQL in Visual Studio 2013 WinForms?
Latest Tutorials
-
- Go language practical GraphQL
- 2080 2024-04-19
-
- 550W fan master learns JavaScript from scratch step by step
- 3510 2024-04-18
-
- Getting Started with MySQL (Teacher mosh)
- 1848 2024-04-07
-
- Mock.js | Axios.js | Json | Ajax--Ten days of quality class
- 2659 2024-03-29
Scope of application Unless otherwise specified, the following rule requirements are fully applicable to DoitPHP projects (Note: Doitphp's PHP framework file, not PHP projects developed using DoitPHP). If you like the following coding standards, you can also use them in other PHP development projects.
The Importance and Benefits of Standardization "No rules, no squares." When the development of a software project adheres to public and consistent standards, the entire team members form and maintain a consistent coding style, and the entire project document is written by one person. Each programmer's code is easy to understand for others, improving the maintainability of the code and thus reducing the maintenance cost of the software. At the same time, new participants can quickly adapt to the environment, thereby maximizing the efficiency of team development cooperation. Long-term standardized coding can also allow developers to develop good coding habits, reduce the chance of coding errors, and even develop more rigorous thinking. The purpose of "documenting" the specifications is to clarify our coding standards. We believe that standards are not the key to project success, but they can help us be more efficient in team collaboration and complete set tasks more smoothly.
PHP coding specifications and principles 1. File format 1.1. File encoding: File encoding is unified to UTF-8 (Note: non-UTF-8 BOM). 1.2. PHP code tags: Use "<?php ?>" at any time to define your PHP code. And "<? ?>" will be prohibited. For code files that only contain PHP, it is recommended to ignore the "?>" at the end of the file to prevent extra spaces or other characters from affecting the code. 1.3. Indentation rules: Use 4 spaces for indentation instead of TAB. This is already the standard in the PHP industry, and we will not "go against the trend of history." The main reason for using spaces is to make the code look neat and tidy. Because in different editors, the length of the TAB tab character is different, but the space is the same. Using TAB can solve the problem by pressing the TAB key, but using spaces requires pressing the space bar four times, which obviously affects development efficiency. At present, many editors default to a TAB occupying four spaces (how many spaces it occupies can be adjusted by the editor). If this is the case, in order to improve development efficiency, you can use TAB with confidence. This indentation specification also applies to functions, classes, logical structures, loops, etc. in JavaScript. 1.4. Code content: No extra spaces or TAB characters are allowed at the end of each line (make sure your editor saves the file in Unix format, which means lines are terminated with newlines). Except for the language pack annotation configuration file, there cannot be Chinese anywhere else. 1.5. Code comments: Files must have clear code comments, and the comment style adopts the phpDocumentor standard