From 06f12bb7cb24f5f25252670d42f9c2fd7297202b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Thu, 2 Aug 2018 23:33:35 +0200 Subject: [PATCH] Use method compatible with all supported versions --- src/Signer/Key.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Signer/Key.php b/src/Signer/Key.php index 7b727aff..851fd687 100644 --- a/src/Signer/Key.php +++ b/src/Signer/Key.php @@ -61,9 +61,14 @@ private function setContent($content) private function readFile($content) { try { - $file = new SplFileObject(substr($content, 7)); + $file = new SplFileObject(substr($content, 7)); + $content = ''; - return $file->fread($file->getSize()); + while (! $file->eof()) { + $content .= $file->fgets(); + } + + return $content; } catch (Exception $exception) { throw new InvalidArgumentException('You must inform a valid key file', 0, $exception); }