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
YAMAOKA Hiroyuki
February 09, 2020
Programming
1
8.1k
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
エンジニアの「センス」とは何か / What is the sense of engineers
hiro_y
19
8k
CSRF対策のやり方、そろそろアップデートしませんか / Update your knowledge of CSRF protection
hiro_y
28
23k
PHPで任意精度演算を行って「正しい」金額計算をする方法 / Perform arbitrary precision arithmetic in PHP to achieve "accurate" monetary calculations
hiro_y
2
2.5k
PHPのバージョンアップ実際のところどうなの? / How actually upgrade of PHP is
hiro_y
3
710
PHPのDI、attributesとこれから / PHP DI with attributes
hiro_y
1
2.1k
株式会社 USEN Media - PHPカンファレンス北海道2019 / 2019-09-21_phpcondo-2019_usen-media
hiro_y
0
190
PHPのmiddlewareを 使いこなすために
hiro_y
3
2.3k
Slim Frameworkで始めるPHPのmiddleware
hiro_y
4
2k
Node.jsやPHPでも こわくないHeroku
hiro_y
1
1.5k
Other Decks in Programming
See All in Programming
Vertical Architectures for Scalable Angular Applications
manfredsteyer
PRO
0
290
[PyCon Korea 2024 Keynote] 커뮤니티와 파이썬, 그리고 우리
beomi
0
110
組織に自動テストを書く文化を根付かせる戦略(2024秋版) / Building Automated Test Culture 2024 Autumn Edition
twada
PRO
10
4.3k
Re:proS_案内資料
rect
0
260
ECSのサービス間通信 4つの方法を比較する 〜Canary,Blue/Greenも添えて〜
tkikuc
10
2.2k
PagerDuty を軸にした On-Call 構築と運用課題の解決 / PagerDuty Japan Community Meetup 4
horimislime
1
100
のびしろを広げる巻き込まれ力:偶然を活かすキャリアの作り方/oso2024
takahashiikki
1
350
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
0
120
Synchronizationを支える技術
s_shimotori
1
140
デプロイを任されたので、教わった通りにデプロイしたら障害になった件 ~俺のやらかしを越えてゆけ~
techouse
50
31k
The future of development – Are our jobs getting harder or easier?
hollycummins
1
240
/←このスケジュール表に立ち向かう フロントエンド開発戦略 / A front-end development strategy to tackle a single-slash schedule.
nrslib
1
580
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
106
49k
Automating Front-end Workflow
addyosmani
1365
200k
[RailsConf 2023] Rails as a piece of cake
palkan
51
4.8k
The Cult of Friendly URLs
andyhume
78
6k
Designing Experiences People Love
moore
138
23k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Intergalactic Javascript Robots from Outer Space
tanoku
268
27k
Building Your Own Lightsaber
phodgson
102
6k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
770
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Producing Creativity
orderedlist
PRO
341
39k
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