src/File.php
protected function checkFileReadPermissions(): void
    {
        if (!$this->isFile() || !$this->isReadable()) {
            throw new FileNotFoundException(sprintf('unable to open file: "%s"', $this->storage instanceof Storage\Disk ? $this->storage->path()->raw : get_class($this->storage)), 404);
        } elseif (!$this->storage->doesSatisfyConstraints()) {
            throw new AccessDeniedException(sprintf('unable to open file: "%s"', $this->storage instanceof Storage\Disk ? $this->storage->path()->raw : get_class($this->storage)), 404, $this->storage->getConstraintViolations());
        }
    }
protected function checkFileReadPermissions(): void
    {
        if (!$this->isFile() || !$this->isReadable()) {
            throw new FileNotFoundException(sprintf('unable to open file: "%s"', $this->storage instanceof Storage\Disk ? $this->storage->path()->raw : get_class($this->storage)), 404);
        } elseif (!$this->storage->doesSatisfyConstraints()) {
            throw new AccessDeniedException(sprintf('unable to open file: "%s"', $this->storage instanceof Storage\Disk ? $this->storage->path()->raw : get_class($this->storage)), 404, $this->storage->getConstraintViolations());
        }
    }
validate constraints and check file permissions
@return void
@throws FileNotFoundException|AccessDeniedException