Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
momochanにも分かるPSR講座
Search
ゆうきゃん
April 08, 2021
Programming
57
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
momochanにも分かるPSR講座
ゆうきゃん
April 08, 2021
More Decks by ゆうきゃん
See All by ゆうきゃん
Svelte Todo アプリハンズオン資料
ucan_lab
0
89
開発体験を爆上げするLaravel Dacapo マイグレーションサポートツールのススメ
ucan_lab
0
1.6k
モテるコードの書き方
ucan_lab
0
270
ターミナルtips
ucan_lab
0
110
ゆうきゃんどっかー のススメ In #TechCafe
ucan_lab
2
270
Laravel Dacapo 2019-09-06 YYPHP 99
ucan_lab
0
300
Laravel + Docker 環境構築ハンズオン
ucan_lab
2
510
Laravel+GraphQL 良かったこと 困ったこと 悲しかったこと
ucan_lab
2
820
バージョン管理ツールについて振り返り
ucan_lab
0
95
Other Decks in Programming
See All in Programming
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
130
광주소프트웨어마이스터고등학교 DevFest 특강 - 바이브 코딩 시대에서 주니어 개발자로 살아남는 방법
utilforever
1
140
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
130
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
260
トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略
ochtum
0
320
地域 SRE コミュニティ最前線 - ホンマでっかSRE勉強会
tk3fftk
0
240
【やさしく解説 設計編・中級 #4】ルールの寿命と、システムの年輪
panda728
PRO
2
140
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
3
1.5k
関数型プログラミングのメリットって何だろう?
wanko_it
0
180
symfony/aiとlaravel/boost
77web
0
130
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
230
はてなアカウント基盤 State of the Union
cockscomb
1
1.3k
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
40k
How to Talk to Developers About Accessibility
jct
2
400
Are puppies a ranking factor?
jonoalderson
1
3.7k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
500
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
260
How to Ace a Technical Interview
jacobian
281
24k
The Limits of Empathy - UXLibs8
cassininazir
1
500
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
390
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
40k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Transcript
momochan ʹ͔ΔPSRߨ࠲ 2021.04.08 ucan-lab in גࣜձࣾϛϥΠτσβΠϯ
None
͓͠ͳ͕͖ • PSRͱ • PHP-FIGͱ • PSRͷࡦఆϓϩηε • PSRҰཡ •
PSRΧςΰϦ • PSRൈਮհ
PSRͱ
PSRͱ • https://www.php- fi g.org/psr • PHP Standards Recommendations •
PHPඪ४ίʔσΟϯάקࠂ • ४ڌ(ڧ੍Ͱͳ͍)
PHP-FIGͱ
PHP-FIGͱ • https://www.php- fi g.org/personnel • PSRͷ࡞Λߦ͍ͬͯΔ • PHPͷϑϨʔϜϫʔΫπʔϧͳͲͷϓϩδΣΫτ։ൃ ऀʹΑͬͯߏ͞Ε͍ͯΔ৫
• CakePHP, Composer, Magento, PEAR, Phalcon, Slim… • SymfonyͱLaravelҙݟ͕߹Θͳ͘ͳͬͯ
ࡦఆϓϩηε
ࡦఆϓϩηε • Pre-Draft (ఏҊ) • Draft (Ҋ) • Review (ධՁ)
• Accepted (ঝೝ) • Deprecated (ඇਪ) • Abandoned (์غ)
PSRҰཡ
PSRҰཡ Accepted (ঝೝ) • PSR-1 Basic Coding StandardʢجຊతͳίʔσΟϯάඪ४ʣ • PSR-3
Logger InterfaceʢϩΨʔΠϯλϑΣʔεʣ • PSR-4 AutoloaderʢΦʔτϩʔμʔʣ • PSR-6 Caching InterfaceʢΩϟογϯάΠϯλʔϑΣΠεʣ • PSR-7 HTTP Message InterfaceʢHTTPϝοηʔδΠϯλʔϑΣΠεʣ • PSR-11 Container InterfaceʢίϯςφΠϯλϑΣʔεʣ • PSR-12 Extended Coding Styleʢ֦ுίʔσΟϯάελΠϧʣ • PSR-13 Hypermedia LinksʢϋΠύʔϝσΟΞϦϯΫʣ • PSR-14 Event DispatcherʢΠϕϯτσΟεύονϟʔʣ • PSR-15 HTTP HandlersʢHTTPϋϯυϥʣ
PSRҰཡ Draft (Ҋ) • PSR-5 PHPDoc Standard (PHPDocඪ४) • PSR-19
PHPDoc tags (PHPDocλά) • PSR-20 Clock (ΫϩοΫ)
PSRҰཡ Deprecated (ඇਪ) • PSR-0ɹAutoloaderʢΦʔτϩʔμʔʣ • PSR-2ɹCoding Style GuideʢίʔσΟϯάε λΠϧΨΠυʣ
PSRҰཡ Abandoned (์غ) • PSR-8 Huggable Interface (ϋάΞϒϧΠϯλʔϑΣ Πε) •
PSR-9 Security Advisories (ηΩϡϦςΟΞυόΠβ Ϧ) • PSR-10 Security Reporting Process (ηΩϡϦςΟϨ ϙʔτϓϩηε)
PSRΧςΰϦ
PSRΧςΰϦ • ΦʔτϩʔσΟϯά(PSR-0, 4) • ΠϯλʔϑΣΠε(PSR-3, 6, 11,13, 14, 16)
• HTTP(PSR-7, 15, 17, 18) • ίʔσΟϯάελΠϧ(PSR-1, 2, 12)
PSRൈਮհ
PSRൈਮհ(PSR-1) • Basic Coding Standard • ϑΝΠϧͰλά <?php ͘͠<?= ͷΈΛ༻͢Δ
• PHPίʔυͷϑΝΠϧͰBOMͳ͠ͷUTF-8ͷΈΛ༻͢Δ • Ϋϥε໊ύεΧϧέʔεͰએݴ͢Δ • ΫϥεఆɺશͯେจࣈͰΞϯμʔείΞ۠ΓΛར༻ͯ͠એ ݴ͢Δ • ϝιου໊ΩϟϝϧέʔεͰએݴ͢Δ
PSRൈਮհ(PSR-12, PSR-2) • Extended Coding Style Guide • PSR-2 ͷίʔσΟϯάελΠϧΨΠυͷ֦ுͱͳΔ
• શͯͷ PHP ϑΝΠϧɺUnix LFʢϥΠϯϑΟʔυʣͷߦͷΈΛ༻ ͢Δ • શͯͷ PHP ϑΝΠϧɺۭനҎ֎ͷߦͰऴΘΓɺ୯Ұͷ LF Ͱऴྃ͢Δ • PHP ͷΈΛؚΉϑΝΠϧͰɺऴྃλάΛলུ͢Δ • ΠϯσϯτϨϕϧ͝ͱʹ̐ͭͷεϖʔεͷΠϯσϯτΛ༻͢Δ
PSRൈਮհ(PSR-20) • ClockInterface • ࣌ؒૢ࡞ܥͷΠϯλʔϑΣʔεʢݱࡏDraftதʣ • ݱࡏͷ࣌ؒʹґଘ͢ΔίʔυΛςετ͢Δͱ͖ʹ૬ޓ ӡ༻ੑΛՄೳʹ͢Δ • ݱࡏͷ࣌ࠁΛऔಘ͢ΔͨΊͷҰ؏ͨ͠ΠϯλʔϑΣΠε
• ࠶ݱੑͷͨΊʹ࣮࣌ؒΛ؆୯ʹෳͰ͖·͢ɻ
͓͠·͍
143શʹཧղͨ͠ʂ