Completed
Push — master ( 2b6d49...c13cc5 )
by Florent
02:37
created

PayloadConverterFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createPayloadConverter() 0 10 2
1
<?php
2
3
/*
4
 * The MIT License (MIT)
5
 *
6
 * Copyright (c) 2014-2015 Spomky-Labs
7
 *
8
 * This software may be modified and distributed under the terms
9
 * of the MIT license.  See the LICENSE file for details.
10
 */
11
12
namespace Jose\Factory;
13
14
use Jose\Payload\PayloadConverterManager;
15
16
final class PayloadConverterFactory
17
{
18
    /**
19
     * @param \Jose\Payload\PayloadConverterInterface[] $payload_converters
20
     *
21
     * @return \Jose\Payload\PayloadConverterManagerInterface
22
     */
23
    public static function createPayloadConverter(array $payload_converters = [])
24
    {
25
        $payload_converter_manager = new PayloadConverterManager();
26
27
        foreach ($payload_converters as $payload_converter) {
28
            $payload_converter_manager->addConverter($payload_converter);
29
        }
30
31
        return $payload_converter_manager;
32
    }
33
}
34