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
PHPDocを活用する
Search
Hiroyuki Mito
February 27, 2023
Programming
0
75
PHPDocを活用する
Hiroyuki Mito
February 27, 2023
Tweet
Share
More Decks by Hiroyuki Mito
See All by Hiroyuki Mito
見直したいテーブル設計
hiroyukimito
0
95
Paiza CloudとVS Codeで快適な環境を作ろう! / Let's create a comfortable development environment with Paiza Cloud and Visual Studio Code !
hiroyukimito
0
670
Ruby以外から始めるエンジニア生活 PHP(Laravel)版 / Let's start an engineer other than Ruby !! PHP ver.
hiroyukimito
0
450
Other Decks in Programming
See All in Programming
ぼくの開発環境2026
yuzneri
0
240
2026年 エンジニアリング自己学習法
yumechi
0
140
AI巻き込み型コードレビューのススメ
nealle
2
390
CSC307 Lecture 05
javiergs
PRO
0
500
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
170
Oxlintはいいぞ
yug1224
5
1.3k
CSC307 Lecture 08
javiergs
PRO
0
670
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
590
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
240
CSC307 Lecture 07
javiergs
PRO
0
550
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
710
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
290
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Writing Fast Ruby
sferik
630
62k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
430
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Utilizing Notion as your number one productivity tool
mfonobong
3
220
Technical Leadership for Architectural Decision Making
baasie
1
250
Mobile First: as difficult as doing things right
swwweet
225
10k
Building Adaptive Systems
keathley
44
2.9k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
440
Exploring anti-patterns in Rails
aemeredith
2
250
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Transcript
PHPDocを活⽤する
よく⾒るあのコメント実は +こんなコメントを⾒たことありますよね +/* + * @param int $value + *
@return array $result + */ +public function getData($value) +{ + return $result +}
よく⾒るあの コメント実は PHPDocと呼び、将来の ⾃分⾃⾝や他の開発者に 向けて情報を残します。 意識せずに記述している ⽅も多いのではないで しょうか?
コメントは 増やすべき? 減らすべき? 個⼈の考えですが極⼒コメントは少 なくするべきだと考えています。 その上でわかりやすく必要な情報を 理解できるように補⾜するものとし てコメントを残すことを意識します。 ではどのようにするかと⾔うと PHPDocと呼ばれるDocブロックを
残します。
PHPで型宣⾔って必要? +近年、静的型付け⾔語が流⾏していますがその中で得られる メリットとして主に3点挙げられます。 1. コンパイル時のエラー発⾒ 2. メモリ最適化 3. パフォーマンスの向上
PHPで型宣⾔って必要? +動的型付け、静的型付けそれぞれにメリットがありますが、 PHPを使⽤するメリットを享受しながら、 1. 事前にエラーを発⾒する 2. 他の開発者に使⽤⽤途や意図を伝える +という2点のために私は習慣づけるようになりました。
PHPDocによるメリット IDEによる解析・補完が使⽤できる 実⾏時に宣⾔された型であることを確認する 読み込みに必要な時間を短縮できる