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

FileCollection   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A hasFiles() 0 4 1
A getNextFile() 0 4 1
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