Skip to content

Commit

Permalink
Merge pull request #257 from lcobucci/fix-php-55-compatibility
Browse files Browse the repository at this point in the history
Fix PHP 5.5 compatibility
  • Loading branch information
lcobucci authored Aug 3, 2018
2 parents 01da822 + 06f12bb commit c9704b7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Signer/Key.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit c9704b7

Please sign in to comment.