Code Duplication    Length = 19-19 lines in 2 locations

src/Factory.php 1 location

@@ 18-36 (lines=19) @@
15
    /**
16
     * @return SyntaxHighlighter
17
     */
18
    public function __invoke()
19
    {
20
        $lexer = new Lexer([
21
            'usedAttributes' => [
22
                'comments', 'startLine', 'endLine', 'startFilePos', 'endFilePos', 'startTokenPos', 'endTokenPos'
23
            ]
24
        ]);
25
        
26
        $parserFactory = new ParserFactory;
27
        $color = new Color;
28
        $color->setForceStyle(true);
29
        return new SyntaxHighlighter(
30
            $parserFactory->create(ParserFactory::PREFER_PHP7, $lexer),
31
            new SyntaxHighlightPrinter(
32
                new SyntaxHighlighterConfig,
33
                new ColorsAdapter($color)
34
            )
35
        );
36
    }
37
}
38

test/SyntaxHighlighterTest.php 1 location

@@ 53-71 (lines=19) @@
50
    /**
51
     * @return SyntaxHighlighter
52
     */
53
    private function getHighlighter()
54
    {
55
        $lexer = new Lexer([
56
            'usedAttributes' => [
57
                'comments', 'startLine', 'endLine', 'startFilePos', 'endFilePos', 'startTokenPos', 'endTokenPos'
58
            ]
59
        ]);
60
        
61
        $parserFactory = new ParserFactory;
62
        $color = new Color;
63
        $color->setForceStyle(true);
64
        return new SyntaxHighlighter(
65
            $parserFactory->create(ParserFactory::PREFER_PHP7, $lexer),
66
            new SyntaxHighlightPrinter(
67
                new SyntaxHighlighterConfig,
68
                new ColorsAdapter($color)
69
            )
70
        );
71
    }
72
}
73