Code Duplication    Length = 12-16 lines in 3 locations

src/Test/NginxTest.php 1 location

@@ 162-176 (lines=15) @@
159
     *
160
     * @return Nginx
161
     */
162
    protected function getProxyClient($purgeLocation = '')
163
    {
164
        if (null === $this->proxyClient) {
165
            $httpDispatcher = new HttpDispatcher(
166
                ['http://127.0.0.1:'.$this->getCachingProxyPort()],
167
                $this->getHostName().':'.$this->getCachingProxyPort()
168
            );
169
170
            $this->proxyClient = new Nginx($httpDispatcher, [
171
                'purge_location' => $purgeLocation,
172
            ]);
173
        }
174
175
        return $this->proxyClient;
176
    }
177
}
178

src/Test/SymfonyTest.php 1 location

@@ 116-131 (lines=16) @@
113
     *
114
     * @return Symfony
115
     */
116
    protected function getProxyClient()
117
    {
118
        if (null === $this->proxyClient) {
119
            $httpDispatcher = new HttpDispatcher(
120
                ['http://127.0.0.1:'.$this->getCachingProxyPort()],
121
                $this->getHostName().':'.$this->getCachingProxyPort()
122
            );
123
124
            $this->proxyClient = new Symfony($httpDispatcher, [
125
                    'purge_method' => 'NOTIFY',
126
                ]
127
            );
128
        }
129
130
        return $this->proxyClient;
131
    }
132
}
133

src/Test/VarnishTest.php 1 location

@@ 177-188 (lines=12) @@
174
     *
175
     * @return Varnish
176
     */
177
    protected function getProxyClient()
178
    {
179
        if (null === $this->proxyClient) {
180
            $httpDispatcher = new HttpDispatcher(
181
                ['http://127.0.0.1:'.$this->getCachingProxyPort()],
182
                $this->getHostName().':'.$this->getCachingProxyPort()
183
            );
184
            $this->proxyClient = new Varnish($httpDispatcher);
185
        }
186
187
        return $this->proxyClient;
188
    }
189
190
    /**
191
     * Get the hostname where your application can be reached.