Test Failed
Push — master ( c6b6d3...528954 )
by Dan Michael O.
03:21
created

CountableGhostModelList::count()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Scriptotek\Alma;
4
5
abstract class CountableGhostModelList extends GhostModel implements \Countable
6
{
7
    /* @var array */
8
    protected $resources;
9
10
    /**
11
     * Get all the resources.
12
     *
13
     * @return array
14
     */
15
    public function all()
16
    {
17
        return $this->init()->resources;
18
    }
19
20
    /**
21
     * Number of holdings.
22
     *
23
     * @link http://php.net/manual/en/countable.count.php
24
     *
25
     * @return int The number of holdings as an integer.
26
     */
27
    public function count()
28
    {
29
        return count($this->all());
30
    }
31
}