Completed
Pull Request — master (#6)
by De Cramer
11:31
created

PluginDescriptionFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace eXpansion\Core\Model\Plugin;
4
5
/**
6
 * Class PluginDescriptionFactory crates plugin description instances.
7
 *
8
 * @package eXpansion\Core\Model\Plugin
9
 * @author Oliver de Cramer
10
 */
11
class PluginDescriptionFactory
12
{
13
    protected $className;
14
15
    /**
16
     * PluginFactory constructor.
17
     *
18
     * @param $className
19
     */
20
    public function __construct($className)
21
    {
22
        $this->className = $className;
23
    }
24
25
    /**
26
     * Create an instance for a certain plugin.
27
     *
28
     * @param $pluginId
29
     *
30
     * @return mixed
31
     */
32
    public function create($pluginId)
33
    {
34
        $class = $this->className;
35
36
        return new $class($pluginId);
37
    }
38
}
39