diff --git a/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php b/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php index 9ec8512d13db..f626187b069b 100644 --- a/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php +++ b/src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php @@ -205,9 +205,9 @@ protected function resolveImplicitBindingIfPossible($key, $value, $callbackParam continue; } - $instance = new Reflector::getParameterClassName($parameter); + $className = Reflector::getParameterClassName($parameter); - if (! $model = $instance->resolveRouteBinding($value)) { + if (is_null($model = (new $className)->resolveRouteBinding($value))) { throw new AccessDeniedHttpException; } diff --git a/src/Illuminate/Container/Util.php b/src/Illuminate/Container/Util.php index 9482bc22a742..86dac5b9b39c 100644 --- a/src/Illuminate/Container/Util.php +++ b/src/Illuminate/Container/Util.php @@ -44,10 +44,10 @@ public static function unwrapIfClosure($value) * @param \ReflectionParameter $parameter * @return string|null */ - public function getParameterClassName($parameter) + public static function getParameterClassName($parameter) { $type = $parameter->getType(); - return ($type && !$type->isBuiltin()) ? $type->getName() : null; + return ($type && ! $type->isBuiltin()) ? $type->getName() : null; } } diff --git a/src/Illuminate/Support/Reflector.php b/src/Illuminate/Support/Reflector.php index 0068add2488e..a38fed71bed8 100644 --- a/src/Illuminate/Support/Reflector.php +++ b/src/Illuminate/Support/Reflector.php @@ -12,11 +12,11 @@ class Reflector * @param \ReflectionParameter $parameter * @return string|null */ - public function getParameterClassName($parameter) + public static function getParameterClassName($parameter) { $type = $parameter->getType(); - return ($type && !$type->isBuiltin()) ? $type->getName() : null; + return ($type && ! $type->isBuiltin()) ? $type->getName() : null; } /** @@ -26,12 +26,12 @@ public function getParameterClassName($parameter) * @param string $className * @return bool */ - public function isParameterSubclassOf($parameter, $className) + public static function isParameterSubclassOf($parameter, $className) { $paramClassName = static::getParameterClassName($parameter); return ($paramClassName && class_exists($paramClassName)) - ? new ReflectionClass($paramClassName)->isSubclassOf($className) + ? (new ReflectionClass($paramClassName))->isSubclassOf($className) : false; } }