public static function fromFile(\SplFileObject $file)
    {
        $file->rewind();
        $object = static::fromJson($file->fread($file->getSize()));
        $object->file = $file;

        return $object;
    }