Slide 1

Slide 1 text

PHP 2020 2 9 / PHPerKaigi Day

Slide 2

Slide 2 text

- / @hiro_y - PHP Node.js - PHP 3 -

Slide 3

Slide 3 text

- - CTO - - iruca mimemo -

Slide 4

Slide 4 text

PHP

Slide 5

Slide 5 text

- PHP 2019 - PHP middleware https://speakerdeck.com/hiro_y/phpfalsemiddlewarewo-shi-ikonasutameni - middleware PSR- & -

Slide 6

Slide 6 text

- - - -

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

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)); }

Slide 10

Slide 10 text

- - -

Slide 11

Slide 11 text

Java

Slide 12

Slide 12 text

Java : Javadoc /** * αϯϓϧΫϥε * @author Hiroyuki YAMAOKA * @version 1.0 */ public class Sample { /** * @param width ෯ * @param height ߴ͞ */ public void setSize(int width, int height) { } }

Slide 13

Slide 13 text

Javadoc - javadoc API -

Slide 14

Slide 14 text

java.lang.Annotation - : - : XDoclet - Java SE java.lang.Annotation -

Slide 15

Slide 15 text

: Servlet @WebServlet(urlPatterns = {"/hello"}) public class HelloServlet extends HttpServlet { @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // ॲཧΛॻ͘… } }

Slide 16

Slide 16 text

:

Slide 17

Slide 17 text

Java annotation - AOP - annotation -

Slide 18

Slide 18 text

PHP

Slide 19

Slide 19 text

PHPDoc - phpDocumentator https://www.phpdoc.org/ - Javadoc PHP - PhpStorm IDE - Phan PHPStan

Slide 20

Slide 20 text

: PHPDoc /** * ച্ֹΛܭࢉ͢Δɻ * * @param int $price ୯Ձ * @param int $unit ചΕͨݸ਺ * @return int ച্ֹ */ public function int calcSales(int $price, int $unit): int {

Slide 21

Slide 21 text

: 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

Slide 22

Slide 22 text

PSR- & - 2018 PHPDoc PSR- - Qiita https://qiita.com/tadsan/items/ b d ca d - PSR- : PHPDoc tags - BASE https://devblog.thebase.in/entry/ / / /

Slide 23

Slide 23 text

PSR - PHPDoc - - IDE - PhpStorm Phan PHPStan - DRAFT OK

Slide 24

Slide 24 text

- - PHPDoc: -

Slide 25

Slide 25 text

: PHPUnit - @test https://phpunit.readthedocs.io/en/ . /writing-tests-for-phpunit.html - @depends - @before @after @beforeClass @afterClass - xture

Slide 26

Slide 26 text

: PHPUnit - @dataProvider - - @testWith - dataProvider

Slide 27

Slide 27 text

: Symfony (core) - Creating Routes as Annotations https://symfony.com/doc/current/routing.html#creating-routes-as- annotations -

Slide 28

Slide 28 text

: SensioFrameworkExtraBundle - Symfony https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html

Slide 29

Slide 29 text

: LaravelCollective/annotations - Laravel https://github.com/laravelcollective/annotations

Slide 30

Slide 30 text

: BEAR.Sunday - Ray.DI Ray.Aop https://bearsunday.github.io/manuals/ . /ja/di.html

Slide 31

Slide 31 text

PHP - Re ection API https://www.php.net/manual/ja/book.re ection.php - Re ectionClass::getDocComment - - : Doctrine/annotations https://github.com/doctrine/annotations

Slide 32

Slide 32 text

- PHP - - - Ray.Aop

Slide 33

Slide 33 text

- OK - - -

Slide 34

Slide 34 text

- - -

Slide 35

Slide 35 text

- - PHP - OPcache https://www.php.net/manual/ja/book.opcache.php - opcache.preload 7.4

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

: PHP DocComment

Slide 38

Slide 38 text

- : - :

Slide 39

Slide 39 text

No content