Completed
Branch BUG/reg-status-change-recursio... (2db0c9)
by
unknown
20:03 queued 10:32
created

RouteMatchSpecificationCollection   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getIdentifier() 0 6 2
1
<?php
2
3
namespace EventEspresso\core\services\route_match;
4
5
use EventEspresso\core\exceptions\InvalidInterfaceException;
6
use EventEspresso\core\services\collections\Collection;
7
8
/**
9
 * Class RouteMatchSpecificationCollection
10
 * SplObjectStorage Collection of EventEspresso\core\domain\entities\route_match\RouteMatchSpecificationInterface objects
11
 *
12
 * @package EventEspresso\core\services\route_match
13
 * @author  Brent Christensen
14
 * @since   $VID:$
15
 */
16
class RouteMatchSpecificationCollection extends Collection
17
{
18
19
    const COLLECTION_NAME = 'route_match_specifications';
20
21
22
    /**
23
     * RouteMatchSpecificationCollection constructor
24
     *
25
     * @throws InvalidInterfaceException
26
     */
27
    public function __construct()
28
    {
29
        parent::__construct(
30
            'EventEspresso\core\domain\entities\route_match\RouteMatchSpecificationInterface',
31
            RouteMatchSpecificationCollection::COLLECTION_NAME
32
        );
33
    }
34
35
36
    /**
37
     * getIdentifier
38
     * Overrides EventEspresso\core\services\collections\Collection::getIdentifier()
39
     * If no $identifier is supplied, then the  fully qualified class name is used
40
     *
41
     * @param        $object
42
     * @param  mixed $identifier
43
     * @return bool
44
     */
45
    public function getIdentifier($object, $identifier = null)
46
    {
47
        return ! empty($identifier)
48
            ? $identifier
49
            : get_class($object);
50
    }
51
}
52