From 7f0d68bdf05a2316087fd184c14a32368eda6cf4 Mon Sep 17 00:00:00 2001 From: dantleech Date: Sat, 28 Jul 2018 08:52:59 +0200 Subject: [PATCH] Fixed type hint and added PHPStan to travis --- .travis.yml | 1 + src/Token.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 882c35e..18c4949 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,7 @@ before_script: script: - composer validate + - ./vendor/bin/phpstan analyse src --level=2 - | if [[ $VALIDATION = true ]]; then ./vendor/bin/phpunit --testsuite validation diff --git a/src/Token.php b/src/Token.php index 12abaee..5b601fb 100644 --- a/src/Token.php +++ b/src/Token.php @@ -72,8 +72,11 @@ class Token implements \JsonSerializable { } /** + * Returns the token kind name as a string, or the token number if the name + * was not found. + * * @param int $kind - * @return string (Or int, if the kind name for $kind wasn't found) + * @return int|string */ public static function getTokenKindNameFromValue($kind) { $mapToKindName = self::getTokenKindNameFromValueMap();