GeneratorFactory::createDefault()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Tonic\Component\ApiLayer\JsonRpcExtensions\Documentation;
4
5
use Doctrine\Common\Annotations\PhpParser;
6
use Tonic\Component\Reflection\TypeResolver;
7
8
/**
9
 * Simple factory for documentation generator.
10
 */
11
class GeneratorFactory
12
{
13
    /**
14
     * @return Generator
15
     */
16
    public function createDefault()
17
    {
18
        return new Generator(
19
            new MetadataExtractor(new TypeResolver(new PhpParser())),
20
            new \Twig_Environment(new \Twig_Loader_Filesystem([
21
                __DIR__.'/Resources',
22
            ]))
23
        );
24
    }
25
}
26