mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Make logic more explicit
This tightens up the rules of 7baea87068e496d83d6afd46fccee699779cb2ad
This commit is contained in:
parent
c70db75d38
commit
78a4067564
@ -449,16 +449,16 @@ class Controller extends Extendable
|
||||
|
||||
/*
|
||||
* If the handler returned an array, we should add it to output for rendering.
|
||||
* If it is a scalar, add it to the array with the key "result".
|
||||
* Otherwise, pass it to Laravel as a response object.
|
||||
* If it is a string, add it to the array with the key "result".
|
||||
* If an object, pass it to Laravel as a response object.
|
||||
*/
|
||||
if (is_array($result)) {
|
||||
$responseContents = array_merge($responseContents, $result);
|
||||
}
|
||||
elseif (is_scalar($result)) {
|
||||
elseif (is_string($result)) {
|
||||
$responseContents['result'] = $result;
|
||||
}
|
||||
elseif ($result !== null) {
|
||||
elseif (is_object($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -648,16 +648,16 @@ class Controller
|
||||
|
||||
/*
|
||||
* If the handler returned an array, we should add it to output for rendering.
|
||||
* If it is a scalar, add it to the array with the key "result".
|
||||
* Otherwise, pass it to Laravel as a response object.
|
||||
* If it is a string, add it to the array with the key "result".
|
||||
* If an object, pass it to Laravel as a response object.
|
||||
*/
|
||||
if (is_array($result)) {
|
||||
$responseContents = array_merge($responseContents, $result);
|
||||
}
|
||||
elseif (is_scalar($result)) {
|
||||
elseif (is_string($result)) {
|
||||
$responseContents['result'] = $result;
|
||||
}
|
||||
elseif ($result !== null) {
|
||||
elseif (is_object($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user