Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commitaec8655

Browse files
committed
Use static callbacks
micro-optimisation
1 parenta053f87 commitaec8655

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

‎src/Word/SeparatorToCamelCase.php‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,25 @@ public function filter($value)
3535
];
3636
if (!extension_loaded('mbstring')) {
3737
$replacements = [
38-
function ($matches) {
38+
// @codingStandardsIgnoreStart
39+
staticfunction ($matches) {
3940
returnstrtoupper($matches[2]);
4041
},
41-
function ($matches) {
42+
staticfunction ($matches) {
4243
returnstrtoupper($matches[1]);
4344
},
45+
// @codingStandardsIgnoreEnd
4446
];
4547
}else {
4648
$replacements = [
47-
function ($matches) {
49+
// @codingStandardsIgnoreStart
50+
staticfunction ($matches) {
4851
returnmb_strtoupper($matches[2],'UTF-8');
4952
},
50-
function ($matches) {
53+
staticfunction ($matches) {
5154
returnmb_strtoupper($matches[1],'UTF-8');
5255
},
56+
// @codingStandardsIgnoreEnd
5357
];
5458
}
5559
}else {
@@ -58,12 +62,14 @@ function ($matches) {
5862
'#(^[\S]{1})#',
5963
];
6064
$replacements = [
61-
function ($matches) {
65+
// @codingStandardsIgnoreStart
66+
staticfunction ($matches) {
6267
returnstrtoupper($matches[2]);
6368
},
64-
function ($matches) {
69+
staticfunction ($matches) {
6570
returnstrtoupper($matches[1]);
6671
},
72+
// @codingStandardsIgnoreEnd
6773
];
6874
}
6975

‎src/Word/UnderscoreToStudlyCase.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function filter($value)
2222
$lowerCaseFirst ='lcfirst';
2323

2424
if (StringUtils::hasPcreUnicodeSupport() &&extension_loaded('mbstring')) {
25-
$lowerCaseFirst =function ($value) {
25+
$lowerCaseFirst =staticfunction ($value) {
2626
if (0 ===mb_strlen($value)) {
2727
return$value;
2828
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp