René's URL Explorer Experiment


Title: GitHub - php-cpm/clean-code-php: :bathtub: PHP版的代码整洁之道 中文翻译

Open Graph Title: GitHub - php-cpm/clean-code-php: :bathtub: PHP版的代码整洁之道 中文翻译

X Title: GitHub - php-cpm/clean-code-php: :bathtub: PHP版的代码整洁之道 中文翻译

Description: :bathtub: PHP版的代码整洁之道 中文翻译. Contribute to php-cpm/clean-code-php development by creating an account on GitHub.

Open Graph Description: :bathtub: PHP版的代码整洁之道 中文翻译. Contribute to php-cpm/clean-code-php development by creating an account on GitHub.

X Description: :bathtub: PHP版的代码整洁之道 中文翻译. Contribute to php-cpm/clean-code-php development by creating an account on GitHub.

Opengraph URL: https://github.com/php-cpm/clean-code-php

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository
route-controllerfiles
route-actiondisambiguate
fetch-noncev2:9b906664-7d71-0d5c-e5fb-7ca33ee4718a
current-catalog-service-hashf3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb
request-idA3C2:350F6F:5E72A7:84B767:696F3ACD
html-safe-nonce750fa6fd64a3101fbb2018ae7aff8d77b6e28c1f61abcfeac0f1bdaae0e81c09
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0MyOjM1MEY2Rjo1RTcyQTc6ODRCNzY3OjY5NkYzQUNEIiwidmlzaXRvcl9pZCI6Ijg2NDYxNzM4MDYwNzU3ODc5ODEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd771fde886ff31775e6496e109f4e553a220a1ee89816cdf4990238a012f5879
hovercard-subject-tagrepository:102061086
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location//
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/php-cpm/clean-code-php
twitter:imagehttps://opengraph.githubassets.com/1d46df866ad534ddde40ae659de3a5df6baa91c268bf23917d7ed15ac4ba2728/php-cpm/clean-code-php
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1d46df866ad534ddde40ae659de3a5df6baa91c268bf23917d7ed15ac4ba2728/php-cpm/clean-code-php
og:image:alt:bathtub: PHP版的代码整洁之道 中文翻译. Contribute to php-cpm/clean-code-php development by creating an account on GitHub.
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb278ad162d35332b6de714dfb005de04386c4d92df6475522bef910f491a35ee
turbo-cache-controlno-preview
go-importgithub.com/php-cpm/clean-code-php git https://github.com/php-cpm/clean-code-php.git
octolytics-dimension-user_id14024606
octolytics-dimension-user_loginphp-cpm
octolytics-dimension-repository_id102061086
octolytics-dimension-repository_nwophp-cpm/clean-code-php
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forktrue
octolytics-dimension-repository_parent_id79765695
octolytics-dimension-repository_parent_nwoyangweijie/clean-code-php
octolytics-dimension-repository_network_root_id79111500
octolytics-dimension-repository_network_root_nwopiotrplenik/clean-code-php
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release39aed5006635ab6f45e6b77d23e73b08a00272a3
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/php-cpm/clean-code-php#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fphp-cpm%2Fclean-code-php
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fphp-cpm%2Fclean-code-php
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E&source=header-repo&source_repo=php-cpm%2Fclean-code-php
Reloadhttps://github.com/php-cpm/clean-code-php
Reloadhttps://github.com/php-cpm/clean-code-php
Reloadhttps://github.com/php-cpm/clean-code-php
php-cpm https://github.com/php-cpm
clean-code-phphttps://github.com/php-cpm/clean-code-php
yangweijie/clean-code-phphttps://github.com/yangweijie/clean-code-php
Notifications https://github.com/login?return_to=%2Fphp-cpm%2Fclean-code-php
Fork 153 https://github.com/login?return_to=%2Fphp-cpm%2Fclean-code-php
Star 771 https://github.com/login?return_to=%2Fphp-cpm%2Fclean-code-php
MIT license https://github.com/php-cpm/clean-code-php/blob/master/LICENSE
771 stars https://github.com/php-cpm/clean-code-php/stargazers
2.3k forks https://github.com/php-cpm/clean-code-php/forks
Branches https://github.com/php-cpm/clean-code-php/branches
Tags https://github.com/php-cpm/clean-code-php/tags
Activity https://github.com/php-cpm/clean-code-php/activity
Star https://github.com/login?return_to=%2Fphp-cpm%2Fclean-code-php
Notifications https://github.com/login?return_to=%2Fphp-cpm%2Fclean-code-php
Code https://github.com/php-cpm/clean-code-php
Pull requests 0 https://github.com/php-cpm/clean-code-php/pulls
Actions https://github.com/php-cpm/clean-code-php/actions
Projects 0 https://github.com/php-cpm/clean-code-php/projects
Wiki https://github.com/php-cpm/clean-code-php/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/php-cpm/clean-code-php/security
Please reload this pagehttps://github.com/php-cpm/clean-code-php
Insights https://github.com/php-cpm/clean-code-php/pulse
Code https://github.com/php-cpm/clean-code-php
Pull requests https://github.com/php-cpm/clean-code-php/pulls
Actions https://github.com/php-cpm/clean-code-php/actions
Projects https://github.com/php-cpm/clean-code-php/projects
Wiki https://github.com/php-cpm/clean-code-php/wiki
Security https://github.com/php-cpm/clean-code-php/security
Insights https://github.com/php-cpm/clean-code-php/pulse
Brancheshttps://github.com/php-cpm/clean-code-php/branches
Tagshttps://github.com/php-cpm/clean-code-php/tags
https://github.com/php-cpm/clean-code-php/branches
https://github.com/php-cpm/clean-code-php/tags
31 Commitshttps://github.com/php-cpm/clean-code-php/commits/master/
https://github.com/php-cpm/clean-code-php/commits/master/
.github/workflowshttps://github.com/php-cpm/clean-code-php/tree/master/.github/workflows
.github/workflowshttps://github.com/php-cpm/clean-code-php/tree/master/.github/workflows
.gitattributeshttps://github.com/php-cpm/clean-code-php/blob/master/.gitattributes
.gitattributeshttps://github.com/php-cpm/clean-code-php/blob/master/.gitattributes
.gitignorehttps://github.com/php-cpm/clean-code-php/blob/master/.gitignore
.gitignorehttps://github.com/php-cpm/clean-code-php/blob/master/.gitignore
LICENSEhttps://github.com/php-cpm/clean-code-php/blob/master/LICENSE
LICENSEhttps://github.com/php-cpm/clean-code-php/blob/master/LICENSE
README.mdhttps://github.com/php-cpm/clean-code-php/blob/master/README.md
README.mdhttps://github.com/php-cpm/clean-code-php/blob/master/README.md
composer.jsonhttps://github.com/php-cpm/clean-code-php/blob/master/composer.json
composer.jsonhttps://github.com/php-cpm/clean-code-php/blob/master/composer.json
ecs.phphttps://github.com/php-cpm/clean-code-php/blob/master/ecs.php
ecs.phphttps://github.com/php-cpm/clean-code-php/blob/master/ecs.php
READMEhttps://github.com/php-cpm/clean-code-php
MIT licensehttps://github.com/php-cpm/clean-code-php
https://github.com/php-cpm/clean-code-php#clean-code-php
https://github.com/php-cpm/clean-code-php#目录
介绍https://github.com/php-cpm/clean-code-php#%E4%BB%8B%E7%BB%8D
变量https://github.com/php-cpm/clean-code-php#%E5%8F%98%E9%87%8F
使用见字知意的变量名https://github.com/php-cpm/clean-code-php#%E4%BD%BF%E7%94%A8%E8%A7%81%E5%AD%97%E7%9F%A5%E6%84%8F%E7%9A%84%E5%8F%98%E9%87%8F%E5%90%8D
同一个实体要用相同的变量名https://github.com/php-cpm/clean-code-php#%E5%90%8C%E4%B8%80%E4%B8%AA%E5%AE%9E%E4%BD%93%E8%A6%81%E7%94%A8%E7%9B%B8%E5%90%8C%E7%9A%84%E5%8F%98%E9%87%8F%E5%90%8D
使用便于搜索的名称 (part 1)https://github.com/php-cpm/clean-code-php#%E4%BD%BF%E7%94%A8%E4%BE%BF%E4%BA%8E%E6%90%9C%E7%B4%A2%E7%9A%84%E5%90%8D%E7%A7%B0-part-1
使用便于搜索的名称 (part 2)https://github.com/php-cpm/clean-code-php#%E4%BD%BF%E7%94%A8%E4%BE%BF%E4%BA%8E%E6%90%9C%E7%B4%A2%E7%9A%84%E5%90%8D%E7%A7%B0-part-2
使用自解释型变量https://github.com/php-cpm/clean-code-php#%E4%BD%BF%E7%94%A8%E8%87%AA%E8%A7%A3%E9%87%8A%E5%9E%8B%E5%8F%98%E9%87%8F
避免深层嵌套,尽早返回 (part 1)https://github.com/php-cpm/clean-code-php#%E9%81%BF%E5%85%8D%E6%B7%B1%E5%B1%82%E5%B5%8C%E5%A5%97%E5%B0%BD%E6%97%A9%E8%BF%94%E5%9B%9E-part-1
避免深层嵌套,尽早返回 (part 2)https://github.com/php-cpm/clean-code-php#%E9%81%BF%E5%85%8D%E6%B7%B1%E5%B1%82%E5%B5%8C%E5%A5%97%E5%B0%BD%E6%97%A9%E8%BF%94%E5%9B%9E-part-2
少用无意义的变量名https://github.com/php-cpm/clean-code-php#%E5%B0%91%E7%94%A8%E6%97%A0%E6%84%8F%E4%B9%89%E7%9A%84%E5%8F%98%E9%87%8F%E5%90%8D
不要添加不必要上下文https://github.com/php-cpm/clean-code-php#%E4%B8%8D%E8%A6%81%E6%B7%BB%E5%8A%A0%E4%B8%8D%E5%BF%85%E8%A6%81%E4%B8%8A%E4%B8%8B%E6%96%87
表达式https://github.com/php-cpm/clean-code-php#%E8%A1%A8%E8%BE%BE%E5%BC%8F
使用恒等式https://github.com/php-cpm/clean-code-php#%E4%BD%BF%E7%94%A8%E6%81%92%E7%AD%89%E5%BC%8F
Null合并运算符https://github.com/php-cpm/clean-code-php#null%E5%90%88%E5%B9%B6%E8%BF%90%E7%AE%97%E7%AC%A6
函数https://github.com/php-cpm/clean-code-php#%E5%87%BD%E6%95%B0
合理使用参数默认值,没必要在方法里再做默认值检测https://github.com/php-cpm/clean-code-php#%E5%90%88%E7%90%86%E4%BD%BF%E7%94%A8%E5%8F%82%E6%95%B0%E9%BB%98%E8%AE%A4%E5%80%BC%E6%B2%A1%E5%BF%85%E8%A6%81%E5%9C%A8%E6%96%B9%E6%B3%95%E9%87%8C%E5%86%8D%E5%81%9A%E9%BB%98%E8%AE%A4%E5%80%BC%E6%A3%80%E6%B5%8B
函数参数(最好少于2个)https://github.com/php-cpm/clean-code-php#%E5%87%BD%E6%95%B0%E5%8F%82%E6%95%B0-%E6%9C%80%E5%A5%BD%E5%B0%91%E4%BA%8E2%E4%B8%AA
函数应该只做一件事https://github.com/php-cpm/clean-code-php#%E5%87%BD%E6%95%B0%E5%BA%94%E8%AF%A5%E5%8F%AA%E5%81%9A%E4%B8%80%E4%BB%B6%E4%BA%8B
函数名应体现他做了什么事https://github.com/php-cpm/clean-code-php#%E5%87%BD%E6%95%B0%E5%90%8D%E5%BA%94%E4%BD%93%E7%8E%B0%E4%BB%96%E5%81%9A%E4%BA%86%E4%BB%80%E4%B9%88%E4%BA%8B
函数里应当只有一层抽象abstractionhttps://github.com/php-cpm/clean-code-php#%E5%87%BD%E6%95%B0%E9%87%8C%E5%BA%94%E5%BD%93%E5%8F%AA%E6%9C%89%E4%B8%80%E5%B1%82%E6%8A%BD%E8%B1%A1abstraction
不要用flag作为函数的参数https://github.com/php-cpm/clean-code-php#%E4%B8%8D%E8%A6%81%E7%94%A8flag%E4%BD%9C%E4%B8%BA%E5%87%BD%E6%95%B0%E7%9A%84%E5%8F%82%E6%95%B0
避免副作用https://github.com/php-cpm/clean-code-php#%E9%81%BF%E5%85%8D%E5%89%AF%E4%BD%9C%E7%94%A8
不要写全局函数https://github.com/php-cpm/clean-code-php#%E4%B8%8D%E8%A6%81%E5%86%99%E5%85%A8%E5%B1%80%E5%87%BD%E6%95%B0
不要使用单例模式https://github.com/php-cpm/clean-code-php#%E4%B8%8D%E8%A6%81%E4%BD%BF%E7%94%A8%E5%8D%95%E4%BE%8B%E6%A8%A1%E5%BC%8F
封装条件语句https://github.com/php-cpm/clean-code-php#%E5%B0%81%E8%A3%85%E6%9D%A1%E4%BB%B6%E8%AF%AD%E5%8F%A5
避免用反义条件判断https://github.com/php-cpm/clean-code-php#%E9%81%BF%E5%85%8D%E7%94%A8%E5%8F%8D%E4%B9%89%E6%9D%A1%E4%BB%B6%E5%88%A4%E6%96%AD
避免条件判断https://github.com/php-cpm/clean-code-php#%E9%81%BF%E5%85%8D%E6%9D%A1%E4%BB%B6%E5%88%A4%E6%96%AD
避免类型检查 (part 1)https://github.com/php-cpm/clean-code-php#%E9%81%BF%E5%85%8D%E7%B1%BB%E5%9E%8B%E6%A3%80%E6%9F%A5-part-1
避免类型检查 (part 2)https://github.com/php-cpm/clean-code-php#%E9%81%BF%E5%85%8D%E7%B1%BB%E5%9E%8B%E6%A3%80%E6%9F%A5-part-2
移除僵尸代码https://github.com/php-cpm/clean-code-php#%E7%A7%BB%E9%99%A4%E5%83%B5%E5%B0%B8%E4%BB%A3%E7%A0%81
对象和数据结构 Objects and Data Structureshttps://github.com/php-cpm/clean-code-php#%E5%AF%B9%E8%B1%A1%E5%92%8C%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84
使用 getters 和 setters Use object encapsulationhttps://github.com/php-cpm/clean-code-php#%E4%BD%BF%E7%94%A8-getters-%E5%92%8C-setters
给对象使用私有或受保护的成员变量https://github.com/php-cpm/clean-code-php#%E7%BB%99%E5%AF%B9%E8%B1%A1%E4%BD%BF%E7%94%A8%E7%A7%81%E6%9C%89%E6%88%96%E5%8F%97%E4%BF%9D%E6%8A%A4%E7%9A%84%E6%88%90%E5%91%98%E5%8F%98%E9%87%8F
https://github.com/php-cpm/clean-code-php#%E7%B1%BB
少用继承多用组合https://github.com/php-cpm/clean-code-php#%E5%B0%91%E7%94%A8%E7%BB%A7%E6%89%BF%E5%A4%9A%E7%94%A8%E7%BB%84%E5%90%88
避免连贯接口https://github.com/php-cpm/clean-code-php#%E9%81%BF%E5%85%8D%E8%BF%9E%E8%B4%AF%E6%8E%A5%E5%8F%A3
推荐使用 final 类https://github.com/php-cpm/clean-code-php#%E6%8E%A8%E8%8D%90%E4%BD%BF%E7%94%A8-final-%E7%B1%BB
类的SOLID原则 SOLIDhttps://github.com/php-cpm/clean-code-php#solid
S: 单一职责原则 Single Responsibility Principle (SRP)https://github.com/php-cpm/clean-code-php#%E5%8D%95%E4%B8%80%E8%81%8C%E8%B4%A3%E5%8E%9F%E5%88%99
O: 开闭原则 Open/Closed Principle (OCP)https://github.com/php-cpm/clean-code-php#%E5%BC%80%E9%97%AD%E5%8E%9F%E5%88%99
L: 里氏替换原则 Liskov Substitution Principle (LSP)https://github.com/php-cpm/clean-code-php#%E9%87%8C%E6%B0%8F%E6%9B%BF%E6%8D%A2%E5%8E%9F%E5%88%99
I: 接口隔离原则 Interface Segregation Principle (ISP)https://github.com/php-cpm/clean-code-php#%E6%8E%A5%E5%8F%A3%E9%9A%94%E7%A6%BB%E5%8E%9F%E5%88%99
D: 依赖倒置原则 Dependency Inversion Principle (DIP)https://github.com/php-cpm/clean-code-php#%E4%BE%9D%E8%B5%96%E5%80%92%E7%BD%AE%E5%8E%9F%E5%88%99
别写重复代码 (DRY)https://github.com/php-cpm/clean-code-php#%E5%88%AB%E5%86%99%E9%87%8D%E5%A4%8D%E4%BB%A3%E7%A0%81-dry
翻译https://github.com/php-cpm/clean-code-php#%E7%BF%BB%E8%AF%91
https://github.com/php-cpm/clean-code-php#介绍
Clean Codehttps://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882
clean-code-javascripthttps://github.com/ryanmcdermott/clean-code-javascript
https://github.com/php-cpm/clean-code-php#翻译说明
yangweijie版本https://github.com/yangweijie/clean-code-php
clean-code-phphttps://github.com/jupeter/clean-code-php
https://github.com/php-cpm/clean-code-php#变量
https://github.com/php-cpm/clean-code-php#使用见字知意的变量名
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#同一个实体要用相同的变量名
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#使用便于搜索的名称-part-1
https://github.com/php-cpm/clean-code-php#使用便于搜索的名称-part-2
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#使用自解释型变量
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#避免深层嵌套尽早返回-part-1
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#避免深层嵌套尽早返回-part-2
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#少用无意义的变量名
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#不要添加不必要上下文
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#表达式
使用恒等式http://php.net/manual/en/language.operators.comparison.php
https://github.com/php-cpm/clean-code-php#使用恒等式
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#null合并运算符
PHP 7新特性https://www.php.net/manual/en/migration70.new-features.php
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#函数
https://github.com/php-cpm/clean-code-php#合理使用参数默认值没必要在方法里再做默认值检测
type hintinghttp://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#函数参数最好少于2个
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#函数名应体现他做了什么事
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#函数里应当只有一层抽象abstraction
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#不要用flag作为函数的参数
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#避免副作用
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#不要写全局函数
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#不要使用单例模式
反模式https://en.wikipedia.org/wiki/Singleton_pattern
code smellhttps://en.wikipedia.org/wiki/Code_smell
单一响应原则https://github.com/php-cpm/clean-code-php/blob/master
single responsibility principlehttps://github.com/php-cpm/clean-code-php#single-responsibility-principle-srp
coupledhttps://en.wikipedia.org/wiki/Coupling_%28computer_programming%29
http://misko.hevery.com/2008/08/25/root-cause-of-singletons/)的文章,是http://misko.hevery.com/2008/08/25/root-cause-of-singletons/)的文章,是
Misko Heveryhttp://misko.hevery.com/about/
DSNhttp://php.net/manual/en/pdo.construct.php#refsect1-pdo.construct-parameters
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#封装条件语句
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#避免用反义条件判断
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#避免条件判断
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#避免类型检查-part-1
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#避免类型检查-part-2
类型声明http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#移除僵尸代码
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#对象和数据结构
https://github.com/php-cpm/clean-code-php#使用-getters-和-setters
开闭原则https://github.com/php-cpm/clean-code-php#%E5%BC%80%E9%97%AD%E5%8E%9F%E5%88%99
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#给对象使用私有或受保护的成员变量
Jenga effecthttp://www.urbandictionary.com/define.php?term=Jengaphobia&defid=2494196
博客文章http://fabien.potencier.org/pragmatism-over-theory-protected-vs-private.html
Fabien Potencierhttps://github.com/fabpot
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#类
https://github.com/php-cpm/clean-code-php#少用继承多用组合
设计模式https://en.wikipedia.org/wiki/Design_Patterns
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#避免连贯接口
连贯接口Fluent interfacehttps://en.wikipedia.org/wiki/Fluent_interface
方法链Method chaininghttps://en.wikipedia.org/wiki/Method_chaining
PHPUnit Mock Builderhttps://phpunit.de/manual/current/en/test-doubles.html
Doctrine Query Builderhttp://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/query-builder.html
PHPUnit Mock Builderhttps://phpunit.de/manual/current/en/test-doubles.html
Doctrine Query Builderhttp://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/query-builder.html
对象封装https://en.wikipedia.org/wiki/Encapsulation_%28object-oriented_programming%29
装饰器模式https://en.wikipedia.org/wiki/Decorator_pattern
mockhttps://en.wikipedia.org/wiki/Mock_object
连贯接口为什么不好https://ocramius.github.io/blog/fluent-interfaces-are-evil/
Marco Pivettahttps://github.com/Ocramius
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#推荐使用-final-类
组合https://github.com/php-cpm/clean-code-php#%E5%B0%91%E7%94%A8%E7%BB%A7%E6%89%BF%E5%A4%9A%E7%94%A8%E7%BB%84%E5%90%88
单一职责模式https://github.com/php-cpm/clean-code-php#%E5%8D%95%E4%B8%80%E8%81%8C%E8%B4%A3%E6%A8%A1%E5%BC%8F
the blog posthttps://ocramius.github.io/blog/when-to-declare-classes-final/
Marco Pivetta (Ocramius)https://ocramius.github.io/
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#solid
S: 单一职责原则 (SRP)https://github.com/php-cpm/clean-code-php#%E8%81%8C%E8%B4%A3%E5%8E%9F%E5%88%99
O: 开闭原则 (OCP)https://github.com/php-cpm/clean-code-php#%E5%BC%80%E9%97%AD%E5%8E%9F%E5%88%99
L: 里氏替换原则 (LSP)https://github.com/php-cpm/clean-code-php#%E9%87%8C%E6%B0%8F%E6%9B%BF%E6%8D%A2%E5%8E%9F%E5%88%99
I: 接口隔离原则 (ISP)https://github.com/php-cpm/clean-code-php#%E6%8E%A5%E5%8F%A3%E9%9A%94%E7%A6%BB%E5%8E%9F%E5%88%99
D: 依赖倒置原则 (DIP)https://github.com/php-cpm/clean-code-php#%E4%BE%9D%E8%B5%96%E5%80%92%E7%BD%AE%E5%8E%9F%E5%88%99
https://github.com/php-cpm/clean-code-php#单一职责原则
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#开闭原则
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#里氏替换原则
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#接口隔离原则
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#依赖倒置原则
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#别写重复代码-dry
DRYhttps://en.wikipedia.org/wiki/Don%27t_repeat_yourself
https://github.com/php-cpm/clean-code-php#%E7%B1%BB
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
https://github.com/php-cpm/clean-code-php#翻译
php-cpm/clean-code-phphttps://github.com/php-cpm/clean-code-php
peter-gribanov/clean-code-phphttps://github.com/peter-gribanov/clean-code-php
fikoborquez/clean-code-phphttps://github.com/fikoborquez/clean-code-php
fabioars/clean-code-phphttps://github.com/fabioars/clean-code-php
jeanjar/clean-code-phphttps://github.com/jeanjar/clean-code-php/tree/pt-br
panuwizzle/clean-code-phphttps://github.com/panuwizzle/clean-code-php
errorname/clean-code-phphttps://github.com/errorname/clean-code-php
viethuongdev/clean-code-phphttps://github.com/viethuongdev/clean-code-php
yujineeee/clean-code-phphttps://github.com/yujineeee/clean-code-php
anilozmen/clean-code-phphttps://github.com/anilozmen/clean-code-php
amirshnll/clean-code-phphttps://github.com/amirshnll/clean-code-php
nayeemdev/clean-code-phphttps://github.com/nayeemdev/clean-code-php
⬆ 返回顶部https://github.com/php-cpm/clean-code-php#%E7%9B%AE%E5%BD%95
Readme https://github.com/php-cpm/clean-code-php#readme-ov-file
MIT license https://github.com/php-cpm/clean-code-php#MIT-1-ov-file
Please reload this pagehttps://github.com/php-cpm/clean-code-php
Activityhttps://github.com/php-cpm/clean-code-php/activity
771 starshttps://github.com/php-cpm/clean-code-php/stargazers
32 watchinghttps://github.com/php-cpm/clean-code-php/watchers
153 forkshttps://github.com/php-cpm/clean-code-php/forks
Report repository https://github.com/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2Fphp-cpm%2Fclean-code-php&report=php-cpm+%28user%29
Releaseshttps://github.com/php-cpm/clean-code-php/releases
Packages 0https://github.com/users/php-cpm/packages?repo_name=clean-code-php
Please reload this pagehttps://github.com/php-cpm/clean-code-php
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.