Code Duplication    Length = 13-16 lines in 5 locations

source/Spiral/Storage/Entities/StorageBucket.php 5 locations

@@ 149-161 (lines=13) @@
146
    /**
147
     * {@inheritdoc}
148
     */
149
    public function exists($name)
150
    {
151
        $this->logger()->info(
152
            "Check existence of '{$this->buildAddress($name)}' at '{$this->getName()}'."
153
        );
154
155
        $benchmark = $this->benchmark($this->getName(), "exists::{$this->buildAddress($name)}");
156
        try {
157
            return (bool)$this->server->exists($this, $name);
158
        } finally {
159
            $this->benchmark($benchmark);
160
        }
161
    }
162
163
    /**
164
     * {@inheritdoc}
@@ 166-178 (lines=13) @@
163
    /**
164
     * {@inheritdoc}
165
     */
166
    public function size($name)
167
    {
168
        $this->logger()->info(
169
            "Get size of '{$this->buildAddress($name)}' at '{$this->getName()}'."
170
        );
171
172
        $benchmark = $this->benchmark($this->getName(), "size::{$this->buildAddress($name)}");
173
        try {
174
            return $this->server->size($this, $name);
175
        } finally {
176
            $this->benchmark($benchmark);
177
        }
178
    }
179
180
    /**
181
     * {@inheritdoc}
@@ 212-227 (lines=16) @@
209
    /**
210
     * {@inheritdoc}
211
     */
212
    public function allocateFilename($name)
213
    {
214
        $this->logger()->info(
215
            "Allocate filename of '{$this->buildAddress($name)}' at '{$this->getName()}' server."
216
        );
217
218
        $benchmark = $this->benchmark(
219
            $this->getName(), "filename::{$this->buildAddress($name)}"
220
        );
221
222
        try {
223
            return $this->server()->allocateFilename($this, $name);
224
        } finally {
225
            $this->benchmark($benchmark);
226
        }
227
    }
228
229
    /**
230
     * {@inheritdoc}
@@ 232-247 (lines=16) @@
229
    /**
230
     * {@inheritdoc}
231
     */
232
    public function allocateStream($name)
233
    {
234
        $this->logger()->info(
235
            "Get stream for '{$this->buildAddress($name)}' at '{$this->server}' server."
236
        );
237
238
        $benchmark = $this->benchmark(
239
            $this->getName(), "stream::{$this->buildAddress($name)}"
240
        );
241
242
        try {
243
            return $this->server()->allocateStream($this, $name);
244
        } finally {
245
            $this->benchmark($benchmark);
246
        }
247
    }
248
249
    /**
250
     * {@inheritdoc}
@@ 252-267 (lines=16) @@
249
    /**
250
     * {@inheritdoc}
251
     */
252
    public function delete($name)
253
    {
254
        $this->logger()->info(
255
            "Delete '{$this->buildAddress($name)}' at '{$this->server}' server."
256
        );
257
258
        $benchmark = $this->benchmark(
259
            $this->getName(), "delete::{$this->buildAddress($name)}"
260
        );
261
262
        try {
263
            $this->server->delete($this, $name);
264
        } finally {
265
            $this->benchmark($benchmark);
266
        }
267
    }
268
269
    /**
270
     * {@inheritdoc}