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のスカラー型をクラスでラップして便利に使えるようにするライブラリ「Stannum」を作った話
Search
tumugin.myskng
April 11, 2022
1.7k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PHPのスカラー型をクラスでラップして便利に使えるようにするライブラリ「Stannum」を作った話
tumugin.myskng
April 11, 2022
Featured
See All Featured
Design in an AI World
tapps
1
310
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
New Earth Scene 8
popppiees
3
2.6k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
30 Presentation Tips
portentint
PRO
1
390
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Amusing Abliteration
ianozsvald
1
290
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
430
The Curious Case for Waylosing
cassininazir
1
500
Writing Fast Ruby
sferik
630
63k
Transcript
Copyright© M&A PHP Stannum PHPerKaigi 2 0 2 2
Copyright© M&A 2 M&A Twitter: @myskng (Twitter ... ...) GitHub:
@tumugin PHP(Laravel) JavaScript TypeScript(Vue) ( Ruby Kotlin ...)
Copyright© M&A 3
Copyright© M&A 4
Copyright© M&A 5 ) , , , , , ,,
,,, ... string string
Copyright© M&A 6 ( ...) ( UI )
Copyright© M&A Ruby 7 ....? ' , , , ,
, ,, ,,,' .split(',') .filter { |s| !s.strip.empty? } .map { |s| s.strip } .uniq => [" ", " ", " ", " "] PHP ....( )
Copyright© M&A PHP 8 PHP ... $inputTags = ' ,
, , , , ,, ,,,'; $splitTags = explode(',', $inputTags); $splitTagsWithoutEmpty = []; foreach ($splitTags as $tag) { if (trim($tag) !== '') { $splitTagsWithoutEmpty[] = trim($tag); } } $splitTagsWithoutEmptyAndDuplicate = array_unique($splitTagsWithoutEmpty); ...? ....?
Copyright© M&A PHP 9 array_unique( array_map( fn(string $s) => trim($s),
array_filter( explode(',', ' , , , , , ,,, ,,'), fn(string $s) => trim($s) !== '' ) ) ); ...😇 😇 😇
Copyright© M&A 10 🥺🥺🥺
Copyright© M&A 11
Copyright© M&A 12
Copyright© M&A 13
Copyright© M&A 14 extension (nikic/scalar_objects) - ... - PHP
Copyright© M&A 15 RFCs PHP RFC: Autoboxing https://wiki.php.net/rfc/autoboxing PHP RFC:
Class-like Primitive Types https://wiki.php.net/rfc/class-like_primitive_types ...
Copyright© M&A 16 ...🥺🥺
Copyright© M&A 17 ...
Copyright© M&A 18 💡💡💡💡
Copyright© M&A 19
Copyright© M&A 20 ... tumugin/stannum PHP 7 . 4 (
array) float/double integer string Sn => Stannum( )
Copyright© M&A 21 SnString::byString(' , , , , , ,,
,,,') ->split(',') ->filter(fn(SnString $s) => !$s->trim()->isEmpty()) ->map(fn(SnString $s) => $s->trim()) ->distinct() ->toSnStringList() ->toStringArray(); ... PHP
Copyright© M&A 22 PHP ...?
Copyright© M&A ... foreach ...? 23 $sushiList = SnStringList::byStringArray([ '
', ' ', ' ', ' ', ' ', ]); foreach ($sushiList as $sushi) { // something... }
Copyright© M&A __toString() ...? 24 $wantToEatSushi = SnString::byString( ' '
); return "{$wantToEatSushi} "; =>
Copyright© M&A 25
Copyright© M&A 26 composer require tumugin/stannum