protected function generateReadScalarStatement($type)
    {
        $mapping = [
            Type::TYPE_INT32_VALUE    => '$reader->readVarint($stream)',
            Type::TYPE_INT64_VALUE    => '$reader->readVarint($stream)',
            Type::TYPE_UINT64_VALUE   => '$reader->readVarint($stream)',
            Type::TYPE_UINT32_VALUE   => '$reader->readVarint($stream)',
            Type::TYPE_DOUBLE_VALUE   => '$reader->readDouble($stream)',
            Type::TYPE_FIXED64_VALUE  => '$reader->readFixed64($stream)',
            Type::TYPE_SFIXED64_VALUE => '$reader->readSFixed64($stream)',
            Type::TYPE_FLOAT_VALUE    => '$reader->readFloat($stream)',
            Type::TYPE_FIXED32_VALUE  => '$reader->readFixed32($stream)',
            Type::TYPE_SFIXED32_VALUE => '$reader->readSFixed32($stream)',
            Type::TYPE_ENUM_VALUE     => '$reader->readVarint($stream)',
            Type::TYPE_SINT32_VALUE   => '$reader->readZigzag($stream)',
            Type::TYPE_SINT64_VALUE   => '$reader->readZigzag($stream)',
            Type::TYPE_BOOL_VALUE     => '$reader->readBool($stream)',
            Type::TYPE_STRING_VALUE   => '$reader->readString($stream)',
            Type::TYPE_BYTES_VALUE    => '$reader->readByteStream($stream)',
        ];

        if (isset($mapping[$type])) {
            return $mapping[$type];
        }

        throw new InvalidArgumentException('Unknown field type : ' . $type);
    }