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

CountableGhostModelList   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A all() 0 4 1
A count() 0 4 1
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
}