Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
PHPDocを活用する
Search
Hiroyuki Mito
February 27, 2023
Programming
90
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PHPDocを活用する
Hiroyuki Mito
February 27, 2023
Transcript
7 slides
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による解析・補完が使⽤できる 実⾏時に宣⾔された型であることを確認する 読み込みに必要な時間を短縮できる
More Decks by Hiroyuki Mito
See All by Hiroyuki Mito
見直したいテーブル設計
hiroyukimito
0
110
Paiza CloudとVS Codeで快適な環境を作ろう! / Let's create a comfortable development environment with Paiza Cloud and Visual Studio Code !
hiroyukimito
0
740
Ruby以外から始めるエンジニア生活 PHP(Laravel)版 / Let's start an engineer other than Ruby !! PHP ver.
hiroyukimito
0
480
Other Decks in Programming
See All in Programming
Beyond Chatbots: Agentic UI with Open Standards @W-JAX 2026, München
manfredsteyer
PRO
0
130
CQRS+ES実践ガイド書籍紹介 / Introducing CQRS+ES Practical Guide
nrslib
0
100
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
200
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
1.4k
なぜ私たちは「現時点では」KMPの導入を見送ったのか
chigichan24
1
650
SONY CISC-NEWS NWS-1750 + NWB-225 ハードウェアメンテとフレームバッファカラー対応 / KOF2026
tsutsui
0
150
エージェントの管理もエージェントに – herdr-core と自作バックログで作る司令塔 –
nearme_tech
PRO
2
190
Canvas 2D Context Next
petamoriken
1
990
joyful-journey-spring-boot.pdf
hollycummins
0
160
特急いなほ as a Workflow / 20261107jaws-festa-2026-akita-lt
kasacchiful
PRO
0
110
The Cost of the DOM
ypresto
9
4.6k
Math.sumPreciseから学ぶ、ECMAScript仕様の数値の種類
syumai
1
1.7k
Featured
See All Featured
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
From π to Pie charts
rasagy
1
460
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
410
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.3k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
370
How Software Deployment tools have changed in the past 20 years
geshan
3
35k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
480
The Cost Of JavaScript in 2023
addyosmani
56
10k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
990
Mobile First: as difficult as doing things right
swwweet
225
10k