Passed
Push — master ( 4595aa...20e07b )
by Romain
06:34
created

EventFlexFormResolver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getInstanceClassName() 0 6 2
1
<?php
2
3
/*
4
 * Copyright (C) 2018
5
 * Nathan Boiron <[email protected]>
6
 * Romain Canon <[email protected]>
7
 *
8
 * This file is part of the TYPO3 NotiZ project.
9
 * It is free software; you can redistribute it and/or modify it
10
 * under the terms of the GNU General Public License, either
11
 * version 3 of the License, or any later version.
12
 *
13
 * For the full copyright and license information, see:
14
 * http://www.gnu.org/licenses/gpl-3.0.html
15
 */
16
17
namespace CuyZ\Notiz\Core\Definition\Tree\EventGroup\Event\Configuration\FlexForm;
18
19
use CuyZ\Notiz\Core\Definition\Tree\EventGroup\Event\Configuration\EventConfiguration;
20
use Romm\ConfigurationObject\Service\Items\MixedTypes\MixedTypesInterface;
21
use Romm\ConfigurationObject\Service\Items\MixedTypes\MixedTypesResolver;
22
use TYPO3\CMS\Core\SingletonInterface;
23
24
/**
25
 * Resolver for the property:
26
 *
27
 * @see \CuyZ\Notiz\Core\Definition\Tree\EventGroup\Event\Configuration\EventConfiguration::$flexForm
28
 */
29
class EventFlexFormResolver implements SingletonInterface, MixedTypesInterface
30
{
31
    /**
32
     * @param MixedTypesResolver $resolver
33
     */
34
    public static function getInstanceClassName(MixedTypesResolver $resolver)
35
    {
36
        $data = $resolver->getData();
37
38
        if (isset($data[EventConfiguration::PROVIDER_CLASS_NAME])) {
39
            $resolver->setObjectType($data[EventConfiguration::PROVIDER_CLASS_NAME]);
40
        }
41
    }
42
}
43