Code Duplication    Length = 9-9 lines in 2 locations

src/EntityCollection.php 2 locations

@@ 322-330 (lines=9) @@
319
     * @throws MappingException
320
     * @return mixed
321
     */
322
    public function max($key = null)
323
    {
324
        return $this->reduce(function ($result, $item) use ($key) {
325
            $wrapper = $this->factory->make($item);
326
327
            return (is_null($result) || $wrapper->getEntityAttribute($key) > $result) ?
328
                $wrapper->getEntityAttribute($key) : $result;
329
        });
330
    }
331
332
    /**
333
     * Get the min value of a given key.
@@ 339-347 (lines=9) @@
336
     * @throws MappingException
337
     * @return mixed
338
     */
339
    public function min($key = null)
340
    {
341
        return $this->reduce(function ($result, $item) use ($key) {
342
            $wrapper = $this->factory->make($item);
343
344
            return (is_null($result) || $wrapper->getEntityAttribute($key) < $result)
345
                ? $wrapper->getEntityAttribute($key) : $result;
346
        });
347
    }
348
349
    /**
350
     * Get an array with the values of a given key.