Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PHPのアノテーションの仕組みとメリット・デメリット / About PHP annotations
Search
YAMAOKA Hiroyuki
February 09, 2020
Programming
1
9.3k
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
コードとあなたと私の距離 / The Distance Between Code, You, and I
hiro_y
0
250
エンジニアの「センス」とは何か / What is the sense of engineers
hiro_y
21
9.7k
CSRF対策のやり方、そろそろアップデートしませんか / Update your knowledge of CSRF protection
hiro_y
32
29k
PHPで任意精度演算を行って「正しい」金額計算をする方法 / Perform arbitrary precision arithmetic in PHP to achieve "accurate" monetary calculations
hiro_y
2
3.8k
PHPのバージョンアップ実際のところどうなの? / How actually upgrade of PHP is
hiro_y
3
820
PHPのDI、attributesとこれから / PHP DI with attributes
hiro_y
1
2.6k
株式会社 USEN Media - PHPカンファレンス北海道2019 / 2019-09-21_phpcondo-2019_usen-media
hiro_y
0
310
PHPのmiddlewareを 使いこなすために
hiro_y
4
2.6k
Slim Frameworkで始めるPHPのmiddleware
hiro_y
4
2.3k
Other Decks in Programming
See All in Programming
【CA.ai #3】Google ADKを活用したAI Agent開発と運用知見
harappa80
0
300
How Software Deployment tools have changed in the past 20 years
geshan
0
29k
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
200
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
380
愛される翻訳の秘訣
kishikawakatsumi
1
310
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
700
社内オペレーション改善のためのTypeScript / TSKaigi Hokuriku 2025
dachi023
1
570
MAP, Jigsaw, Code Golf 振り返り会 by 関東Kaggler会|Jigsaw 15th Solution
hasibirok0
0
230
TypeScript 5.9 で使えるようになった import defer でパフォーマンス最適化を実現する
bicstone
1
1.3k
TypeScriptで設計する 堅牢さとUXを両立した非同期ワークフローの実現
moeka__c
6
3k
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
6
300
sbt 2
xuwei_k
0
260
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The Language of Interfaces
destraynor
162
25k
Raft: Consensus for Rubyists
vanstee
141
7.2k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
GitHub's CSS Performance
jonrohan
1032
470k
The World Runs on Bad Software
bkeepers
PRO
72
12k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
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