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
自作PHPライブラリをリファクタリングした / Refactoring library
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
howyi
December 21, 2018
Programming
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
自作PHPライブラリをリファクタリングした / Refactoring library
社内勉強会で発表したスライドです。
ライブラリ:
https://github.com/howyi/conv
howyi
December 21, 2018
More Decks by howyi
See All by howyi
Go+gRPCで作った次世代店舗の裏側
howyi
1
1.7k
GraphQLを活用するツールやライブラリ / graphql-libraries
howyi
0
110
GraphQLの紹介 / graphql-introduction
howyi
0
96
サーバレスアーキテクチャでSlackBotを作る / serverless-slackbot
howyi
0
92
Amplifyの紹介/amplify-introduction
howyi
0
110
AWS認定を受けた話 / AWS CERTIFIED
howyi
0
98
PhpStormの設定晒す / Customizing PhpStorm
howyi
0
130
ClickUpで始める進捗管理 / ClickUp
howyi
0
540
Other Decks in Programming
See All in Programming
FreeBSDでZabbixを動かす.pdf
kenkino
0
230
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
260
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
140
型解析で実現する Go の言語内 DSL / Conference に Go! タイムテーブルの歩き方 for Gophers
mazrean
0
150
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
140
Are APIs Still Relevant in the AI Era?
soyuka
0
140
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
2.9k
Go のフラットな パッケージに 「ファイル単位の private」を 〜Linter “declscope” を作った話〜
mpyw
0
280
AI × TiDD / 2026.09.05 Redmine 大阪
tokudiro
1
150
Security issues being discussed on Web Platforms
petamoriken
0
910
AHC070解法紹介
eijirou
0
110
Featured
See All Featured
Technical Leadership for Architectural Decision Making
baasie
3
570
The Curious Case for Waylosing
cassininazir
1
510
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
430
Test your architecture with Archunit
thirion
2
2.4k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
850
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
280
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
480
Making Projects Easy
brettharned
120
6.8k
Six Lessons from altMBA
skipperchong
29
4.5k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
700
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
Transcript
ࣗ࡞1)1ϥΠϒϥϦΛϦϑΝΫλϦϯάͨ͠ IPXZJ
ԿͷϥΠϒϥϦΛϦϑΝΫλϦϯά͔ͨ͠ https://github.com/howyi/conv ϚΠάϨʔγϣϯΫΤϦࣗಈੜϥΠϒϥϦ
ԿނϦϑΝΫλ͔ͨ͠ • MySQL5.7ʹରԠ͢Δ͜ͱʹͳͬͨ • MySQL5.6લఏͷΫΤϦੜͩͬͨͨΊɺ5.7ݻ༗ػೳ͕ೖΕΒΕͳ͔ͬͨ • मਖ਼͠Α͏ͱࢥͬͨΒࠜຊ͔Β͞ͳ͍ͱ͍͚ͳ͔ͬͨ ͍ͭͰ͔ͩΒ৭ʑͦ͏
ͬͨ͜ͱ
namespaceͷมߋ • ϕϯμ໊ΛؚΊΔΑ͏ʹͨ͠ Conv/Hoge -> Howyi/Conv/Hoge • composer.jsonͰͷΦʔτϩʔμن͕PSR-0ͩͬͨͷͰɺPSR-4ʹͨ͠
phpcsͷಋೖ • PSR12 • దʹॻ͖͗ͯͨ͢ͷͰमਖ਼͕େมͩͬͨ
makefileΛফͨ͠ composer scriptʹมߋʢ͔ͤͬ͘composerଆʹػೳ͕͋ΔͷͰʣ test: @vendor/bin/phpunit stan: @vendor/bin/phpstan analyse -l 7
-c phpstan.neon src "scripts": { "test": "phpunit", "stan": "phpstan analyse -l 7 src", } Makefile $ make test $ make stan composer.json $ composer test $ composer stan
ςετ༻SQLΛผϦϙδτϦʹΓग़͠ • ৭ʑͳύλʔϯͷSQLΛ༻ҙ͢Δඞཁ͕͋ΔͨΊɺςετ༻SQL͕ଟ͍ • composer require ~ Ͱ͜ͷςετ༻SQL·ͰΞϓϦʹΈࠐ·ΕΔͷͳΜͱͳ͘ؾ࣋ͪѱ͍ • packagistʹ্͛ͣɺcomposer.jsonͰผϦϙδτϦΛࢦఆ͠ɺrequire-dev͍ͯ͠Δ
"repositories": [ { "type": "vcs", "url": "https://github.com/howyi/conv-test-suite.git", "no-api": true } ],
ෳόʔδϣϯDBʹରԠͰ͖ΔΑ͏ߏͷมߋ ۩ମతʹ Structure͕ʮσʔλϕʔεͷදݱʯʮΫΤϦൃߦʯ ͷ2ͭͷΛ͍࣋ͬͯͨͷͰ ɺ ʮΫΤϦൃߦʯΛDriverΫϥεʢ৽نʣͷʹมߋͨ͠ DriverΫϥεDBͷόʔδϣϯʹΑͬͯΓସ͑ΒΕΔ
ෳόʔδϣϯDBʹରԠͨ͠ςετڥ • docker-composeͰରԠόʔδϣϯͷ ίϯςφΛཱͯΔ • phpunitͰɺෳDBʹରͯ͠ಉ͡ςε τΛ࣮ߦͰ͖ΔΑ͏ʹ • docker-compose upͰDBߏங+ςετ
࣮ߦ·Ͱߦ͏
ෳόʔδϣϯDBʹରԠͨ͠CIڥ ରԠલͱେ͖ͳҧ͍ͳ͘ɺมΘͬͨ෦ ʮTravisCI͕docker-composeͰςετΛ࣮ߦ͢Δ༻ʹͳͬͨʯͷΈ TravisCIͰಈ͘ίϯςφ෦͔ΒcoverallsʹΧόϨοδΛ͍͛ͯΔ
͓ΘΓ Photo by 1.Shane Stagner on Unsplash 12.Viviana Rishe on
Unsplash