diff --git a/src/Signer/Key.php b/src/Signer/Key.php index 8a97e409..fb2e8611 100644 --- a/src/Signer/Key.php +++ b/src/Signer/Key.php @@ -54,17 +54,22 @@ private function setContent($content) * * @return string * - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ private function readFile($content) { $file = substr($content, 7); if (!is_readable($file)) { - throw new \InvalidArgumentException('You must inform a valid key file'); + throw new InvalidArgumentException('You must inform a valid key file'); + } + + $content = file_get_contents($file); + if ($content === false) { + throw new InvalidArgumentException('You must inform a valid key file'); } - return file_get_contents($file); + return $content; } /**