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
61
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
95
開発体験を爆上げするLaravel Dacapo マイグレーションサポートツールのススメ
ucan_lab
0
1.6k
モテるコードの書き方
ucan_lab
0
280
ターミナルtips
ucan_lab
0
110
ゆうきゃんどっかー のススメ In #TechCafe
ucan_lab
2
280
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
97
Other Decks in Programming
See All in Programming
メールのエイリアス機能を履き違えない
isshinfunada
0
230
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
180
yield再入門 #phpcon
o0h
PRO
0
990
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
490
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
110
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
500
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
550
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
140
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
210
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
150
php-fpmのプロセスが枯渇した日-調査・対処・そして本当にやるべきだったこと-
shibuchaaaan
0
250
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
1.4k
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
690
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.3k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
200
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
460
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Code Review Best Practice
trishagee
74
20k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
A designer walks into a library…
pauljervisheath
211
24k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
640
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શʹཧղͨ͠ʂ