Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/private/AppFramework/Http/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ private function executeController(Controller $controller, string $methodName):
$arguments = [];

// valid types that will be casted
$types = ['int', 'integer', 'bool', 'boolean', 'float'];
$types = ['int', 'integer', 'bool', 'boolean', 'float', 'double'];

foreach ($this->reflector->getParameters() as $param => $default) {

Expand Down
21 changes: 14 additions & 7 deletions tests/lib/AppFramework/Http/DispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ public function __construct($appName, $request) {
/**
* @param int $int
* @param bool $bool
* @param double $foo
* @param int $test
* @param int $test2
* @param integer $test2
* @return array
*/
public function exec($int, $bool, $test = 4, $test2 = 1) {
public function exec($int, $bool, $foo, $test = 4, $test2 = 1) {
$this->registerResponder('text', function ($in) {
return new JSONResponse(['text' => $in]);
});
Expand Down Expand Up @@ -313,7 +314,8 @@ public function testControllerParametersInjected() {
[
'post' => [
'int' => '3',
'bool' => 'false'
'bool' => 'false',
'double' => 1.2,
],
'method' => 'POST'
],
Expand Down Expand Up @@ -344,6 +346,7 @@ public function testControllerParametersInjectedDefaultOverwritten() {
'post' => [
'int' => '3',
'bool' => 'false',
'double' => 1.2,
'test2' => 7
],
'method' => 'POST',
Expand Down Expand Up @@ -375,7 +378,8 @@ public function testResponseTransformedByUrlFormat() {
[
'post' => [
'int' => '3',
'bool' => 'false'
'bool' => 'false',
'double' => 1.2,
],
'urlParams' => [
'format' => 'text'
Expand Down Expand Up @@ -408,7 +412,8 @@ public function testResponseTransformsDataResponse() {
[
'post' => [
'int' => '3',
'bool' => 'false'
'bool' => 'false',
'double' => 1.2,
],
'urlParams' => [
'format' => 'json'
Expand Down Expand Up @@ -441,7 +446,8 @@ public function testResponseTransformedByAcceptHeader() {
[
'post' => [
'int' => '3',
'bool' => 'false'
'bool' => 'false',
'double' => 1.2,
],
'server' => [
'HTTP_ACCEPT' => 'application/text, test',
Expand Down Expand Up @@ -475,7 +481,8 @@ public function testResponsePrimarilyTransformedByParameterFormat() {
[
'post' => [
'int' => '3',
'bool' => 'false'
'bool' => 'false',
'double' => 1.2,
],
'get' => [
'format' => 'text'
Expand Down