Skip to content

Commit

Permalink
feat(comment): add parse from file
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Apr 5, 2021
1 parent 8ff6d0b commit c9511b0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,11 @@ public static function parse(string $json, bool $assoc = false, int $depth = 512

return $parser->decode($json, $assoc, $depth, $options);
}

public static function parseFromFile(string $file, bool $assoc = false, int $depth = 512, int $options = 0)
{
$json = file_get_contents($file);

return static::parse($json, $assoc, $depth, $options);
}
}

0 comments on commit c9511b0

Please sign in to comment.