parent
803e4e5dbd
commit
855473148a
|
@ -13,6 +13,7 @@
|
|||
namespace Composer\Json;
|
||||
|
||||
use Composer\Pcre\Preg;
|
||||
use Composer\Util\Filesystem;
|
||||
use JsonSchema\Validator;
|
||||
use Seld\JsonLint\JsonParser;
|
||||
use Seld\JsonLint\ParsingException;
|
||||
|
@ -93,7 +94,7 @@ class JsonFile
|
|||
if ($this->httpDownloader) {
|
||||
$json = $this->httpDownloader->get($this->path)->getBody();
|
||||
} else {
|
||||
if (!is_readable($this->path)) {
|
||||
if (!Filesystem::isReadable($this->path)) {
|
||||
throw new \RuntimeException('The file "'.$this->path.'" is not readable.');
|
||||
}
|
||||
if ($this->io && $this->io->isDebug()) {
|
||||
|
@ -193,7 +194,7 @@ class JsonFile
|
|||
*/
|
||||
public function validateSchema(int $schema = self::STRICT_SCHEMA, ?string $schemaFile = null): bool
|
||||
{
|
||||
if (!is_readable($this->path)) {
|
||||
if (!Filesystem::isReadable($this->path)) {
|
||||
throw new \RuntimeException('The file "'.$this->path.'" is not readable.');
|
||||
}
|
||||
$content = file_get_contents($this->path);
|
||||
|
|
Loading…
Reference in New Issue