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

Commit3eea010

Browse files
Fixed a bug when working with text values like function names
1 parentd9b6069 commit3eea010

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

‎src/Concerns/Call.php‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ trait Call
1010

1111
protectedfunctioncall(mixed$callback =null):mixed
1212
{
13-
return$this->isCallable($callback) ?$callback() :$callback;
13+
return$this->isCallable($callback)&& !$this->isFunction($callback)?$callback() :$callback;
1414
}
1515

1616
protectedfunctionmakeCallable($value):callable
1717
{
18-
if ($this->isCallable($value)) {
18+
if ($this->isCallable($value) && !$this->isFunction($value)) {
1919
return$value;
2020
}
2121

@@ -28,4 +28,9 @@ protected function isCallable($value): bool
2828
{
2929
returnis_callable($value);
3030
}
31+
32+
protectedfunctionisFunction($value):bool
33+
{
34+
returnis_string($value) &&function_exists($value);
35+
}
3136
}

‎tests/TestCase.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ abstract class TestCase extends BaseTestCase
2828

2929
protectedarray$keys = ['Foo','Bar','Baz'];
3030

31-
protectedmixed$value ='Foo';
31+
protectedmixed$value ='value';
3232

33-
protectedstring$value_second ='Bar';
33+
protectedstring$value_second ='Foo';
3434

3535
protectedfunctiongetPackageProviders($app):array
3636
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp