Completed
Push — develop ( 521632...eb9c4a )
by Mike
06:46
created

FileFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A createInstance() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * This file is part of phpDocumentor.
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @author    Mike van Riel <[email protected]>
11
 * @copyright 2010-2018 Mike van Riel / Naenius (http://www.naenius.com)
12
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
13
 * @link      http://phpdoc.org
14
 */
15
16
namespace phpDocumentor\Parser;
17
18
use phpDocumentor\Reflection\Php\Factory;
19
use phpDocumentor\Reflection\Php\NodesFactory;
20
21
final class FileFactory
22
{
23
    /**
24
     * Symfony's !tagged helper expression returns an iterable object; but the FileFactory requires an array.
25
     * This means that we need to unpack the middlewares iterable first as a plain array in this factory.
26
     */
27
    public static function createInstance(NodesFactory $nodesFactory, iterable $middlewares): Factory\File
28
    {
29
        return new Factory\File($nodesFactory, iterator_to_array($middlewares));
30
    }
31
}
32