From fef56c7633eb0c12be0a1a4b14c914eef257232f Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Tue, 3 Apr 2018 11:24:23 -0400 Subject: [PATCH] Fix #639 - add scalar to psalm-recognised types --- src/Psalm/Type.php | 2 ++ tests/ReturnTypeTest.php | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/Psalm/Type.php b/src/Psalm/Type.php index e48c06293..503ec0710 100644 --- a/src/Psalm/Type.php +++ b/src/Psalm/Type.php @@ -38,6 +38,7 @@ abstract class Type 'float' => true, 'bool' => true, 'false' => true, + 'true' => true, 'object' => true, 'empty' => true, 'callable' => true, @@ -55,6 +56,7 @@ abstract class Type 'void' => true, 'self' => true, 'static' => true, + 'scalar' => true, ]; /** diff --git a/tests/ReturnTypeTest.php b/tests/ReturnTypeTest.php index 5753420e1..bffba026c 100644 --- a/tests/ReturnTypeTest.php +++ b/tests/ReturnTypeTest.php @@ -507,6 +507,30 @@ class ReturnTypeTest extends TestCase return $arr; }', ], + 'namespacedScalarParamAndReturn' => [ + '