diff --git a/src/Concise/Services/DataTypeChecker.php b/src/Concise/Services/DataTypeChecker.php index d5fa7b37..1703267a 100644 --- a/src/Concise/Services/DataTypeChecker.php +++ b/src/Concise/Services/DataTypeChecker.php @@ -2,6 +2,8 @@ namespace Concise\Services; +use Closure; + class DataTypeChecker { /** @@ -118,7 +120,7 @@ protected function getType($value) if ($this->isAttribute($value)) { return $this->getType($this->getAttribute($value->getValue())); } - if (is_callable($value)) { + if ($value instanceof Closure) { return 'callable'; } diff --git a/tests/Concise/Services/DataTypeCheckerTest.php b/tests/Concise/Services/DataTypeCheckerTest.php index b2f67c59..97948bc1 100644 --- a/tests/Concise/Services/DataTypeCheckerTest.php +++ b/tests/Concise/Services/DataTypeCheckerTest.php @@ -48,6 +48,7 @@ public function dataTypes() array(array("number"), 12.3), array(array("number"), '12.3'), array(array("bool"), true), + array(array("string"), 'count'), ); }