Skip to content

Commit 4f2db32

Browse files
committed
Fix stan
1 parent 3cd1ddd commit 4f2db32

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Utilities/Helper.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
namespace Yajra\DataTables\Utilities;
44

5+
use Closure;
56
use DateTime;
67
use Illuminate\Contracts\Support\Arrayable;
78
use Illuminate\Support\Arr;
89
use Illuminate\Support\Str;
10+
use ReflectionFunction;
911

1012
class Helper
1113
{
@@ -58,15 +60,16 @@ protected static function isItemOrderInvalid($item, $array)
5860
* @param array $data data to use with blade template
5961
* @param array|object $param parameter to call with callable
6062
* @return mixed
63+
* @throws \ReflectionException
6164
*/
6265
public static function compileContent($content, array $data, array|object $param)
6366
{
6467
if (is_string($content)) {
6568
return static::compileBlade($content, static::getMixedValue($data, $param));
6669
}
6770

68-
if (is_callable($content)) {
69-
$reflection = new \ReflectionFunction($content);
71+
if ($content instanceof Closure) {
72+
$reflection = new ReflectionFunction($content);
7073
$arguments = $reflection->getParameters();
7174

7275
if (count($arguments) > 0) {

0 commit comments

Comments
 (0)