Completed
Pull Request — master (#47)
by Bill
01:27
created

FileCollection::hasFiles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php declare(strict_types = 1);
2
3
namespace Churn\Collections;
4
5
use Illuminate\Support\Collection;
6
use Churn\Values\File;
7
8
class FileCollection extends Collection
9
{
10
    /**
11
     * Determines if the collection has any files left.
12
     * @return boolean
13
     */
14
    public function hasFiles(): bool
15
    {
16
        return $this->count() > 0;
17
    }
18
19
    /**
20
     * Pops off the next file from the collection.
21
     * @return File
22
     */
23
    public function getNextFile(): File
24
    {
25
        return $this->shift();
26
    }
27
}
28