GridPluginManager::validatePlugin()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
/**
3
 * @company MTE Telecom, Ltd.
4
 * @author Roman Malashin <[email protected]>
5
 */
6
7
namespace Nnx\DataGrid;
8
9
use Zend\ServiceManager\AbstractPluginManager;
10
11
/**
12
 * Class GridPluginManager
13
 * @package Nnx\DataGrid
14
 */
15
class GridPluginManager extends AbstractPluginManager
16
{
17
    /**
18
     * @var bool
19
     */
20
    protected $shareByDefault = false;
21
22
    /**
23
     * Validate the plugin
24
     *
25
     * Checks that the filter loaded is either a valid callback or an instance
26
     * of FilterInterface.
27
     *
28
     * @param  mixed $plugin
29
     * @return void
30
     * @throws Exception\RuntimeException if invalid
31
     */
32
    public function validatePlugin($plugin)
33
    {
34
        if ($plugin instanceof GridInterface) {
35
            return;
36
        }
37
38
        throw new Exception\RuntimeException(sprintf('Grid должен реализовывать интерфейс %s', GridInterface::class));
39
    }
40
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
41