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
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
140
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
3
1.5k
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
170
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
230
型も通る、synthも通る、それでも危ない 〜AIのCDKの権限とコストを機械で検証する〜 / It Passes Type Checks, It Passes Synth Checks, but It’s Still Risky — Automatically Verifying Permissions and Costs in AI’s CDK —
seike460
PRO
1
350
継続モナドとリアクティブプログラミング
yukikurage
3
610
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
260
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
100
分散システム、なんですぐ死んでしまうん?耐障害性を高めたいあなたのためのレジリエンスパターン入門
mshibuya
7
6.3k
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
170
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
330
광주소프트웨어마이스터고등학교 DevFest 특강 - 바이브 코딩 시대에서 주니어 개발자로 살아남는 방법
utilforever
1
140
Featured
See All Featured
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.3k
A designer walks into a library…
pauljervisheath
211
24k
Ruling the World: When Life Gets Gamed
codingconduct
0
280
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
4 Signs Your Business is Dying
shpigford
187
22k
Designing for humans not robots
tammielis
254
26k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.6k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
220
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
HDC tutorial
michielstock
2
750
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
150
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શʹཧղͨ͠ʂ