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
PHPのアノテーションの仕組みとメリット・デメリット / About PHP annotations
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
YAMAOKA Hiroyuki
February 09, 2020
Programming
1
9.6k
PHPのアノテーションの仕組みとメリット・デメリット / About PHP annotations
2020年2月9日、PHPerKaigi 2020・Day 0での発表資料です。
https://phperkaigi.jp/2020/
YAMAOKA Hiroyuki
February 09, 2020
Tweet
Share
More Decks by YAMAOKA Hiroyuki
See All by YAMAOKA Hiroyuki
『タイタン』 - PHPer Book Revue
hiro_y
0
71
コードとあなたと私の距離 / The Distance Between Code, You, and I
hiro_y
0
350
エンジニアの「センス」とは何か / What is the sense of engineers
hiro_y
21
9.8k
CSRF対策のやり方、そろそろアップデートしませんか / Update your knowledge of CSRF protection
hiro_y
32
30k
PHPで任意精度演算を行って「正しい」金額計算をする方法 / Perform arbitrary precision arithmetic in PHP to achieve "accurate" monetary calculations
hiro_y
2
4.1k
PHPのバージョンアップ実際のところどうなの? / How actually upgrade of PHP is
hiro_y
3
840
PHPのDI、attributesとこれから / PHP DI with attributes
hiro_y
1
2.7k
株式会社 USEN Media - PHPカンファレンス北海道2019 / 2019-09-21_phpcondo-2019_usen-media
hiro_y
0
330
PHPのmiddlewareを 使いこなすために
hiro_y
4
2.6k
Other Decks in Programming
See All in Programming
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
220
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
1.1k
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
610
CSC307 Lecture 15
javiergs
PRO
0
260
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
150
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
16
3.3k
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
160
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
530
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
170
仕様漏れ実装漏れをなくすトレーサビリティAI基盤のご紹介
orgachem
PRO
7
2.9k
CSC307 Lecture 14
javiergs
PRO
0
480
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
490
Featured
See All Featured
Designing for Timeless Needs
cassininazir
0
170
The browser strikes back
jonoalderson
0
820
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
160
For a Future-Friendly Web
brad_frost
183
10k
Building AI with AI
inesmontani
PRO
1
810
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
300
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
150
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Optimising Largest Contentful Paint
csswizardry
37
3.6k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Design in an AI World
tapps
0
180
Transcript
PHP 2020 2 9 / PHPerKaigi Day
- / @hiro_y - PHP Node.js - PHP 3 -
- - CTO - - iruca mimemo -
PHP
- PHP 2019 - PHP middleware https://speakerdeck.com/hiro_y/phpfalsemiddlewarewo-shi-ikonasutameni - middleware PSR-
& -
- - - -
None
None
PHP /** * @param string $input * @param int $expectedLength
* @testWith ["test", 4]["longer-string", 13] */ public function testStringLength(string $input, int $expectedLength): void { $this->assertEquals($expectedLength, \strlen($input)); }
- - -
Java
Java : Javadoc /** * αϯϓϧΫϥε * @author Hiroyuki YAMAOKA
* @version 1.0 */ public class Sample { /** * @param width ෯ * @param height ߴ͞ */ public void setSize(int width, int height) { } }
Javadoc - javadoc API -
java.lang.Annotation - : - : XDoclet - Java SE java.lang.Annotation
-
: Servlet @WebServlet(urlPatterns = {"/hello"}) public class HelloServlet extends HttpServlet
{ @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // ॲཧΛॻ͘… } }
:
Java annotation - AOP - annotation -
PHP
PHPDoc - phpDocumentator https://www.phpdoc.org/ - Javadoc PHP - PhpStorm IDE
- Phan PHPStan
: PHPDoc /** * ച্ֹΛܭࢉ͢Δɻ * * @param int $price
୯Ձ * @param int $unit ചΕͨݸ * @return int ച্ֹ */ public function int calcSales(int $price, int $unit): int {
: PSR- & - PSR- PHPDoc Standard (DRAFT) https://github.com/php- g/
g-standards/blob/master/proposed/phpdoc.md - PSR- PHPDoc tags (DRAFT) https://github.com/php- g/ g-standards/blob/master/proposed/phpdoc-tags.md
PSR- & - 2018 PHPDoc PSR- - Qiita https://qiita.com/tadsan/items/ b
d ca d - PSR- : PHPDoc tags - BASE https://devblog.thebase.in/entry/ / / /
PSR - PHPDoc - - IDE - PhpStorm Phan PHPStan
- DRAFT OK
- - PHPDoc: -
: PHPUnit - @test https://phpunit.readthedocs.io/en/ . /writing-tests-for-phpunit.html - @depends -
@before @after @beforeClass @afterClass - xture
: PHPUnit - @dataProvider - - @testWith - dataProvider
: Symfony (core) - Creating Routes as Annotations https://symfony.com/doc/current/routing.html#creating-routes-as- annotations
-
: SensioFrameworkExtraBundle - Symfony https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html
: LaravelCollective/annotations - Laravel https://github.com/laravelcollective/annotations
: BEAR.Sunday - Ray.DI Ray.Aop https://bearsunday.github.io/manuals/ . /ja/di.html
PHP - Re ection API https://www.php.net/manual/ja/book.re ection.php - Re ectionClass::getDocComment
- - : Doctrine/annotations https://github.com/doctrine/annotations
- PHP - - - Ray.Aop
- OK - - -
- - -
- - PHP - OPcache https://www.php.net/manual/ja/book.opcache.php - opcache.preload 7.4
None
: PHP DocComment
- : - :
None