Skip to content

Commit 11cfa4d

Browse files
committed
fixing
1 parent 25a1d76 commit 11cfa4d

File tree

2 files changed

+2
-41
lines changed

2 files changed

+2
-41
lines changed

src/Illuminate/Routing/RouteAction.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static function parse($uri, $action)
2929
// If the action is already a Closure instance, we will just set that instance
3030
// as the "uses" property, because there is nothing else we need to do when
3131
// it is available. Otherwise we will need to find it in the action list.
32-
if (static::isCallable($action)) {
32+
if (Reflector::isCallable($action, true)) {
3333
return ! is_array($action) ? ['uses' => $action] : [
3434
'uses' => $action[0].'@'.$action[1],
3535
'controller' => $action[0].'@'.$action[1],
@@ -74,25 +74,10 @@ protected static function missingAction($uri)
7474
protected static function findCallable(array $action)
7575
{
7676
return Arr::first($action, function ($value, $key) {
77-
return static::isCallable($value) && is_numeric($key);
77+
return Reflector::isCallable($value) && is_numeric($key);
7878
});
7979
}
8080

81-
/**
82-
* Determine if the given action is callable as a route.
83-
*
84-
* @param mixed $action
85-
* @return bool
86-
*/
87-
public static function isCallable($action)
88-
{
89-
if (! is_array($action)) {
90-
return is_callable($action);
91-
}
92-
93-
return isset($action[0], $action[1]) && is_string($action[0]) && is_string($action[1]) && Reflector::isMethodCallable($action[0], $action[1]);
94-
}
95-
9681
/**
9782
* Make an action for an invokable controller.
9883
*

src/Illuminate/Support/Reflector.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,4 @@ public static function isParameterSubclassOf($parameter, $className)
5252
? (new ReflectionClass($paramClassName))->isSubclassOf($className)
5353
: false;
5454
}
55-
56-
/**
57-
* Determine if the class method is callable.
58-
*
59-
* @param string $class
60-
* @param string $method
61-
* @return bool
62-
*/
63-
public static function isMethodCallable($class, $method)
64-
{
65-
if (! class_exists($class)) {
66-
return false;
67-
}
68-
69-
if (method_exists($class, $method)) {
70-
return (new ReflectionMethod($class, $method))->isPublic();
71-
}
72-
73-
if (method_exists($class, '__call')) {
74-
return (new ReflectionMethod($class, '__call'))->isPublic();
75-
}
76-
77-
return false;
78-
}
7955
}

0 commit comments

Comments
 (0)