<commit_before><?php

/*
 * This file is part of the ApiDocBundle package.
 *
 * (c) EXSyst
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace EXSyst\Bundle\ApiDocBundle\Describer;

use Doctrine\Common\Util\ClassUtils;
use EXSyst\Bundle\ApiDocBundle\RouteDescriber\RouteDescriberInterface;
use gossi\swagger\Swagger;
use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouterInterface;

class SwaggerPhpDescriber implements DescriberInterface
{
    private $projectPath;
    private $overwrite;

    /**
     * @param string $projectPath
     */
    public function __construct(string $projectPath, bool $overwrite = false)
    {
        $this->projectPath = $projectPath;
        $this->overwrite = $overwrite;
    }

    public function describe(Swagger $api)
    {
        $annotation = \Swagger\scan($this->projectPath);

        $api->merge($this->normalize($annotation), $this->overwrite);
    }

    private function normalize($annotation)
    {
        return json_decode(json_encode($annotation));
    }
}
<commit_msg>Fix CS<commit_after><?php

/*
 * This file is part of the ApiDocBundle package.
 *
 * (c) EXSyst
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace EXSyst\Bundle\ApiDocBundle\Describer;

use gossi\swagger\Swagger;

class SwaggerPhpDescriber implements DescriberInterface
{
    private $projectPath;
    private $overwrite;

    /**
     * @param string $projectPath
     */
    public function __construct(string $projectPath, bool $overwrite = false)
    {
        $this->projectPath = $projectPath;
        $this->overwrite = $overwrite;
    }

    public function describe(Swagger $api)
    {
        $annotation = \Swagger\scan($this->projectPath);

        $api->merge($this->normalize($annotation), $this->overwrite);
    }

    private function normalize($annotation)
    {
        return json_decode(json_encode($annotation));
    }
}

{'fraction_non_alphanumeric': 0.10649229332087809, 'fraction_numerical': 0.0, 'mean_word_length': 3.490566037735849, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4019259', 'n_tokens_mistral': 630, 'n_tokens_neox': 619, 'n_words': 149}