From ee870e34648e5fa15bc556a80a65e6cee4b4c0df Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Sat, 19 May 2018 06:12:24 -0300 Subject: [PATCH] Fixes from PHPStan (#502) --- lib/PhpParser/BuilderFactory.php | 2 +- lib/PhpParser/Error.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/PhpParser/BuilderFactory.php b/lib/PhpParser/BuilderFactory.php index c28f40fa..ee855589 100644 --- a/lib/PhpParser/BuilderFactory.php +++ b/lib/PhpParser/BuilderFactory.php @@ -104,7 +104,7 @@ class BuilderFactory /** * Creates a namespace/class use builder. * - * @param string|Node\Name Name to alias + * @param string|Node\Name $name Name to alias * * @return Builder\Use_ The create use builder */ diff --git a/lib/PhpParser/Error.php b/lib/PhpParser/Error.php index cedb4124..d1fb959d 100644 --- a/lib/PhpParser/Error.php +++ b/lib/PhpParser/Error.php @@ -15,7 +15,7 @@ class Error extends \RuntimeException * (or start line of error -- deprecated) */ public function __construct(string $message, $attributes = []) { - $this->rawMessage = (string) $message; + $this->rawMessage = $message; if (is_array($attributes)) { $this->attributes = $attributes; } else { @@ -76,7 +76,7 @@ class Error extends \RuntimeException * @param string $message Error message */ public function setRawMessage(string $message) { - $this->rawMessage = (string) $message; + $this->rawMessage = $message; $this->updateMessage(); } @@ -86,7 +86,7 @@ class Error extends \RuntimeException * @param int $line Error start line */ public function setStartLine(int $line) { - $this->attributes['startLine'] = (int) $line; + $this->attributes['startLine'] = $line; $this->updateMessage(); }