FixtureExecutorManager   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A validatePlugin() 0 12 3
1
<?php
2
/**
3
 * @link    https://github.com/nnx-framework/doctrine-fixture-module
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace Nnx\DoctrineFixtureModule\Executor;
7
8
use Zend\ServiceManager\AbstractPluginManager;
9
10
/**
11
 * Class FixtureFilterManager
12
 *
13
 * @package Nnx\DoctrineFixtureModule\Executor
14
 */
15
class FixtureExecutorManager extends AbstractPluginManager implements FixtureExecutorManagerInterface
16
{
17
    /**
18
     * Имя секции в конфиги приложения отвечающей за настройки менеджера
19
     *
20
     * @var string
21
     */
22
    const CONFIG_KEY = 'nnx_executor_filter';
23
24
    /**
25
     * {@inheritDoc}
26
     *
27
     * @throws Exception\RuntimeException
28
     */
29
    public function validatePlugin($plugin)
30
    {
31
        if ($plugin instanceof ExecutorInterface) {
32
            return;
33
        }
34
35
        throw new Exception\RuntimeException(sprintf(
36
            'Plugin of type %s is invalid; must implement %s',
37
            (is_object($plugin) ? get_class($plugin) : gettype($plugin)),
38
            ExecutorInterface::class
39
        ));
40
    }
41
}
42