1<?php
2
3/*
4 * This file is part of the league/commonmark package.
5 *
6 * (c) Colin O'Dell <colinodell@gmail.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace League\CommonMark;
13
14/**
15 * Converts Github Flavored Markdown to HTML.
16 */
17class GithubFlavoredMarkdownConverter extends CommonMarkConverter
18{
19    /**
20     * Create a new commonmark converter instance.
21     *
22     * @param array<string, mixed>      $config
23     * @param EnvironmentInterface|null $environment
24     */
25    public function __construct(array $config = [], EnvironmentInterface $environment = null)
26    {
27        if ($environment === null) {
28            $environment = Environment::createGFMEnvironment();
29        } else {
30            @\trigger_error(\sprintf('Passing an $environment into the "%s" constructor is deprecated in 1.6 and will not be supported in 2.0; use MarkdownConverter instead. See https://commonmark.thephpleague.com/2.0/upgrading/consumers/#commonmarkconverter-and-githubflavoredmarkdownconverter-constructors for more details.', self::class), \E_USER_DEPRECATED);
31        }
32
33        if ($environment instanceof ConfigurableEnvironmentInterface) {
34            $environment->mergeConfig($config);
35        }
36
37        MarkdownConverter::__construct($environment);
38    }
39}
40