for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Phoole (PHP7.2+)
*
* @category Library
* @package Phoole\Base
* @copyright Copyright (c) 2019 Hong Zhang
*/
declare(strict_types=1);
namespace Phoole\Base\Reader;
* JsonReader
class JsonReader extends AbstractReader
{
* {@inheritDoc}
protected function readFromFile($path)
try {
$data = \json_decode(\file_get_contents($path), TRUE);
if ($data === NULL) {
throw new \RuntimeException(\json_last_error_msg());
}
} catch (\Exception $e) {
throw new \RuntimeException($e->getMessage());
return $data;