Code Duplication    Length = 15-16 lines in 2 locations

src/Request/Factory.php 2 locations

@@ 60-74 (lines=15) @@
57
     *
58
     * @return RequestInterface
59
     */
60
    public function createByebyeRequest(ByebyeOptions $options)
61
    {
62
        if (null === $options->getUniqueServiceName()) {
63
            throw new \RuntimeException('Unique service name not specified.');
64
        }
65
66
        $request = new NotifyRequest();
67
        return $request
68
            ->withRequestTarget('*')
69
            ->withProtocolVersion('1.1')
70
            ->withHeader('HOST', (string)$request->getUri())
71
            ->withHeader('NT', (string)$options->getNotificationType())
72
            ->withHeader('NTS', '"ssdp:byebye"')
73
            ->withHeader('USN', (string)$options->getUniqueServiceName());
74
    }
75
76
77
    /**
@@ 107-122 (lines=16) @@
104
     *
105
     * @return RequestInterface
106
     */
107
    public function createUpdateRequest(UpdateOptions $options)
108
    {
109
        if (null === $options->getUniqueServiceName()) {
110
            throw new \RuntimeException('Unique service name not specified.');
111
        }
112
113
        $request = new NotifyRequest();
114
        return $request
115
            ->withRequestTarget('*')
116
            ->withProtocolVersion('1.1')
117
            ->withHeader('HOST', (string)$request->getUri())
118
            ->withHeader('LOCATION', (string)$options->getDescriptionUrl())
119
            ->withHeader('NT', (string)$options->getNotificationType())
120
            ->withHeader('NTS', '"ssdp:update"')
121
            ->withHeader('USN', (string)$options->getUniqueServiceName());
122
    }
123
}
124