Document   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 13 2
1
<?php
2
3
/*
4
 * This file is part of gpupo/pipe2
5
 *
6
 * (c) Gilmar Pupo <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * For more information, see
12
 * <https://opensource.gpupo.com/pipe2/>.
13
 */
14
15
namespace Gpupo\Pipe2\Documentor;
16
17
use Gpupo\Pipe2\DocumentInterface;
18
use Twig_Environment;
19
use Twig_Loader_String;
20
21
class Document implements DocumentInterface
22
{
23
    public $formatOutput;
24
25
    public function render($list)
26
    {
27
        $loader = new Twig_Loader_String();
0 ignored issues
show
Deprecated Code introduced by
The class Twig_Loader_String has been deprecated with message: since 1.18.1 (to be removed in 2.0)

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
28
        $twig = new Twig_Environment($loader);
29
        $output = '#API Docs'."\n\n";
30
        foreach ($list as $key => $data) {
31
            $output .= $twig->render(file_get_contents(__DIR__.'/view.md'), $data);
32
        }
33
34
        $output .= "\n\n---\n Documentation generated by [pipe2](https://opensource.gpupo.com/pipe2/)\n";
35
36
        return $output;
37
    }
38
}
39