ObjectCreatorService   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 16
c 0
b 0
f 0
rs 10
wmc 2
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createObjectFromInterface() 0 5 2
1
<?php
2
declare(strict_types=1);
3
/**
4
 * Created by PhpStorm.
5
 * User: benedikt
6
 * Date: 1/30/18
7
 * Time: 6:26 PM
8
 */
9
10
namespace Tfboe\FmLib\Service;
11
12
/**
13
 * Class ObjectCreatorService
14
 * @package Tfboe\FmLib\Service
15
 */
16
class ObjectCreatorService implements ObjectCreatorServiceInterface
17
{
18
19
//<editor-fold desc="Public Methods">
20
  /**
21
   * @inheritDoc
22
   * @param array|null config used config array, if null config('fm-lib') is used. Mainly used for testing purposes
23
   */
24
  public function createObjectFromInterface(string $interface, $args = [], $config = null)
25
  {
26
    $class = ($config == null ? config('fm-lib') : $config)['entityMaps'][$interface];
27
    return new $class(...$args);
28
  }
29
//</editor-fold desc="Public Methods">
30
31
}