ReportManager   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A validatePlugin() 0 8 2
1
<?php
2
3
namespace ConferenceTools\Tickets\Report;
4
5
use Zend\ServiceManager\AbstractPluginManager;
6
use Zend\ServiceManager\Exception;
7
8
class ReportManager extends AbstractPluginManager
9
{
10
    /**
11
     * Validate the plugin
12
     *
13
     * Checks that the filter loaded is either a valid callback or an instance
14
     * of FilterInterface.
15
     *
16
     * @param  mixed $plugin
17
     * @return void
18
     * @throws Exception\RuntimeException if invalid
19
     */
20
    public function validatePlugin($plugin)
21
    {
22
        if ($plugin instanceof ReportInterface) {
23
            return;
24
        }
25
26
        throw new Exception\RuntimeException(
27
            sprintf('Report %s doesn\'t implement report interface', get_class($plugin))
28
        );
29
    }
30
31
}